Support » Plugin: WooCommerce » Custom Payment Restrictions

  • Hello everybody

    I’m working with latest WooCommerce and i’m looking for a way to restrict some of payment methods while still displaying them in Checkout page (I want to “grey out” them).

    What i have in mind is …

    When customer is adding item to a cart and then procceds to checkout i want him to be able to view all possible payment methods but based on his status i want some of them to be “grey out” with additional information why is this grey out.

    I would want to grey out Cash on Delivery for new customers because of big return rate. I want them to still see that i allow this kind of a payment but only for returning customers and/or registered ones (shop allows buying without account)

    How can I achieve that? It will certanly require messing up with functions.php. Important part is that i want customer to see all method payments but grey out few of them until they will make their first purchase thru paypal or other gateway or register.

    Thank You for Your help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • belindablakley


    I have a very similar issue, so I don’t know if I should start a new thread or not…
    I would like to restrict certain payment options per specified users. All of my customers are registered (we don’t allow guest checkout), but some of them are on payment terms, so we want to allow the “cheque” payment for some customers. I don’t need it greyed out or anything, just visible or not depending on if it’s allowed for that customer.


    Okay, because my php knowledge is pretty much non-existant i’ve come up with few solutions and maybe someone will manage to put me on right track here with code.

    I’ve browsed thru all php files located in woocommerce folder and played around with COD option for test. I’ve manage to accomplish only one thing, now when user check “Cash on Delivery” his order is autotmaticly cancelled in system and he also recives email with that information.

    I’ve changed (In COD class)

    $order->update_status(‘on-hold’, __( ‘Your order wont be shipped until the funds have cleared in our account.’, ‘woocommerce’ ));


    $order->update_status(‘cancelled’, __( ‘Your order wont be shipped until the funds have cleared in our account.’, ‘woocommerce’ ));

    But i still get redirect to ThankYouPage and order is still recived. For the worst part – beside displaying information about this delivery method being availabe only for returning customers i still need to proccess orders and New Customer can still choose “Cash on Deliver” as reliable option for his purchase. Information about canecelation is getting to him only after.

    I’m still looking for any possible way to “blank out/grey out” this option in checkout page (without hidding it). Should I look in function process_payment? Deleting all that function get’s big error in woocommerce and everything is stopping to work.

    I’m pretty much confused right know and this seems like not so much of a complicated problem but with my knowledge of php it takes a big amount of time and i’m struggling with non-obiedient customers 🙂

    Please, some input?



    So, it’s probably not exactly what you’re looking for, but you can get this woocommerce extension and define payment methods by role. You could use it in conjunction with this free plugin to make a group for customers who have previously made a purchase and customers who have just registered.

    You might be able to then use css to create your greyed-out options.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Custom Payment Restrictions’ is closed to new replies.