Log In    |    Knowledge Base    |    4D Home
Tech Tip: Setting a Shipping Option for a Specific Type of Item
PRODUCT: 4D Business Kit | VERSION: 2003 | PLATFORM: Mac & Win
Published On: June 10, 2004

If you ever come across an instance where you want to offer a certain type of shipping (for example, media mail) for a certain type or group of products, here is what you can do (pseudo code):

Using a specific field (boolean) in the Items table, check this field for all products falling into this category. Then on your checkout page, or a page on which you are displaying the shipping options, loop through all the items in the basket and if there are any items in the basket that have this boolean field checked, set a particular 4DBK Variable to some value. Next, when the list of shipping items is being built, test to see if the 4DBK Variable has a value. If so, then we do nothing to prevent the display of all of the shipping options. If the 4DBK Variable has not been set, then we know that the item(s) in the shopping cart does not include any from the group and we can remove the shipping option.