[ic] How to give each cart item its own flat rate shipping cost? AutoModifier, mv_sku/code problems

John1 list_subscriber at yahoo.co.uk
Sat Oct 22 20:12:21 EDT 2005

I am trying to give each item its own flat rate shipping cost by
putting the shipping cost in a field in the products table.

However, I am having problems getting it to work for both items with
matrix options and items without matrix options.

Specifically, the problem centres around the fact that for standard
items without any matrix options, $item->{code} is the correct key to
the row in the "products" table from where I wish to look up the
delivery cost. $item->{mv_sku} does not exist.

However, for matrix options it is $item->{mv_sku} that contains the sku
of the parent product code and hence the key to the row in the products
table from where I wish to look up the delivery cost.

Here is what I have:

AutoModifier shipping_cost

STD Standard shipping_cost 1 9999 f @@TOTAL@@

(i.e. by setting the criteria to the shipping cost field, I can use
@@TOTAL@@ to give me the total shipping cost - at least I could if it
weren't for the problems I am having...)

MV_SHIP_MODIFIERS shipping_cost

In the "products" table, the field "shipping_cost" contains the shipping
cost for that item.

However, this only works for standard products (i.e. products without
matrix options).

I believe if I change AutoModifier to:
AutoModifier products:shipping_cost:mv_sku

it would then work for matrix option products but not standard products.

How do I set it up so that the delivery cost is always looked up from
the field shipping_cost in the products table, regardless of whether
the cart item is a product with matrix options or a standard product.

I have read the the archives, searched the web, and tried to read the
code in order.pm and ship.pm to work this one out, but to no avail  
Any help would be greatly appreciated.

More information about the interchange-users mailing list