Jump to content

Product Price Update Add to Cart


iamgaurav

Recommended Posts

Hi

 

Is there a possible way to update the product unit price specifc just to a particular cart and not the global product? 

$cart = new Cart();
$cart->id_customer = (int)$this->context->cookie->id_customer;
$cart->id_currency = 1;
$cart->id_lang = 1;
$cart->add();
$this->context->cookie->id_cart = (int)($cart->id);    
$cart->update();
				
				
$product = new Product(4305, true, (int)($this->context->cookie->id_lang));
$cart->updateQty(1,$product->id);
$cart->update();

What i currently want to do is Product ID 4305 has a price of 1$ i want to add that product to User A for 50$ and for User B 60$. 

 

Is there a possible way to update the unit price of a product being added to a cart only ? Rather than updating the complete product ?

 

Thanks

 

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
  • 2 years later...

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