1and1 Help Centre Categories

print article

How to disable Payment methods for certain items

If, for instance, you don't want to offer Invoice as a payment method for certain
items, then give the items in question an additional attribute. Edit the items and
create a new attribute, called no_invoice, and give this attribute a value of 1.
Follow FAQ How to create attributes for item rulesEnter the following rule under: 'Settings' -> 'Advanced Settings' ->
'Payment methods' -> 'Rules for the order pages'
You will see 'Rule for the first order page($RULE_ORDERPAGE_1)'


for ($i=0; $i < $number_of_products; $i++) {
if (item_get_field('no_invoice',$basket_items[$i]) == 1) {
DisablePaymentMethod("Invoice");
break;
}
}
In this example, payment by Invoice will not be permitted in the normal payment
methods if the item with attribute no_invoice is selected.

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.