How to Charge No Shipping for an Item Using the Linear Shipping Component

ID: Q229784


The information in this article applies to:


SUMMARY

Commerce administrators may want to charge no shipping costs for a specific item or items, such as a product catalog.

When using the Linear Shipping component, which charges shipping per-item and per the method of shipping chosen, you can exclude shipping charges for a single item or items with the following script (inserted as a scriptor after the linear shipping components).

This scriptor compares the SKU of the items in the order form, and if the SKU is for an item that shipping should not be charged for, total shipping charges are adjusted to account for this.



function MSCSExecute(config, orderform, context, flags)
y=0
z=0
adjust = 0

for each x in orderform.items
select case x.sku
     case 001       'this is one sku for which no shipping is charged
     y = y+1
     case 005       'this is another sku for which no shipping is charged
     y = y+1
end select
next 

select case orderform.shipping_method
     case "standard_shipping"
     z=50
     case "2nd_day_air"
     z=300
     case "first_class"
     z=200
     case "pal_apo"
     z=150
     case "canadian"
     z=300
     case "foreign"
     z=900
end select

adjust = y * z
orderform.[_shipping_total] = orderform.[_shipping_total] - adjust

    MSCSExecute = 1
end function
 

Additional query words:


Keywords          : 
Version           : winnt:3.0
Platform          : winnt 
Issue type        : 

Last Reviewed: May 17, 1999