1998 Posts in 530 Topics by 433 members
E-Commerce Modules
SilverStripe Forums » E-Commerce Modules » Removing Cheque Payment Method *solved
Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.
Moderators: martimiz, Nicolaas, Howard, Sean, Ryan M., biapar, Willr, Ingo, Jedateach, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 1286 Views |
-
Removing Cheque Payment Method *solved

24 March 2009 at 3:21pm Last edited: 24 March 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.
**Solved
Updated the following line in Payment.php:
protected static $supported_methods = array('ChequePayment' => 'Cheque');
to
protected static $supported_methods = array('ChequePayment' => 'Account'); //Changes payment method to Account in Checkout and EmailsAdded the following style to CheckoutPage.css:
#RightOrder { display: none; } //Hides Payment Method Div -
Re: Removing Cheque Payment Method *solved

15 April 2009 at 1:49am Last edited: 15 April 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.
| 1286 Views | ||
|
Page:
1
|
Go to Top |


