Post by JM6891 » Thu Jul 07, 2011 7:29 pm

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
Last edited by JM6891 on Fri Jul 08, 2011 9:06 pm, edited 1 time in total.

New member

Posts

Joined
Fri Dec 10, 2010 7:22 pm

Post by i2Paq » Fri Jul 08, 2011 1:43 am

Looks to me like a bug?

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by Qphoria » Fri Jul 08, 2011 2:29 am

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;
}

Image


User avatar
Administrator

Posts

Joined
Tue Jul 22, 2008 3:02 am

Post by mberlant » Fri Jul 08, 2011 8:32 pm

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.

Please use proper English at all times, so that all members may understand you.


User avatar
Active Member

Posts

Joined
Sun Mar 13, 2011 8:33 pm

Post by i2Paq » Fri Jul 08, 2011 9:02 pm

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:

Norman in 't Veldt
Moderator OpenCart Forums

_________________ READ and Search BEFORE POSTING _________________

Our FREE search: Find your answer FAST!.

[How to] BTW + Verzend + betaal setup.


User avatar
Global Moderator

Posts

Joined
Mon Nov 09, 2009 7:00 pm
Location - Winkel - The Netherlands

Post by JM6891 » Fri Jul 08, 2011 9:05 pm

Works an absolute treat! Thank you so much!

New member

Posts

Joined
Fri Dec 10, 2010 7:22 pm

Post by komodosp » Mon Dec 05, 2011 5:42 pm

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;
}

Newbie

Posts

Joined
Mon Dec 05, 2011 5:41 pm

Post by rokcarl » Wed Oct 17, 2012 5:37 am

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>

Newbie

Posts

Joined
Tue Jul 03, 2012 5:21 am

Post by rogerclark » Tue Feb 24, 2015 1:41 pm

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)

Newbie

Posts

Joined
Fri Nov 14, 2014 11:37 am

Post by Johnathan » Tue Feb 24, 2015 11:57 pm

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

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by iplocker » Mon Apr 27, 2015 1:04 am

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

Active Member

Posts

Joined
Sun May 26, 2013 6:39 pm


Post by Madhavi » Tue Oct 04, 2016 2:42 pm

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

Newbie

Posts

Joined
Sat Oct 01, 2016 5:12 pm

Post by Johnathan » Tue Oct 04, 2016 10:52 pm

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.

Image Image Image Image Image


User avatar
Administrator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by bigmarket » Thu Jul 16, 2020 11:22 pm

Thank you Qphoria

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

Newbie

Posts

Joined
Mon Jun 01, 2020 12:48 am
Who is online

Users browsing this forum: No registered users and 155 guests