osCommerce 4 osCommerce 4 App Shop Support Services App Shop Us
• Checkout
• Get in touch

osCommerce

The e-commerce.

# Shipping Table

## 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.

##### Share on other sites

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;}

}

}

##### Share on other sites

• 8 months later...

Try This, might work! ;) #

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

12-20-2007

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

Modification to the original contribution by the author above.

06.21/2008

Richard C. Rosario

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

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~

## Join the conversation

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

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

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.