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

Silvershop - Free / Zero-Price Products & Orders


Go to End


4 Posts   1892 Views

Avatar
brian_c

Community Member, 4 Posts

21 February 2017 at 3:04pm

Is it possible to have free products and/or free orders?

Our shop has purely digital products (no shipping costs to worry about), and would like to occasionally offer free promotions, either on select products or using coupons via the Discounts module (which we have set up and is working fine).

Problem 1: Products (or rather, our digital products which are actually a Buyable implementation) with zero price do not get added to the shopping cart. No errors are produced, it simply doesn't get added. Is this a core limitation of Silvershop, that things without a price are not considered valid cart items?

Problem 2: Orders with zero price cannot be completed, payment fails with "This order cannot be paid for". Which makes sense of course since there is nothing to pay for. But is there a way for "free orders" to then bypass payment entirely?

Thanks in advance for any and all help!

Avatar
Rolen

Community Member, 1 Post

19 July 2017 at 12:32pm

Hello Brian

Were you able to figure this one out? I am currently having the same problem

Thanks

Avatar
brian_c

Community Member, 4 Posts

19 July 2017 at 11:12pm

Hi Rolen

Yes I did get it working. I am overseas right now and do not have access to my computer, will reply in detail on Thursday when I'm back home.

Cheers

Avatar
brian_c

Community Member, 4 Posts

23 July 2017 at 4:24am

The solution involves a fair bit of code and setup (too much to stuff into a forum post) so I've created a GitHub repo (with full instructions) for it here: https://github.com/bcairns/omnipay-freegateway

Implementation summary:

1) A "FreeGateway" Omnipay payment gateway that allows orders with no payment
2) A custom PaymentCheckoutComponent that modifies (and validates) the payment options form during checkout
3) Associated settings in config.yml and payment.yml to enable the above

Hope this helps, please let me know if you have any trouble or questions.