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

How do I set AllowPurchase once a product is added to cart?


Go to End


1268 Views

Avatar
funkncreative

Community Member, 4 Posts

16 July 2009 at 7:41am

I want to change AllowPurchase of a product to false once a user adds it to the cart, and set it back to true if they cancel the purchase or remove it from the cart.

What is the best way to do this? And where should I put the code?

thanks