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

Removing Cheque Payment Method *solved

Go to End

2 Posts   2131 Views


Community Member, 1 Post

24 March 2009 at 3:21pm

Edited: 24/03/2009 4:03pm

Hi, i have been working on an install of the e-commerce module, i dont require any payment options so is it possible to remove the cheque option that the module defaults to if no other methods are specified?

i have tried adding a blank array to the config file and this hides the cheque option from the checkout page but throws an error when completing an order (Fatal error: Class name must be a valid object or a string in .\sapphire\core\Object.php on line 99)

i pretty much just want the module to operate as it would with the cheque option, but not actually show it to the end user.

in the mean time i have simply hidden the payment method option with css

currently looking for a way to hide the method - cheque row in the order successful template

any ideas would be appreciated.


Updated the following line in Payment.php:
protected static $supported_methods = array('ChequePayment' => 'Cheque');
protected static $supported_methods = array('ChequePayment' => 'Account'); //Changes payment method to Account in Checkout and Emails

Added the following style to CheckoutPage.css:
#RightOrder { display: none; } //Hides Payment Method Div


Community Member, 127 Posts

15 April 2009 at 1:49am

Edited: 15/04/2009 1:51am

@sypher, you might want to prefer to set that value in mysite/_config.php instead of patching ecommerce/Payment.php

You can achieve the same effect as with your patch

protected static $supported_methods = array('ChequePayment' => 'Account'); 

simply by adding this to your mysite/_config.php :

Payment::set_supported_methods(array('ChequePayment' => 'Account'));

That way you can safely update ecommerce without having to re-apply your patch.