alienx2 Posted April 5, 2014 Share Posted April 5, 2014 (edited) Hi, im new to prestashop and im trying learn some prestashop code..how to put code for get name of carrier instead of $cart->id_carrier... here code: function hookPayment($params) { global $smarty; global $carrier; if (!$this->active) return ; if (strtolower($carrier->name) != "carrier name") return ; $currency = $this->getCurrency(); /* Photo is copyrighted by Leticia Wilson - Fotolia.com, licenced to PrestaShop company */ $smarty->assign(array( 'this_path' => $this->_path, 'fee' => number_format($this->getCost($params), 2, '.', ''), 'this_path_ssl' => Tools::getShopDomainSsl(true, true).__PS_BASE_URI__.'modules/'.$this->name.'/' )); return $this->display(__FILE__, 'payment.tpl'); } error: Notice: Trying to get property of non-object Edited April 8, 2014 by vekia (see edit history) Link to comment Share on other sites More sharing options...
alienx2 Posted April 6, 2014 Author Share Posted April 6, 2014 anyone? Link to comment Share on other sites More sharing options...
alienx2 Posted April 7, 2014 Author Share Posted April 7, 2014 hello? anyone help? Link to comment Share on other sites More sharing options...
vekia Posted April 7, 2014 Share Posted April 7, 2014 use print_r($carrier); and you will see all available variables, does the name variable exist in this array? Link to comment Share on other sites More sharing options...
alienx2 Posted April 7, 2014 Author Share Posted April 7, 2014 i put that in hookpayment.. but its nothing to show array... =( bec every edit carrier will change id then payment cant strict it. Link to comment Share on other sites More sharing options...
alienx2 Posted April 8, 2014 Author Share Posted April 8, 2014 now i got problem solved... i found it from: http://www.prestashop.com/forums/topic/185631-show-the-selected-carrier-name-in-tpl/ Link to comment Share on other sites More sharing options...
vekia Posted April 8, 2014 Share Posted April 8, 2014 thank you for posting url to the solution. i marked your answer as a solution and whole topic as solved with regards, Milos 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