Post by i2Paq » Sun Nov 13, 2011 1:20 am

For a store running 1.4.9.2 I want to hide the Weight Based Shipping when Free Shipping is offered.

The current setup I have:

1: Weight Based Shipping
2: Ensured Shipping
3. Free Shipping.

Free Shipping is offered when the orders are above 37.50. This works but it still shows the Weight Based Shipping.
For my customer this could be confusing so I want to hide the Weight Based Shipping.

I found an post with some code but no explanation on where to put it.

I think it could be \catalog\model\shipping\weight.php

before

Code: Select all

$method_data = array();
add

Code: Select all

		if ($this->cart->getSubTotal() > $this->config->get('free_total')) {
			$status = FALSE;
		}
I tried it but it does not work.

Anyone another solution?

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 Gerrit » Sun Nov 13, 2011 4:00 am

Find in catalog/model/shipping/weight.php

Code: Select all

if ($status) {
Add before this line:

Code: Select all

if ($this->cart->getSubTotal() > $this->config->get('free_total')) {
					$status = false;
				} 
For ensured shipping this is the same.

For modelcars cars see my OC 3.0.2.0 shop: http://www.gbcars.nl/
For Wooden Toys see my 2.3.0.2 shop: https://www.dehoutentreinenwinkel.nl/


User avatar
Active Member

Posts

Joined
Fri Nov 27, 2009 9:06 pm

Post by i2Paq » Sun Nov 13, 2011 9:14 pm

Gerrit wrote:Find in catalog/model/shipping/weight.php

Code: Select all

if ($status) {
Add before this line:

Code: Select all

if ($this->cart->getSubTotal() > $this->config->get('free_total')) {
					$status = false;
				} 
For ensured shipping this is the same.
Works like a charm.

The only thing is that the above code just works all the time.....

If I set it to be offered only to the Dutch geo-zone it also hides the Weight Based for other contry's as soon as the Free Shipping amount is reached :-\

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 Gerrit » Mon Nov 14, 2011 5:54 pm

i2Paq wrote:
Gerrit wrote:Find in catalog/model/shipping/weight.php

Code: Select all

if ($status) {
Add before this line:

Code: Select all

if ($this->cart->getSubTotal() > $this->config->get('free_total')) {
					$status = false;
				} 
For ensured shipping this is the same.
Works like a charm.

The only thing is that the above code just works all the time.....

If I set it to be offered only to the Dutch geo-zone it also hides the Weight Based for other contry's as soon as the Free Shipping amount is reached :-\
This can be ommitted if you change the code to:

Code: Select all

if ($address['iso_code_2'] === 'NL') {
				if ($this->cart->getSubTotal() > $this->config->get('free_total')) {
					$status = false;
				}
			} 
Then the free shipping is only available to Dutch buyers.

For modelcars cars see my OC 3.0.2.0 shop: http://www.gbcars.nl/
For Wooden Toys see my 2.3.0.2 shop: https://www.dehoutentreinenwinkel.nl/


User avatar
Active Member

Posts

Joined
Fri Nov 27, 2009 9:06 pm

Post by i2Paq » Mon Nov 14, 2011 6:18 pm

OK, thanks!

I will try this tonight :)

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
Who is online

Users browsing this forum: No registered users and 1 guest