uShop English (U.S.) for 179!

uStorekeeper English (U.S.) for 149!

 Products
       uTest
       uReserve
       uShop
       uStorekeeper
       uGolf
       uDirectory
       uSignIn
 Tech Support
       Support Policy
       Knowledge Base
            uTest
            uReserve
            uShop
            uStorekeeper
            uGolf
            uDirectory
            uSignIn
       Documentation
       Reference Sites
 Legal
       Software Piracy
       Legal Notices
       Privacy Policy
       Licensing
 Miscellaneous
       Reseller Info
       Contact Us
       Site Map
Free shipping question

Knowledge Base Lobby : uShop Support Conference : General Questions
Oct-22-17 12:43 AM EST
Original Message
Free shipping question
Author russomr on 02-20-2003 at 17:27 (EST)
I need to set up my ushop application to have free shipping if the state entered by the customer is AE (it is a military code). How can I place this condition? Any help is greatly appreciated. Thanks.
E-MAIL AUTHOR | TABLE OF CONTENTS

Table Of Contents
  Configuring free shipping based on state Microburst Support Team, 2003-02-25 20:30:14 (1)
            RE: Configuring free shipping based on state Bill Weiner, 2003-02-26 07:54:03 (2)
            Not working russomr, 2003-03-14 00:39:58 (3)
                 Not working Microburst Support Team, 2003-03-14 05:58:31 (4)
                 RE: Not working Bill Weiner, 2003-03-14 06:47:35 (5)

Messages In This Discussion
         1. Configuring free shipping based on state
        Author Microburst Support Team on 02-25-2003 at 20:30 (EST)
You can set up a shipping method calculation type to "Custom" and then modify the custom_shipping subroutine.
In your custom_shipping subroutine (found in the ushop.pl script), you could add some code as shown in this example to check the billing_state and then set the shipping cost to 0.0 if the billing state is AE (see the snippet of code added near the end of this subroutine):



#---------------------------------------------------------------------------
# Subroutine to perform a custom shipping calculation.
#---------------------------------------------------------------------------
sub custom_shipping
{
local ($shipping_table) = @_;
local ($ret_value);

# Reset the return value.
$ret_value = 0.0;

#---------------------------------------------------------
# Variables that may be useful in your custom calculation.
#---------------------------------------------------------

# The name of the currently selected shipping method.
$shipping_method = $shipping_method;

# The table/value of the currently selected shipping method.
$shipping_table = $shipping_table;

# The current billing state.
$billing_state = $billing_state;

# The current billing country.
$billing_country = $billing_country;

# The current billing zip code.
$billing_zip_code = $billing_zip_code;

# The current shipping state (if any).
$shipping_state = $shipping_state;

# The current shipping zip code (if any).
$shipping_zip_code = $shipping_zip_code;

# The current shipping country (if any).
$shipping_country = $shipping_country;

# The subtotal of the items in the shopping cart (before any discounts).
$totals_subtotal1 = $totals_subtotal1;

# The subtotal of the items in the shopping cart (after any discounts).
$totals_subtotal2 = $totals_subtotal2;

# The total weight of the items in the shopping cart.
$totals_total_weight = $totals_total_weight;

# The total quantity of items in the shopping cart.
$totals_total_quantity = $totals_total_quantity;

# The total of all/any shipping modifiers that were associated with each
# product in the cart. Typically, this $totals_shipping_modifier should
# just be ADDED to the total shipping charge, such as:
# $ret_value += $totals_shipping_modifier
$totals_shipping_modifier = $totals_shipping_modifier;

# NOTE: The $ret_value should be the desired shipping charge.

# check if shipping state is AE and set shipping cost to 0 if so
if ($shipping_state eq "AE")
{
$ret_value = 0.0;
}
else
{
$ret_value = 5.0; # whatever shipping value you want here
}

return ($ret_value);
}
# End of custom_shipping()




TABLE OF CONTENTS
                 2. RE: Configuring free shipping based on state
                Author Bill Weiner on 02-26-2003 at 07:54 (EST)
Another option to might be to just add a different Shipping Method that can be selected by Military Customers. Ie.

Standard Shipping
Overnight Shipping
AE Shipping

Of course this relies on the customer to choose the desired shipping.

The "custom_shipping" method described above will automate it for you.
TABLE OF CONTENTS
                 3. Not working
                Author russomr on 03-14-2003 at 00:39 (EST)
I placed the sample code in the UShop.pl file and it is not working. It is still charging for S&H. I really don't want the user to have to select the AE Shipping choice (option #2 you suggested). Any ideas on what I might be doing wrong when substituting this code in the file?
TABLE OF CONTENTS
                         4. Not working
                        Author Microburst Support Team on 03-14-2003 at 05:58 (EST)
Go ahead and fill out an official support request from this link
http://www.uburst.com/supportform.html
using your license, and give us the URL to your control panel and the password to log in.

If we can't spot the problem that way, we'll need you to e-mail us either your FTP information or your ushop.pl script.
TABLE OF CONTENTS
                         5. RE: Not working
                        Author Bill Weiner on 03-14-2003 at 06:47 (EST)
Also, after making the modifications, did you remember to specify the "CUSTOM" shipping type when setting up the shipping options in the uShop Control Panel?
TABLE OF CONTENTS

© 2003 Microburst Technologies, Inc.