Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Need help with free shipping modification!


fubu

Recommended Posts

I'm poor with PHP and have been trying to modify free shipping to purchases above 50 dollars but at the same time I only want to give free shipping to orders under 10kg.

 

I think this is the file that needs to be modified (htdocscatalogincludesmodulesorder_totalot_shipping.php)

 

around line 44:

if ( ($pass == true) && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {

$order->info['shipping_method'] = $this->title;

$order->info['total'] -= $order->info['shipping_cost'];

$order->info['shipping_cost'] = 0;

 

I've added a condition to the if statement to the following:

if ( ($pass == true) && ($total_weight<'10') && ( ($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {

$order->info['shipping_method'] = $this->title;

$order->info['total'] -= $order->info['shipping_cost'];

$order->info['shipping_cost'] = 0;

 

and I've declared $total_weight = $cart->show_weight(); above it.

 

 

I think it's just a matter of checking the weight of the cart in this bit, but my php is pretty poor, so please help!!!!

Link to comment
Share on other sites

in ot_shipping.php find the following

 

    function process() {

     global $order, $currencies;

 

and change to

 

    function process() {

     global $order, $currencies, $shipping_weight;

 

then in your code change from

 

$total_weight = $cart->show_weight();

 

to.....

 

$total_weight = $shipping_weight;

 

Back up before you try

Reddy to Rumble

 

Thank you osCommerce and all who Contribute to her!

Link to comment
Share on other sites

Hi,

 

I've just tried your suggestions above. I'm not getting any errors, so I'm probably getting closer. However it's still giving out free shipping for orders over 10kg.

 

Any further suggestions?

 

:cry:

Link to comment
Share on other sites

  • 2 weeks later...

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