1and1 Help Centre Categories

print article

How to disable certain payment methods or shipping methods

Problem: You want to disable a certain payment method if a certain shipping method
is chosen, or vice versa.

DISABLE SHIPPING METHODEnter the following rule under: 'Settings' -> 'Advanced Settings' -> 'Payment methods' -> 'Rules for the order pages'Here you should see 'Rule for the first order page($RULE_ORDERPAGE_1)':


if (get_payment_method()=='Invoice') {
DisableDeliveryMethod("UPS");
}
Thus if the payment method is Invoice, the delivery method UPS will
not be available.


if (total_sum_ < 20) {
DisableDeliveryMethod("FedEx");
}
If the total order is less than £20.00, then FedEx shipping method is disabled.

DISABLE PAYMENT METHOD


if (get_delivery_method()=='Fedex') {
DisablePaymentMethod("Invoice");
DisablePaymentMethod("PayPal payment");
}

Please note:
To get the payment method names, click 'Settings' -> 'Payment'. Choose
offline or online and click 'next'. The payment methods are displayed here. For
online payment names, you will have to click 'edit' once in the method and under Name of the payment method in the selection list you will find the payment
name.

To get the shipping method names, click 'Settings' -> 'Shipping'. Here you
can see the names.

DISABLE PAYMENT/SHIPPING METHOD BASED ON COUNTRY OF DELIVERYFor instance, to disable the shipping or delivery method for a particular country,
use the following rule. (Note: Under 'Settings' -> 'Advanced Settings' -> 'Basic
Setting' -> 'Other shop settings'
you will find Swap the first and second
pages of the order process?
Choose Yes.)


if (get_orderinfo_shipping_field("country"))
$country= get_orderinfo_shipping_field("country");
else
$country= get_orderinfo_field("country");

if ($country != "CA") {

DisablePaymentMethod("Invoice");
}

Please note:
You can find the country codes at: 'Settings' -> 'Advanced Settings' -> 'Text modules 1' -> 'Texts for the country, state, and province lists'
Here you can see 'List of countries for country selection'