Hello
I've got small issue,
I'm preparing my Shopping Card for selling only one product variation in one time.
My product page is only a holder and I don't have there any code like "adding product to" or "remove product from" Shopping Card, just only adding product variations, so I've got there only links like:
product_name/addVariation/ID-product-variation
after clicking link like that, product variation is added to Shopping Card and customer is redirected to checkout . I've added at the end of function addVariation() this code :
Director::redirect('checkout/');
Before doing that, I want to make sure, Shopping Card is empty, so I've tried to add some code at the beginning of this function.
I've checked :
ShoppingCart::clear();
Product_OrderItem::removeallLink();
ShoppingCart::remove_all_items();
ShoppingCart::remove_all_modifiers();
But without any positive results. If I go back on other product variations, and I put it on Shopping Card, at checkout page I've got another position, not just the last one.
Could somebody help me and tell me, which function I need to use in this case, to make sure, I have just one product Variation on the checkout page? I don't understand some of this code from ecommerce module, so any reply will be very helpfull for me.