Jump to:

2076 Posts in 857 Topics by 449 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, Sean, frankmullenger, biapar, Willr, Ingo, Jedateach, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1435 Views
  • sypher
    Avatar
    Community Member
    1 Post

    Removing Cheque Payment Method *solved Link to this post

    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 Emails

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

  • Kalileo
    Avatar
    Community Member
    127 Posts

    Re: Removing Cheque Payment Method *solved Link to this post

    @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.

    1435 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.