Custom Shipping Logic now setup in Store Manager! ------------------------------------------------- April 30, 2000 [NOTE: The sample order forms have SBW (Ship By Weight) options in them, but tbe sure to take a look at the Offline Order Form even if you do not use it. It tends to have the most recent and relevant examples.] For UPS shipping, see the UPS documentation. For custom shipping logic, the sky is the limit! Whatever code you want to install, it is up to you, you may interface with anything or calculate anything. A sample of custom shipping code that makes the shipping price 12% of the order (assuming no handling charge is included) is: # #This simulates the old logic of a percentage (12%) of the order: $shipping_price = int($subtotal*12 + 0.5) / 100; # For a handling charge, you may add it above or use the handling charge in the Program Settings, but don't set both! For complicated code, setup a custom library and simply call the correct subroutine in the custom code. In version 3.0u and higher you can force the shipping module to exit after your code is finished by setting: $shipping_logic_done = "yes"; If this variable is set, then the handling charge and UPS code will NOT be run, even if these variables were set in the Program Settings. Unless you have a specific reason to do this, don't! One reason to set this varialbe would be if you wrote code that shipped via UPS but added a handling charge per box instead of per order and therefore have no need to run the standard UPS code. The main advantage of using the custom code interface instead of modifying the library is that it is easier to upgrade to the latest version of agora.cgi. # Custom Shipping Logic Example # Ship based on the total order. # $1-$29.99 is 3.95, $30-59.99 is 4.95, etc.: @sc_shipping_logic = ("|1-29.99|||3.95", "|30-59.99|||4.95", "|60-89.99|||6.95", "|90-119.99|||10.95", "|120-|||0.00"); $shipping_price = &calculate_shipping($temp_total, $total_quantity, $total_measured_quantity); $shipping_logic_done = "yes"; # forces exit, no handling charge added ====================================================================== Another custom example is shown below. Instead of using fixed amounts based on the order subtotal, percentages based on that amount are applied: # In this example Shipping Cost is based on the total order. # $1-$29.99 is 10%, $30-$59.99 is 7.5%, etc. (TURN OFF UPS!) # Code does not force exit, so handling charge will be added! @sc_shipping_logic = ( "|1-29.99|||10.0%", "|30-59.99|||7.5%", "|60-89.99|||5.0%", "|90-119.99|||2.5%", "|120-|||0.00"); # $shipping_price = &calculate_shipping($temp_total, $total_quantity, $total_measured_quantity); ======================================================================