Zen Cart Logo
Forums / Addon Shipping Modules / Free Shipping Rules - Default, hide other shipping option upon checkout

Free Shipping Rules - Default, hide other shipping option upon checkout

Views: 9,340

Results 1 to 20 of 42
11 May 2010, 12:41 PM
#1
sangelo avatar

sangelo

New Zenner

Join Date:
May 2010
Posts:
2
Plugin Contributions:
0

Free Shipping Rules - Default, hide other shipping option upon checkout

I'm a newbie so please forgive me if this has been covered.

I've installed the "free shipping rules" module and the only other shipping module enabled is the "per item" shipping module.

I have free shipping rules configured so that when 6 or more items are in the cart, the free shipping option kicks in. I configured the per item shipping at 20/item.

The rules work fine.. however.. If the qty is less than 6, I get just the per item shipping option @ 20/item as I would expect. But when I put 6 or more in the cart, I get two options for shipping. If the qty is 6, one option is $120 in shipping and the other option is "free shipping".

My question is this, can I suppress the $20/per item shipping option so all that shows is the free shipping if the qty is 6 or higher in this scenario? If not, is there a way to make the free shipping option the default in this scenario? What happens now is that the radio button is on the per item shipping line and not the free shipping.

Thanks in advance for your assistance.

11 May 2010, 2:42 PM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

The Free Shipping Options freeoptions is designed to show as an optional shipping method in addition to the other shipping modules ...

If you want to "hide" the Item Rate shipping module, they you would need to customize it set the $this->enabled to false when the number of items in the cart are >= 6 ...

You can customize the Item Rate item shipping module by editing the file:
/includes/modules/shipping/item.php

      // disable only when entire cart is free shipping
      if (zen_get_shipping_enabled($this->code)) {
        $this->enabled = ((MODULE_SHIPPING_ITEM_STATUS == 'True') ? true : false);
      }

  if (!IS_ADMIN_FLAG) {
    global $cart;
    if ($_SESSION['cart']->count_contents() >= 6) {
      $this->enabled = false;
    }
  }

NOTE: save a copy of the original file and the updated file on your computer as there are no overrides for this file ...

NOTE: it is best not to save these backup files on the server as this is an autoloading directory and unless you rename the backups correctly they will produce errors ...

11 May 2010, 7:38 PM
#3
sangelo avatar

sangelo

New Zenner

Join Date:
May 2010
Posts:
2
Plugin Contributions:
0

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

worked perfectly..Thanks so much!

11 May 2010, 8:12 PM
#4
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

You are most welcome ... thanks for the update that this was able to work for you ...

3 Oct 2010, 3:36 PM
#5
wdd49 avatar

wdd49

New Zenner

Join Date:
Jan 2008
Posts:
45
Plugin Contributions:
0

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

Hi,

Im wanting to adapt the above code so the other options dont show when the cart total is = or more than £50.00

Can anyone help please :-)

3 Oct 2010, 4:36 PM
#6
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

If you ONLY want to offer Free Shipping when the Order is >= 50.00 then you should be using the Modules ... Order Totals ... Shipping ot_shipping

Set to 50.00 and set to enabled ...

NOTE: Free Shipping Options freeoptions is designed to show in addition to other shipping modules so the customer has a choice for faster shipping methods vs the Free Shipping on a slow boat ...

3 Oct 2010, 4:43 PM
#7
wdd49 avatar

wdd49

New Zenner

Join Date:
Jan 2008
Posts:
45
Plugin Contributions:
0

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

Hi,

Im wanting to offer 3 Options all together.

1 - Slow (Paid for)
2 - Fast (paid for)

3 Fast (free when over £50)

So i need to turn 1 and 2 off (Which im using flat and flat clone for)

and only display 3 (free options) if the order is over £50.

Ive used the code from above and it works a treat but only if they have 6 items in the cart, so im trying to change the above code to be = or great than £50 intead of the 6 items bit.

Sorry that makes sense in my head hope it does to you too!!

Thanks.

3 Oct 2010, 4:58 PM
#8
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

You can use the:
$_SESSION['cart']->show_total()

to check the Total of the Order and turn off the two shipping modules for:
1 - Slow (Paid for)
2 - Fast (paid for)

by setting the:
$this->enabled

in those two shipping modules to false when the:
$_SESSION['cart']->show_total() >= 50.00

3 Oct 2010, 5:03 PM
#9
wdd49 avatar

wdd49

New Zenner

Join Date:
Jan 2008
Posts:
45
Plugin Contributions:
0

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

Ahhh Thanks!! =) Genious!!

:clap::clap::clap:

3 Oct 2010, 5:13 PM
#10
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

Thanks for the update that this was able to help you out ... :smile:

6 Oct 2010, 9:06 PM
#11
azimpact avatar

azimpact

New Zenner

Join Date:
Oct 2010
Posts:
33
Plugin Contributions:
0

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

Is there any way to give free shipping to a specific state and not the others?

7 Oct 2010, 1:18 AM
#12
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

The easy way to do that is to build a Zone Definition for that 1 State and add it to the Free Shipping Options freeoptions and set the Total to be >= 0 ...

This will show this Free Shipping Options and the other shipping options but does not require any code changes ...

7 Oct 2010, 5:10 PM
#13
wdd49 avatar

wdd49

New Zenner

Join Date:
Jan 2008
Posts:
45
Plugin Contributions:
0

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

Hey,

Hope you can shed some light on this for me!

Im not getting a blank page on the step 2 of checkout page.

Have looked in my error log and this is what it contains:
[07-Oct-2010 18:04:07] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/sexytoyt/public_html/includes/languages/english/modules/shipping/flat.php:53) in /home/sexytoyt/public_html/includes/functions/functions_general.php on line 45

Can you help me out please?

Tar

7 Oct 2010, 10:22 PM
#14
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

I would check the file:
/public_html/includes/languages/english/modules/shipping/flat.php

and see if you have blank line(s) or space(s) after the closing php bracket ?> at the end of the file ...

NOTE: shipping language files do have templates and overrides
/public_html/includes/languages/english/modules/shipping/your_template_dir/flat.php

8 Oct 2010, 2:30 AM
#15
azimpact avatar

azimpact

New Zenner

Join Date:
Oct 2010
Posts:
33
Plugin Contributions:
0

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

Ajeh:

The easy way to do that is to build a Zone Definition for that 1 State and add it to the Free Shipping Options freeoptions and set the Total to be >= 0 ...

This will show this Free Shipping Options and the other shipping options but does not require any code changes ...

I tried that, but the free shipping option does not show up. The state I'm using is set as a Zone Defination for Taxes and I'm using that same defination. Does that matter?

8 Oct 2010, 3:57 AM
#16
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

If you only have 1 State defined in the Zone Definition then there should only be 1 State that can see this shipping method when the Shipping Address matches ...

What other shipping modules are you using?

8 Oct 2010, 5:03 AM
#17
azimpact avatar

azimpact

New Zenner

Join Date:
Oct 2010
Posts:
33
Plugin Contributions:
0

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

I'm using the tables shipping option.

The free shipping show yellow and the table shipping shows green and is working.

For some reason, the freeshipping isn't. Is there somwhere else that tells the cart to allow free shipping?

8 Oct 2010, 1:33 PM
#18
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

Could you post your settings for the Free Shipping Options freeoptions shipping module that display in the right hand panel when you click on the shipping module ...

8 Oct 2010, 1:50 PM
#19
azimpact avatar

azimpact

New Zenner

Join Date:
Oct 2010
Posts:
33
Plugin Contributions:
0

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

Here you go:

FREE SHIPPING

Enable Free Shipping
True

Free Shipping Cost
0.00

Handling Fee
0.00

Tax Class
--none--

Shipping Zone
Arizona

Sort Order
0

8 Oct 2010, 2:58 PM
#20
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: Free Shipping Rules - Default, hide other shipping option upon checkout

You are trying to use the Free Shipping freeshipper shipping module ...

This is a special shipping module designed to work with Products marked as Always Free Shipping where "everyone" gets Free Shipping and 0 weight Products for when 0 weight is defined as Free Shipping ...

While there is a setting for Zones on the Free Shipping freeshipper shipping module, that is only there to help developers in building more robust enhancements to this shipping module ... the Zone setting does not work in the same manner as it would on the other shipping modules ...

The Free Shipping Options freeoptions shipping module is designed to run at the same time as the other shipping modules and can use Zones ...

This can be set to the Zone where you want a person to have the Free Shipping Option by setting the Total >= 0 and setting the Zone on it ...

Now, anyone with a Shipping Address in that Zone would show the Free Shipping Options freeoptions plus the other shipping modules, should they want a faster method ...