Add same

Hello to all,
I hope you will be able to help me.
I am currently creating an e-commerce website for a catering client.
My product pages are created and the links to the shopping cart as well.
Only I have a huge problem that I can’t solve despite multiple attempts.
Let me explain it to you:
When I add a product that we call Ham#1, let’s imagine that I add 5 quantities. In my cart, I have 5 quantities of Ham#1, only if I want to add another ham#1 via its product page and not via the cart, that I click on the “add to cart” button, I end up with 2 boxes of Ham#1 in my cart. The first one has 5 quantities and the second one has 1 quantity (the one I added).So my question is how do I make sure that when I add a product already in my cart, the new quantity is automatically added in the previous quantities and not in a new box?

PS: I’m French, don’t hesitate to answer in French.

just thought of a solution on the spot, but i think it can work. Create a new data type, ill call it Product Group. Create a field, and make sure that the type is set to Product or whatever your product data type is called. create another field, and make it a number. this will be the quantity. Anyways, when you want a product to be added to a cart, create a workflow and make sure that the “Only When” field is set to: Do a search for product groups, and the constraints being: created by: current user, and product= current cells or product or current page’s product or whatever you’re using. then ‘‘Count is 0’’

then add the action: create a new thing. type is product group. quantity= 1. product= current cells product or whatever you’re using

then duplicate the worflow, and in the new one, change the Only When condition to “Count is 1”
then instead of a create a new thing field, delete that and do a make changes: to product group. then to specify which one, put a Do a Search For: product groups: created by=current user, and product-current cell’s product. then put: First item. now make changes to the quantity field to: this product group’s quantity + 1.

you can easily calculate the price in the end by multiplying a product group’s quantity by it’s product. And so on

hope this helps :slight_smile:

1 Like

This topic was automatically closed after 70 days. New replies are no longer allowed.