0👍
I assume you want the quantity to increase instead of adding a new item. Wherever the logic is that adds a new item, first loop through the cart and check if the matching item already exists. If it does, increment the quantity by one. If not, add a new item.
Can’t help much more than that without details.
Source:stackexchange.com