Post by stefg » Sat Jan 22, 2022 12:59 pm

Hallo,
Currently in OpenCart 3.0.3.2 the free shipping module when enabled works only under one condition, that is if the total amount of the order is above certain value it is activated.
How can I add a second condition so that if only both conditions are true the free shipping will be activated.
For example: total anount of the order is above $100 and the weight of the item is less than 10 kg.
Thank you in advance!
Last edited by stefg on Sat Jan 22, 2022 11:44 pm, edited 1 time in total.

New member

Posts

Joined
Fri Oct 18, 2019 7:25 pm

Post by khnaz35 » Sat Jan 22, 2022 8:30 pm

stefg wrote:
Sat Jan 22, 2022 12:59 pm
Hallo,
Currently in OpenCart 3.0.3.2 the free shipping module when enabled works only under one condition, that is if the total amount of the order is above certain value it is activated.
How can I add a second condition so that if only both conditions are true the free shipping will be activated.
For example: total anount of the order is above $100 and the weight of the item is less than 10 kg.
Thank you in advance!
It is do able try to look at the free shipping file and do the same.

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by thekrotek » Sat Jan 22, 2022 9:09 pm

You can edit the code and add any condition you like.

Professional OpenCart extensions, support and custom work.
Contact me via email or Skype by support@thekrotek.com


User avatar
Expert Member

Posts

Joined
Sun Jul 03, 2016 12:24 am


Post by Johnathan » Sat Jan 22, 2022 10:57 pm

You will have to modify the extension code, or purchase a different shipping extension to do this. I have one called Formula-Based Shipping that lets you set Free Shipping rates based on weight + total. You'd set it up like this:

------------------------------------------------------------------------------
CHARGE #1
Title: Free Shipping
Group: FS
Charge Type: Total
Charge Field: 100-99999 = 0.00
Rule: Weight of cart = 0-9.999
------------------------------------------------------------------------------

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

Image
Image Image Image Image


User avatar
Global Moderator

Posts

Joined
Fri Dec 18, 2009 3:08 am


Post by stefg » Sat Jan 22, 2022 11:08 pm

khnaz35 wrote:
Sat Jan 22, 2022 8:30 pm
stefg wrote:
Sat Jan 22, 2022 12:59 pm
Hallo,
Currently in OpenCart 3.0.3.2 the free shipping module when enabled works only under one condition, that is if the total amount of the order is above certain value it is activated.
How can I add a second condition so that if only both conditions are true the free shipping will be activated.
For example: total anount of the order is above $100 and the weight of the item is less than 10 kg.
Thank you in advance!
It is do able try to look at the free shipping file and do the same.
Should I look into admin -> controller -> extension -> shipping -> free.php or admin -> view -> template -> extension -> shipping -> free.twig or somewhere else?

New member

Posts

Joined
Fri Oct 18, 2019 7:25 pm

Post by khnaz35 » Sat Jan 22, 2022 11:14 pm

Opencart works on the mcvl model. So you have to make changes everywhere.

Urgent Questions shoot here: khnaz35@gmail.com
Enjoy nature ;) :) :-*


User avatar
Active Member

Posts

Joined
Mon Aug 27, 2018 11:30 pm
Location - Malaysia

Post by stefg » Sat Jan 22, 2022 11:25 pm

khnaz35 wrote:
Sat Jan 22, 2022 11:14 pm
Opencart works on the mcvl model. So you have to make changes everywhere.
What do you mean by everywhere? Apart from those two files are there other files that will be affected? Which are these files?

New member

Posts

Joined
Fri Oct 18, 2019 7:25 pm

Post by Cue4cheap » Sat Jan 22, 2022 11:26 pm

If you don't mind messing with the code in: catalog/model/extension/shipping/free.php
find

Code: Select all

		} else {
			$status = false;
		}
After add:

Code: Select all

$weight = $this->cart->getWeight();
if ($weight > '10') { $status = false; } 		
		// 10 limit
That should work for you
Mike

cue4cheap not cheap quality


Active Member

Posts

Joined
Fri Sep 20, 2013 4:45 am

Post by stefg » Sat Jan 22, 2022 11:40 pm

Cue4cheap wrote:
Sat Jan 22, 2022 11:26 pm
If you don't mind messing with the code in: catalog/model/extension/shipping/free.php
find

Code: Select all

		} else {
			$status = false;
		}
After add:

Code: Select all

$weight = $this->cart->getWeight();
if ($weight > '10') { $status = false; } 		
		// 10 limit
That should work for you
Mike
That works! So simple! Thank you very much! :)

New member

Posts

Joined
Fri Oct 18, 2019 7:25 pm
Who is online

Users browsing this forum: CJC and 9 guests