Jump to content

Convert HTML/PHP in to script that PS understands


motion2082

Recommended Posts

Hey guys,

I would like to add this snippet of code to my order-confirmation.tpl

<img src="https://www.myshopping.com.au/sale.asp?mid=1234567&amount=<?php echo number_format($order_total_result[value],2) ; ?>&order=<?php echo $order_id ; ?>"  width="1" height="1">

I have started trying to make a basic module to implement this code however I would like someone to confirm this will work as it's calling a URL with a php echo inside.

If you get the time could you please have a look?

Regards,
Motion

myshipping.zip

Link to comment
Share on other sites

4 hours ago, musicmaster said:

You cannot use php in the template files. The Smarty versions that Prestashop uses don't allow that. 

The only way to get the desired effect is to assign the desired text to a variable in the PHP code that call the template to be displayed.

 

Thanks MusicMaster, found this to be the case.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...