Post by OnNets » Tue Apr 09, 2013 4:25 pm

Hi everyone,

I would like to know what code should I add and where if I want to hide shipping method for Citylink if the value is $0.00.

I have add the following rates on the Citylink:
0:0.00
0.5:5.00
1.0:10.00

I am also using other shipping method so the require shipping set to no is no use to me.

Thank you.

regards,
Onnets

New member

Posts

Joined
Wed Jan 06, 2010 5:53 pm

Post by pprmkr » Tue Apr 09, 2013 4:48 pm

Edit catalog/model/shipping/citylink.php

At line 15 add:

Code: Select all

		if ( $this->cart->getWeight() == 0 ) {
			$status = false;	
		}

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by OnNets » Tue Apr 09, 2013 9:21 pm

Thank you pprmkr. It works!

1. Does this apply to weight base shipping as well?

2. I have another question. I have a shipping module that the shipping price is base on individual product. But I need to hide shipping method for this module if the value is $0.00. is there a code to hide it?

Thank you in advance.

Regards,
Onnets

New member

Posts

Joined
Wed Jan 06, 2010 5:53 pm

Post by pprmkr » Wed Apr 10, 2013 12:41 am

1. You can put the code in other shipping methods as well

2. To retrieve the value of the products in the basket, use:

Code: Select all

$this->cart->getSubTotal()
To hide the method when all products are 0.00:

Code: Select all

if ( $this->cart->getSubTotal() == 0 ) {
         $status = false;   
      }

User avatar
Active Member

Posts

Joined
Sat Jan 08, 2011 11:05 pm
Location - Netherlands

Post by OnNets » Wed Apr 10, 2013 12:47 am

Got it. Thank you very much for your help!

New member

Posts

Joined
Wed Jan 06, 2010 5:53 pm

Post by Ainsley009 » Tue Jul 01, 2014 11:48 pm

This works really well!

You can disable shipment options based on price weight and many other things!

Newbie

Posts

Joined
Mon Oct 14, 2013 1:01 am
Who is online

Users browsing this forum: No registered users and 2 guests