I’m working through this tutorial - Corvid Tutorial: Cross-Selling a Product in Your Store with Corvid by Wix which says that it is showing the code if the merchant decided to promote the Jasmine soaponly if customers have one of the other soaps (Vanilla/Honey/Lavender) in their cart, but not Jasmine.
However the code appears to only check is something is not in the cart (in this case Jasmine), it doesn’t check what is in the cart.
To clarify, it doesn’t matter what flavours I select, the pop up will appear promoting the Jasmine soap as long as Jasmine is not in the cart already. It doesn’t look at the cart contents and only show Jasmine soap if the other products are vanilla/honey/lavender.
There is an error in line 42 (should be ’ not " after ShoppingCartcon1).
Disappointingly misleading here. I’m not a Corvid expert and have been working through this again and again thinking I’m going mad. Is there any tutorial or coding around that would help me actually do what this tutorial is meant to? Thank you.
Thanks for pointing out the issue on line 42. In some Javascript frameworks, having mismatching quotes around a string won’t throw an error. In any case, I’ve fixed the inconsistency.
I had another look at the tutorial, and the code works as intended, and as described. In the cart page code, we’re using the wix-stores-backend function getCurrentCart() to look at the cart contents and only show Jasmine soap if the other products are anything other than Jasmine soap (our selected product for promotion).
If you’re still having issues with your code, you can elaborate further and we’ll do our best to help.
I had another careful look at the tutorial, and I think I now understand the confusing part. You are correct. The code checks for ALL other products other than Jasmine, but the description in the introduction incorrectly implied that the code only checked for Vanilla/Honey/Lavender.
Great catch!
I’ve updated the tutorial to be more accurate. Also, I’ve clarified that the code in the tutorial and the code in the example site is different, although they implement the same functionality.
Hi Roy - thanks for the update and the clarification. Is there a way to look at the cart and check for a product as described - in this example check to see if vanilla or lavender is in the cart and if one is (and jasmine is not) then to offer the jasmine as a pop up. I would find this really useful and I know from some of the other wix forums it is is a popular ask - it would mean true cross selling.
Thanks for any advice you can give.