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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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


1439 Views

Avatar
funkncreative

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