Jump to content

Cart->Addcartrule($Id) Returns Null


sibrodo

Recommended Posts

Hello,

 

I tried to execute the following code:

if (($cartRule = new CartRule(CartRule::getIdByCode($code))) && Validate::isLoadedObject($cartRule))
{
$is_applied = $this->context->cart->addCartRule($cartRule->id);
echo "<pre>";
print_r($is_applied);
die();
Tools::redirect('index.php?controller=order-opc');
}

however, it returns nothing at all (what-so-ever).

 

I am using Prestashop 1.5.4 for this code. Can anyone help me why this is happening ? Am i missing something ?

 

Cheers,

 

 

Rama

 

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...