Jump to content

[SOLVED] how change a variable inside tpl file


jemmeli
 Share

Recommended Posts

hello

 

I have a function inside a module that use a action-hook to modify a variable inside "shopping-cart.tpl"

 

public function hookActionCartSave($params) {

global $smarty;
$this->context->smarty->assign(array(
'total_price' => 700
));
$this->setTemplate(_PS_THEME_DIR_.'shopping-cart.tpl');

 }

 

 

I dint know what wrong with my code but when i put the following code in my tpl file "shopping-cart.tpl" :

 

 

{$total_price'}

 

i did not got the needed value "700"

Edited by jemmeli (see edit history)

Share this post


Link to post
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
 Share

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More