Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Help with ot_shipping due the free shipping


sinopia

Recommended Posts

Hello, I've ot_shipping.php activated orders over 29,90€ have free shipping (that works fine) but recently I've added flat.php as a new shipping method but that one should stay even if the shipping is free.

 

I'm using zones.php that with ot_shipping works fine, but as I'd to add flat (always the same price) when a order is over 29,90€ it disables zones and flat and show that the shipping is free.

Anyone know how to fix this?

Link to comment
Share on other sites

Well if this get a bit confusing the real question is:

Anyone knows a way to ot_shipping.php display that the shipping is free but show flat.php always as a option? 

For example:

($order->info['total'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) {

// output flat.php as a option...

}

Link to comment
Share on other sites

@sinopia, ot_shipping.php is to show order total, so you can have zone.php and flat.php installed but at the end ot_shipping.php will only show the one that the user had selected. making sense? so whatever it is that you want isn't gonna work the way that you want it to work. clear!?

Link to comment
Share on other sites

@sinopia,

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

Link to comment
Share on other sites

8 hours ago, sinopia said:

@clustersolutions thank you for your answer, actually I did a little hack that worked.

@sinopia, welcome and that's great! I had always wondered if the free shipping setup should be in ot_shipping.php as it really should be in the shipping modules. I moved mine into the shipping modules and allowed the ot_shipping.php to display the savings, like this...

5a3b04085a78c_ScreenShot2017-12-20at12_21_10AM.thumb.png.45d36a4352f032253f24dccbb804022a.png

Link to comment
Share on other sites

@clustersolutions Wow, sales tax in CA is 9%!!!!!!!!!!! 

While OSC has always shown Florida sales tax tat 7%, that is wrong.  It's 6% state sales tax with counties having additional tax.  In Orange county, it's .5% for a total of 6.5%. 

I do like the way you show that.  I notice on Amzn and some other large ones they show it then have a subtraction line for it. 

Edited by John W

I'm not really a dog.

Link to comment
Share on other sites

@ArtcoInc

That's a big difference from FL to CA, because I think the highest in FL is only 7% but I'm not sure about the Miami area.  CA has state income tax also, doesn't it?  No state income tax in FL either.  Overall, it's a good state to live in.

I'm not really a dog.

Link to comment
Share on other sites

Some places in CA go all the way to City Tax.  From memory I had some troubles working with taxes in I think Santa Monica... where it's City Tax, County Tax and State Tax on sales.

Also WA state has Sales Tax based on where the buyer lives (not where the seller is) - but they have an online API to make it super simple to get the correct Tax rate for the buyers Zip Code.  

Link to comment
Share on other sites

@clustersolutions, I'm in Winter Park, which is basically East Orlando.  Talking to one of my customers today about Sebastian Inlet and the fishing there.  I used to live in Tampa/Clearwater, then Ft Myers/Cape Coral.  Did a lot of fishing in both of those.  Lot of lakes in my area and the coast is not too far.

@burt,  The tax in Florida is supposed to be where the buyer lives also, but I just charge where I am.  For any state outside, I don't charge tax, which is the bulk of my sales.

The California peeps have pretty good weather, but Florida kind of shines right now for weather.  It's actually cold right now in the 50's, but most of our days in winter are 70's or even 80's.  I imagine the UK is pretty cold right now.  A lot of the US is very cold right now.

I'm not really a dog.

Link to comment
Share on other sites

@John W 50's...cold....seriously...what do you know about cold?  In Edmonton yesterday it was colder then at both the North and South poles.  Now that's cold.

Dan

Edited by Dan Cole
typos
Link to comment
Share on other sites

@Dan Cole  It's going to be 67 today for the high.  What I know about cold is I would die living where you live!  This is the best time of year in Fl with mainly sunny skies and nice days.  Stays green all year long, which I also like.  No changing of leaves, but I sense that's overated!  Personally, I like wearing shorts all year round, so I'll stay here.  I think the coldest I've been in is the upper teens back in Louisiana.  I built a snowman in 1974 when there was snow on the ground In La.

Sorry, didn't mean to make you jealous.  Well, maybe a little!

Edited by John W

I'm not really a dog.

Link to comment
Share on other sites

I checked the weather up there and it shows -23 for @Dan Cole!   I can't even imagine what that's like for you guys.  However, I'm going play poker wiht friend's tonight and I think I'll have to put on long pants becase it's getting down to 50.  Probably need a long sleeve shirt too! 

I'm not really a dog.

Link to comment
Share on other sites

4 hours ago, John W said:

Personally, I like wearing shorts all year round, so I'll stay here.

Some people wear shorts year round up here too...

Shorts.jpg.62e284f07a3fb3fb27fe01bd83e8b066.jpg

I think our dogs are a bit smarter though...

cold-dog.jpg.409873b24feb863108e51b34a4b4b4d1.jpg

Link to comment
Share on other sites

  • 1 month later...
On 21/12/2017 at 12:46 AM, clustersolutions said:

@sinopia, welcome and that's great! I had always wondered if the free shipping setup should be in ot_shipping.php as it really should be in the shipping modules. I moved mine into the shipping modules and allowed the ot_shipping.php to display the savings, like this...

5a3b04085a78c_ScreenShot2017-12-20at12_21_10AM.thumb.png.45d36a4352f032253f24dccbb804022a.png

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

Link to comment
Share on other sites

Just need to get the value of the cost now..

$total_saving = '<span style="color: red; text-decoration: line-through;">' . $order->info['shipping_cost'] . '</span>';

......

        $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']);
      }

Getting 0 because it's free.. 

Link to comment
Share on other sites

        // The line telling the savings on the shipping when it's free
        $total_saving = '<span style="color: red; text-decoration: line-through;">' . $currencies->format($order->info['shipping_cost'], true, $order->info['currency'], $order->info['currency_value']) . '</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']),
                                    'text' => $total_saving,
                                    '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']);
        }

 

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