Page 1 of 1

SOLVED Remove Flat Rate shipping when Free Shipping is avail

Posted: Thu Jul 07, 2011 7:29 pm
by JM6891
Hi there,

I have set up a flat rate shipping fee of £7 and free shipping which becomes available when the order reaches £59.

In checkout step 2 (when the order reaches £59) under shipping method it has both methods available, both the free and the flat rate. Is there any way to remove the flat rate when free becomes available as it really doesn't need to be there?

Thanks in advance

Re: Remove Flat Rate shipping when Free Shipping is availabl

Posted: Fri Jul 08, 2011 1:43 am
by i2Paq
Looks to me like a bug?

Re: Remove Flat Rate shipping when Free Shipping is availabl

Posted: Fri Jul 08, 2011 2:29 am
by Qphoria
i2Paq wrote:Looks to me like a bug?
Good thing we consider you blind. No bug. Just how it works. Welcome to OpenCart i2paq ;)

This happens because shipping modules are all asynchronous and there is no conditional manager to handle shipping and payment.

The quick way for now would be to add logic to the flat rate code that simply says "if total > $59 then disable yourself"

1. EDIT: catalog/model/shipping/flat.php

2. FIND:

Code: Select all

if ($status) {
3. BEFORE, ADD:

Code: Select all

if ((float)$this->cart->getTotal() >= 59) {
    $status = false;
}

Re: Remove Flat Rate shipping when Free Shipping is availabl

Posted: Fri Jul 08, 2011 8:32 pm
by mberlant
As others have mentioned each time someone new creates another new thread on this very topic, it is a very handy marketing tool to show the customer just how much the shipping charge would have been if the store wasn't being so generous as to forgive it.

Re: Remove Flat Rate shipping when Free Shipping is availabl

Posted: Fri Jul 08, 2011 9:02 pm
by i2Paq
Qphoria wrote:
i2Paq wrote:Looks to me like a bug?
Good thing we consider you blind. No bug. Just how it works. Welcome to OpenCart i2paq ;)
I've misread the question by the TS, looking at my own store it works the same. :drunk:

Re: Remove Flat Rate shipping when Free Shipping is availabl

Posted: Fri Jul 08, 2011 9:05 pm
by JM6891
Works an absolute treat! Thank you so much!

Re: SOLVED Remove Flat Rate shipping when Free Shipping is a

Posted: Mon Dec 05, 2011 5:42 pm
by komodosp
The only change I'd make is not to hard-code the amount...

Code: Select all

if ((float)$this->cart->getTotal() >= $this->config->get('free_total')) {
	$status = false;
}

Re: SOLVED Remove Flat Rate shipping when Free Shipping is a

Posted: Wed Oct 17, 2012 5:37 am
by rokcarl
komodosp is right, that's the perfect solution. I used vQmod like this:

Code: Select all

	<file name="catalog/model/shipping/flat.php">
		<operation>
			<search position="before"><![CDATA[
				if ($status) {
			]]></search>
			<add><![CDATA[
				if ((float)$this->cart->getTotal() >= $this->config->get('free_total')) {
					$status = false;
				}
			]]></add>
		</operation>
	</file>

Re: SOLVED Remove Flat Rate shipping when Free Shipping is a

Posted: Tue Feb 24, 2015 1:41 pm
by rogerclark
This article had code that worked for me

http://www.opencartnews.com/tips/how-to ... is-active/

Basically find anywhere that has this code

Code: Select all

$this->session->data['shipping_methods'] = $quote_data;
and replace with

Code: Select all

if (isset($quote_data['free'])) {
    $free_only['free'] = $quote_data['free'];
    $quote_data = $free_only;
}
$this->session->data['shipping_methods'] = $quote_data;
For me it was in 3 places including pp_express (which was not covered in the article linked to)

Re: SOLVED Remove Flat Rate shipping when Free Shipping is a

Posted: Tue Feb 24, 2015 11:57 pm
by Johnathan
Glad my tutorial helped you. In case that link ever goes down, I also have the tutorial written here:

http://www.opencartx.com/tutorials#show ... e-shipping

Re: SOLVED Remove Flat Rate shipping when Free Shipping is a

Posted: Mon Apr 27, 2015 1:04 am
by iplocker
Can I ask a simply question?

Why this simple modification not comes to the core ? (of course I mean the core of new Opencart )
None admin from Opencart cant add such small modifications that make our life easier ?

It will be good some coders from Opencart will watch the posts at the forum .
I find it silly to have flat rate if there is free shipping .

Thanks

Re: Hide Country Zone Shipping Rate when Free shipping avail

Posted: Tue Oct 04, 2016 2:42 pm
by Madhavi
I want to hide Country Zone Shipping Rate when FREE SHIPPING is available and set to certain amount during checkout process in delivery method.
1.jpg

In delivery method Country Zone Shipping Rate is mention - 1.jpg (223.35 KiB) Viewed 15696 times

I want to hide Country Zone Shipping Rate when amount is equal to 150 or greater than 150. When amount is equal to or greater than 150 i want to display Free Shipping only.Please solve my issue.

Re: Hide Country Zone Shipping Rate when Free shipping avail

Posted: Tue Oct 04, 2016 10:52 pm
by Johnathan
Madhavi wrote:I want to hide Country Zone Shipping Rate when amount is equal to 150 or greater than 150. When amount is equal to or greater than 150 i want to display Free Shipping only.Please solve my issue.
Country Zone Shipping is not a standard shipping method in OpenCart, so you should contact the developer for assistance with the right code edit. You can point them to this topic if they do not know how to do the edit themselves.

If they're unwilling or unable to help, you could get an extension like Total-Based Shipping, which lets you set total-based rates for different geo zones / countries, so you could make your rates only appear in the circumstances you want them. If you need something more powerful than that, Formula-Based Shipping can do the same thing, and has lots of additional rule types you can use to restrict the charges.

Feel free to take a look at the screenshots and demo site, and if you're interested let me know at www.getclearthinking.com/contact if you have any further questions.

Re: SOLVED Remove Flat Rate shipping when Free Shipping is avail

Posted: Thu Jul 16, 2020 11:22 pm
by bigmarket
Thank you Qphoria

it worked well :D :D :D :D :D :D :D :D :D :D :D :D :D