1and1 Help Centre Categories

print article

How to add additional amout for shipping fee for special items

First create an attribute for all the items in question. You can call
it "item_shipping" and assign the shipping cost as it value, for eg:, 5.00
Follow FAQ How to create attributes for item rulesNow enter the following code under 'Settings' -> 'Advanced Settings' -> 'Payment methods' -> 'Settings for all payment methods'Here you should see 'Rule for all payment methods':


foreach ($basket_items as $i) {
//shipping for each item calculated here.
$overall_shipping += item_get_field('item_shipping', $i) * item_get_field('count', $i);
}
$shipping_fee= $shipping_fee + $overall_shipping;
Note: Using this rule, if a shopper orders a special item, an additional
amount will be added to the normal shipping fee. If a shopper orders 2 numbers of
that special item, then the special fee will also be calculated twice.

You can make use of the above rule, if you have different shipping costs for
different items all through your eShop. You will have to create an attribute for
all the items and assign the shipping fee of that item as a value to the attribute
and then use the following rule:

(For example: you have 3 items.
item 1 - shipping fee 4.00
item 2 - shipping fee 3.00
item 3 - shipping fee 4.00
The create an attribute for each item and assign the shipping fee as the value.


foreach ($basket_items as $i) {
//shipping for each item calculated here.
$overall_shipping += item_get_field('item_shipping', $i) * item_get_field('count', $i);
}
$shipping_fee = $overall_shipping;