Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

E-Commerce Modules /

Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.

Moderators: martimiz, Nicolaas, Sean, Ed, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba

Help with shopping cart and AllowPurchase

Go to End



Community Member, 4 Posts

28 July 2009 at 8:31am

Could someone please help me with this...

First off, Im looking for a way to only allow one product at a time in the cart. The best way I can think of is clearing the cart just before adding a product, but I cannot figure out how to do it? I have tried in the 'Items Management' section of ShoppingCart.php, but could'n't get it to work.

Second, I want to set AllowPurchase on the product that is added to the cart to false, and then back to true if the order is cancelled.

I have been digging around the files and trying some stuff, but cant manage to get either happening.

please help