Jump to content

[SOLVED] How to get name of carrier instead id_carrier...


alienx2

Recommended Posts

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 by vekia (see edit history)
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...