Developer forum

Forum » Development » Problem loading template

Problem loading template

Per Ljung
Reply

 Hi!

I'm trying to load this template from a custom checkout handler, but there's no output, it seems like the template cannot be found. What can be wrong?


Dynamicweb.Templatev2.Template receipt = null;

I know that the template file is placed there in this folder.

receipt = new Dynamicweb.Templatev2.Template("/Files/Templates/eCom7/CartV2/Step/ReceiptOK.html");


And I run receipt.Output();


/Per


Replies

 
Nicolai Høeg Pedersen
Reply
Templates are loaded relative to /Files/Templates. So do like this:

receipt = new Dynamicweb.Templatev2.Template("eCom7/CartV2/Step/ReceiptOK.html");


 

You must be logged in to post in the forum