Premitium Posted November 7, 2016 Share Posted November 7, 2016 Guys, I have created a *.tpl file and I assigned some variables to the smarty array e.g: public function hookExtraCarrier($params) { //deleted code... $this->context->smarty->assign(array( 'wineo_free_shipping_id' => Configuration::get('WINEO_FREE_CARRIER_ID'), 'this_path' => $this->_path, 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/', )); return $this->display(__FILE__, 'wineocarrier.tpl'); } I have another method that I want to add more variables to the array. I have tried things like: public function addCarrierNameList() { //deleted code... if (isset($carrierNameNorm)) { $this->context->smarty->assign(array( 'wineo_shipping_type' => $carrierNameNorm['name'] )); } // echo '<pre>', print_r($carrierNameNorm['name']),'</pre>'; // return $this->display(__FILE__, 'wineocarrier.tpl'); } } I cannot get the 'wineo_shipping_type' variable in the template file. What is the best way to approach this? Thanks!!! Link to comment Share on other sites More sharing options...
vekia Posted November 7, 2016 Share Posted November 7, 2016 you run function addCarrierNameList() somewhere? Link to comment Share on other sites More sharing options...
Premitium Posted November 8, 2016 Author Share Posted November 8, 2016 you run function addCarrierNameList() somewhere? Yes, it called by an ajax function in the tpl. The request is successful but the variable is not set in the view. I am checking like this: {if isset($wineo_shipping_type)} Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now