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
Combining shipping calculation methods?

Knowledge Base Lobby : uShop Support Conference : Tax, Shipping, and Handling Questions
Nov-22-17 05:58 AM EST
Original Message
Combining shipping calculation methods?
Author Steve Doolittle on 05-22-2002 at 00:47 (EST)
I am trying to program shipping rates based on subtotal as follows:

.01=2.50,
10.01=3.75,
20.02=5.25,
30.01=7.75,
50.01=9.75,
100.01=12.75,
200.01=10%

Can I somehow use the percentage instead of flat fee for amounts above $200 without getting into custom programming?

Thanks for your help.
E-MAIL AUTHOR | TABLE OF CONTENTS

Table Of Contents
  RE: Combining shipping calculation methods? Bill Weiner, 2002-05-22 04:56:10 (1)
            Thanks Steve Doolittle, 2002-05-22 13:16:18 (2)
                 RE: Thanks Bill Weiner, 2002-05-23 04:50:51 (3)
                      Thanks Again Steve Doolittle, 2002-05-23 16:58:34 (4)
            Oops Clark, 2002-06-10 14:46:55 (5)
                 Check your email! Matt, 2002-06-10 16:35:06 (6)
                 RE: Oops Bill Weiner, 2002-06-11 05:42:45 (7)

Messages In This Discussion
         1. RE: Combining shipping calculation methods?
        Author Bill Weiner on 05-22-2002 at 04:56 (EST)
Unfortunately, no. But here is the implementaton of the "customer_shipping" subroutine in the ushop.pl script that would do the job:

sub custom_shipping
{
local ($shipping_table) = @_;
local ($ret_value);

# Reset the return value.
$ret_value = 0.0;

# The subtotal (before any discounts).
$totals_subtotal1 = $totals_subtotal1;

# The subtotal (after any discounts).
$totals_subtotal2 = $totals_subtotal2;

if ($totals_subtotal2 > 200)
{
$ret_value = ($totals_subtotal * 0.10);
}
elsif ($totals_subtotal2 > 100)
{
$ret_value = 12.75;
}
elsif ($totals_subtotal2 > 50)
{
$ret_value = 9.75;
}
elsif ($totals_subtotal2 > 30)
{
$ret_value = 7.75;
}
elsif ($totals_subtotal2 > 20)
{
$ret_value = 5.75;
}
elsif ($totals_subtotal2 > 10)
{
$ret_value = 3.75;
}
elsif ($totals_subtotal2 > 0)
{
$ret_value = 2.50;
}
else
{
$ret_value = 0.00;
}

# Add any shipping modifiers from applets.
$ret_value += $totals_shipping_modifier;

return ($ret_value);
}
TABLE OF CONTENTS
                 2. Thanks
                Author Steve Doolittle on 05-22-2002 at 13:16 (EST)
I appreciate your help. One more quick question: I currently have several shipping methods (priority, international, etc.). Can there be several custom methods?

Thanks again.
TABLE OF CONTENTS
                         3. RE: Thanks
                        Author Bill Weiner on 05-23-2002 at 04:50 (EST)
If you want to have different custom shipping methods... then in your "custom_shipping" method, you would want to setup another "if" statement that is dependent on the $shipping_method field/variable. The $shipping_method field/valiable will be set to whatever shipping method that the customer chose. So if your shipping methods are called "Standard", "Priority", and "International", then you would setup an "if" statement like this:

if ($shipping_method eq "Standard")
{
# Do your standard shipping calc here.
}
elsif ($shipping_method eq "Priority")
{
# Do your priority shipping calc here.
}
else
{
# Do your international shipping calc here.
}

TABLE OF CONTENTS
                                 4. Thanks Again
                                Author Steve Doolittle on 05-23-2002 at 16:58 (EST)
Great! I really appreciate your help. Take care.
TABLE OF CONTENTS
                 5. Oops
                Author Clark on 06-10-2002 at 14:46 (EST)
This looked like the perfect solution for me to calculate shipping based on percentage with a built in minimum. So I put the following code in ushop.pl:

sub custom_shipping
{
local ($shipping_table) = @_;
local ($ret_value);

# Reset the return value.
$ret_value = 0.0;

# The subtotal (before any discounts).
$totals_subtotal1 = $totals_subtotal1;

# The subtotal (after any discounts).
$totals_subtotal2 = $totals_subtotal2;

if ($totals_subtotal2 > 45)
{
$ret_value = ($totals_subtotal * 0.10);
}
else
{
$ret_value = 4.50;
}

# Add any shipping modifiers from applets.
$ret_value += $totals_shipping_modifier;

return ($ret_value);
}


It works great for the sub-totals below $45 but for those above, it returns 0 for shipping. See it in action here:
http://www.allpowerseminar.com/shop/purchase.htm

Do you see what I'm doing wrong?

Thanks!
Clark
TABLE OF CONTENTS
                         6. Check your email!
                        Author Matt on 06-10-2002 at 16:35 (EST)
Clark,

I sent a response... check your email... I just did this a few hours ago!

Matt
TABLE OF CONTENTS
                         7. RE: Oops
                        Author Bill Weiner on 06-11-2002 at 05:42 (EST)
Matt probably already resolved this for you, but just to throw in my 2-cents:

It looks like you have a typo in the line:

$ret_value = ($totals_subtotal * 0.10);

That is, the $totals_subtotal variable is missing the 2... as in "$totals_subtotal2":

$ret_value = ($totals_subtotal2 * 0.10);
TABLE OF CONTENTS

© 2003 Microburst Technologies, Inc.