www.uburst.com www.uburst.com

"Combining shipping calculation methods?"

Go back to the LobbyClick here to Go Back to Main ListingClick here to see helpClick here to Search the Forum

Tax, Shipping, and Handling Questions
Forum Type: Public
Moderator: edmunds
Time Zone: EST
Printer Friendly Format
Original Message
 
"Combining shipping calculation methods?"
Posted by Steve Doolittle on May-22-02 at 00:47 AM (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.

Click to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents

 Table of Contents

RE: Combining shipping calculation ..., Bill Weiner, May-22-02, (1)
Thanks, Steve Doolittle, May-22-02, (2)
RE: Thanks, Bill Weiner, May-23-02, (3)
Thanks Again, Steve Doolittle, May-23-02, (4)
Oops, Clark, Jun-10-02, (5)
Check your email!, Matt, Jun-10-02, (6)
RE: Oops, Bill Weiner, Jun-11-02, (7)

 

 
Click here to goto Click here to goto the Lobby
Messages in this discussion
 
1 . "RE: Combining shipping calculation methods?"
Posted by Bill Weiner on May-22-02 at 04:56 AM (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);
}

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
2 . "Thanks"
Posted by Steve Doolittle on May-22-02 at 01:16 PM (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.

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
3 . "RE: Thanks"
Posted by Bill Weiner on May-23-02 at 04:50 AM (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.
}

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
4 . "Thanks Again"
Posted by Steve Doolittle on May-23-02 at 04:58 PM (EST)
Great! I really appreciate your help. Take care.
Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
5 . "Oops"
Posted by Clark on Jun-10-02 at 02:46 PM (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

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
6 . "Check your email!"
Posted by Matt on Jun-10-02 at 04:35 PM (EST)
Clark,

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

Matt

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick to EMail Click here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents
 
7 . "RE: Oops"
Posted by Bill Weiner on Jun-11-02 at 05:42 AM (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);

Remove this Message: Administrator and Moderator onlyClick to Send Alert Message to the Administrator Click to edit this messageClick here to reply to this messageClick here to reply to this message with quotesClick to goto the Table of Contents


Archive This Thread: Admin and Moderator OnlyRemove This Thread: Admin and Moderator Only
Click here to goto Click here to goto the Lobby

 

 

 

 

 

 

 

 

 

 

 

 
Questions or problems regarding this bulletin board should be directed to Webmaster
©1997-1999 by DCScripts. All rights reserved.