Jump to content
Latest News: (loading..)
sinopia

Help with ot_shipping due the free shipping

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?

Share this post


Link to post
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...

}

Share this post


Link to post
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!?

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

@John W

California State sales tax varies from county to county too. Where I live, it's 9.25%. There are places here in California where it is 10.25% :ohmy:

Malcolm

Edited by ArtcoInc

If you are running the "official" osC 2.3.4 or 2.3.4.1 download, your installation is obsolete! Get the latest community-supported responsive "Edge" release here

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

@John W

Yes, we have a state income tax too. :unsure:

Got kin in Florida. Good state to live in, if you don't mind the mugginess or the hurricanes :cool:

Malcolm (living in earthquake country)


If you are running the "official" osC 2.3.4 or 2.3.4.1 download, your installation is obsolete! Get the latest community-supported responsive "Edge" release here

Share this post


Link to post
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.  


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 current code (community-supported responsive 2.3.4.1BS Edge) here

 

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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.

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
2 hours ago, greasemonkey said:

Boy... did this thread go off topic... lol

And it was all John's fault. :laugh::laugh:

Dan

Share this post


Link to post
Share on other sites

Another part of Florida.  My friend took this pic yesterday Kayaking.  They think it was at least 10ft.

26167708_10156014156243205_4875975527427126480_n.jpg.f5e789472eab48e454a9120b53c6b18a.jpg


I'm not really a dog.

Share this post


Link to post
Share on other sites
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? 

Share this post


Link to post
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.. 

Share this post


Link to post
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']);
        }

 

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

×