Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Shipping Table


LisaM

Recommended Posts

Hello. I've set up the shipping table for incremental shipping fees up to $150. Anything over $150 is the order total * 13%. Is there an easy way to do this? Thanks much.

 

Say, I was trolling and found this. If someone could just highlight the portion that would be altered, showing where to plug in if >150 then order total *13% I would be thrilled.

 

$table_cost = split("[:,]" , MODULE_SHIPPING_TABLE_COST);

$size = sizeof($table_cost);

for ($i=0, $n=$size; $i<$n; $i+=2) {

if ($order_total <= $table_cost[$i]) {

$prcnt_char = stristr($table_cost[$i+1], ‘%’);

$prcnt = substr($table_cost[$i+1], 0, 1);

if ($prcnt_char == ‘FALSE’) { /* percent calculation only used if '%' found */

$shipping = $table_cost[$i+1];

break;}

else

{$shipping = $order_total * ($prcnt / 100);

break;}

}

}

Thanks in advance...

Link to comment
Share on other sites

  • 8 months later...

Try This, might work! ;) #

###################

 

Greg Whitehead

gregory.j.whitehead@gmail.com

12-20-2007

==================================================

Modification to the original contribution by the author above.

06.21/2008

Richard C. Rosario

richard@adoncreative.com

=============================================

 

This modification will allow you to set percentages in the Table Rate Shipping method.

ie 5.00:3.00,25:10%,500:25999999:3%

 

Note: DO NOT USE "," ON ANY AMOUNT YOU ENTER, OTHER WISE THE PERCENT WILL NOT WORK FOR YOU.

 

 

The location of the edit is

/catalog/includes/modules/shipping/table.php

 

 

 

Around Line 64 After

 

 

$table_cost = split("[:,]" , MODULE_SHIPPING_TABLE_COST);

$size = sizeof($table_cost);

for ($i=0, $n=$size; $i<$n; $i+=2) {

if ($order_total <= $table_cost[$i]) {

$shipping = $table_cost[$i+1];

break;

}

}

 

 

Place

 

//Percentage Mod

if ( strpos($shipping,"%") > 0 && MODULE_SHIPPING_TABLE_MODE == 'price') {

$shipping = $order_total * round(($shipping/100),2);

}

//end Percentage Mod

 

 

 

That is it.

Best Regards,

 

Rayisms

~SEEKER~

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...