Developer forum

Forum » Rapido » Please help with a small template change

Please help with a small template change

Hans Ravnsfjall
Hans Ravnsfjall
Reply

I hope someone can help me, because i find the Rapido templates extremely confusing.

 

In the email that is being sent when an order is created (eCom7/CartV2/Mail/Order.cshtml) - there is a code that renders the button that links to show the receipt in browser.

My question is about making small changes to the button

The code looks like this

@helper RenderReviewButton()
{
@RenderButton(GetString("Ecom:Order.ReceiptURL"), "Review order online", "center");
}

I want to alter the text on the button so say "Print order", and then I want to add a &pdf=true parameter to the URL.

I have tried altering the text and adding a +"&pdf=true" to the GetString - so that it looks like this

@RenderButton(GetString("Ecom:Order.ReceiptURL")+"&pdf=true", "Print Order", "center");

But that breaks the template entirely.

Hope someone can help me make this small change to the button?

 

/Hans

 

 


Replies

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

Hi Hans

What does "break template entirely" mean? What happens - do you get an error, an exception, the wrong link or what happens?

Thank you for clarifying!

 
Hans Ravnsfjall
Hans Ravnsfjall
Reply

Sorry Nicolai

It turns out that it is my Prettier plugin to VSCODE that was breaking the template, and the alteration I have done is perfectly fine and working as expected.

My bad 🙏

 

/Hans

 
Nicolai Pedersen Dynamicweb Employee
Nicolai Pedersen
Reply

All those fancy tools :-).

Glad you made it work!

 

You must be logged in to post in the forum