Issue buying multiple products with the same SKU

Hi

Got what is potentially a very rare case here

We have a gift card product set up as a customisable product. This has several customisable options that relate to value - £10, £25, £100 etc.

Our issue is that, if someone adds a £10 gift card and a £25 gift card, the microcart will basically show 2 of the £25 cards have been added.

From what I can tell, this is because the products all have the same SKU, and so the CART_ADD_ITEM mutation in cart/store/mutations.js is checking on the sku and updating the quantity, rather then adding the product, which logically is what you would expect.

Is there anything pre-built to handle this sort of scenario? We can differentiate the giftcards by their option_id but was hopeful someone else had come across this and had a solution, whether its somethif that would be better handled on the data layer or through storefront

Thanks all

1 Like

Unfortunately we haven’t supported this case yet (custom options, same SKU); we recently added a supoprt for this case for bundle products and I belive it’s something that could be extrapolated to custom options: https://github.com/DivanteLtd/vue-storefront/pull/3261

I tried to implement custom options but there are many changes. Biggest problem the cart only runs by sku identifier. I stopped fixing it. if you have the chance to use sku for custom options. you can give it a try. I had like 100 custom option per product. So i quit.

Hey @pkarw

Thanks for the response.

I like the concept of what is happening in the bundle options fix you sent, and think the idea of comparing the two products is 100% the right route to go down.

After seeing how well andrzejewsky has implemented it, it seems a good basis to look into for our use case - the problem he has solved is essentially the same, just with a different product type.

If I get any time I will try to see if I can have a go at it, but don’t hold your breath.

Thanks again!

Hey @Niels_Gongoll, @smdly
what did you end up doing? Did you find an alternative for the simple products with custom options?

I am having the very same issue. I am using 1.11.

besides taking a look on the bundle fix, do you recommend anything else for this case?

Thank you for your help, I am really stuck here :slight_smile:

Hey there @ktopouzi

Sorry, very late and probably pointless reply, I haven’t had any time to look into this yet, though it’s a requirement for a project I am just starting so will be having to solve it one way or another soon ha!!

No worries @smdly,

In the meantime I found out this is already issued and actually recently someone made a PR with a solution. Since the store I am working on currently depends on custom options this is necessary for me too :slight_smile: I believe we are close on finding the solution. Hope this is helpful :smile: Good luck on your store!