Jump to content
sinopia

Help with ot_shipping due the free shipping

Recommended Posts

I've set the default cost manually, in case anyone needs I used this way in ot_shipping.php:

        // The line telling the savings on the shipping when it's free
        if ($order->delivery['country_id'] == STORE_COUNTRY) {
        	$total_saving = '<span style="color: red; text-decoration: line-through;">4€</span>';
    	} else {
    		$total_saving = '<span style="color: red; text-decoration: line-through;">8€</span>';
    	}

		if (($order->info['total'] - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) { // if free shipping
	        $this->output[] = array('title' => $order->info['shipping_method'] . ':',
	                                'text' => $total_saving . ' ' . $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),
	                                'value' => $order->info['shipping_cost']);
	    } else {
	        $this->output[] = array('title' => $order->info['shipping_method'] . ':',
	                                'text' => $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']),
	                                'value' => $order->info['shipping_cost']);
	    }

 

Share this post


Link to post
Share on other sites
11 hours ago, sinopia said:

@clustersolutions Hi. That code for the savings looks very nice. You could possibility public it? 

@sinopia, I believe there were quite a few places that required core code mods, may be schema as well. I hv been waiting for a stable/finalized OSC frame work b4 further  dev...I would by then. Hope u known what I mean. 

Share this post


Link to post
Share on other sites
On 12/20/2017 at 5:07 PM, raiwa said:

instead of the free shipping option in ot_shipping, just use for example the flat shipping module. Rename the title and description to free shipping and modify the code to show it only if order total is more than 29.90.

within the class constructor


        if ($order->info['total']) > 29.90) {
          $check_flag = true;
        }
        
        if ($check_flag == false) {
          $this->enabled = false;
        }

rgds

Rainer

Tried inserting your code as suggested but getting Parse error: syntax error, unexpected '>' in /includes/modules/shipping/flat.php referring to if ($order->info['total']) > 29.90) {

Any help?

Share this post


Link to post
Share on other sites

Try adding another bracket "(" before the first one following the initial if....you have 1 opening bracket but 2 closing ones.

Dan

Share this post


Link to post
Share on other sites

Hoping for some advice to edit the code in the above post (which should read) -

if ($order->info['total'] > 29.90) {
          $check_flag = true;
        }
        
        if ($check_flag == false) {
          $this->enabled = false;
        }

for example - so the shipping module only shows when order total is more than 29.90 AND more than total shipping weight of 100 - if that is possible.

Many thanks.

Share this post


Link to post
Share on other sites
1 hour ago, Heatherbell said:

if ($order->info['total'] > 29.90) {

if ( ($order->info['total'] > 29.90) && ($shipping_weight > 100) ) {

You *might* need to globalise $shipping_weight ... see how it's done in (eg) zones.php


This is a signature that appears on all my posts.  
IF YOU MAKE A POST REQUESTING HELP...please state the exact version
of osCommerce that you are using. THANKS

 
Get the latest Responsive osCommerce CE (community edition) here

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×