Jump to content

Adding products to the shopping cart based on product size


beginner1

Recommended Posts

I was searching through the prestashop classes and came across the cart class. There is a updateQty function that can be used to add the products to the shopping cart. In order to save the data to the shopping cart you need to provide the product id, quantity and some other things but there is no mention of product size meaning the product cannot be added with respect to the size. The product can be of small, medium or large size (example). Is there any function in cart class that allows us to do this? I went through the class and didn't find anything. Some guidance would be appreciated.

Link to comment
Share on other sites

If I understand well it should be a combination (size, color) in your product? if yes, PrestaShop already support you to add id_product_attribute when adding the product to cart.

 

In case if it is not a combination, you can use product's customization to do it.

  • Like 1
Link to comment
Share on other sites

17 hours ago, Vince said:

If I understand well it should be a combination (size, color) in your product? if yes, PrestaShop already support you to add id_product_attribute when adding the product to cart.

 

In case if it is not a combination, you can use product's customization to do it.

Yes it was id_product_attribute that did the trick. Thanks :D

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