Jump to content

Add product to cart of a client


Med6

Recommended Posts

Good Morning,

 

I have the ID of a client and ID of product and I want to add the product to the carte of  the client from a module I created in the B.O Programmatically 

 

 

Thanks 

Link to comment
Share on other sites

Hi Med,

(Do you want it to the cart, or a client's order? IN Back office, there's functionality already to add a product to an order (N.B. It may also update the linked cart, now that I think of it, you well worth have a look how they implemented it there) )

 

To add a product/update quantity of a cart, you could use function in Cart.php:

public function updateQty($quantity, $id_product, $id_product_attribute = null, $id_customization = false, $operator = 'up', $id_address_delivery = 0, Shop $shop = null, $auto_add_cart_rule = true)
 
(Assuming you do have the cart object already...)
 
pascal
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...