If this is your first visit, check our documentation. To post, register or login.
Forums / Setting Up Your Zen Cart Products / Setting Up Categories, Products, Attributes / Free shipping cart wide if a particular item is purchased

Free shipping cart wide if a particular item is purchased

Started by attroll on 8 Apr 2014, 12:58 AM · Views: 1,924

Results 1 to 16 of 16
8 Apr 2014, 12:58 AM
#1
attroll avatar

attroll

Zen Follower

Join Date:
Dec 2007
Posts:
103
Plugin Contributions:
0

Post #1 by attroll

I am not sure if I posted this in the right forum.

 I have an item in my store. Lets say a particular hammock. I want to set it up so that if anyone purchases this item they will receive free shipping on anything else that they add to there cart as long as they purchase this hammock. Is this possible?
8 Apr 2014, 1:23 AM
#2
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Post #2 by gilby

attroll:

I am not sure if I posted this in the right forum.

 I have an item in my store. Lets say a particular hammock. I want to set it up so that if anyone purchases this item they will receive free shipping on anything else that they add to there cart as long as they purchase this hammock. Is this possible?Is the free shipping only **"on anything else that they add to there cart"**

or does it include free shipping on the hammock as well.
iow is the entire order, free shipping?

8 Apr 2014, 12:08 PM
#3
attroll avatar

attroll

Zen Follower

Join Date:
Dec 2007
Posts:
103
Plugin Contributions:
0

Post #3 by attroll

gilby:

Is the free shipping only "on anything else that they add to there cart"
or does it include free shipping on the hammock as well.
iow is the entire order, free shipping?
I want it so that when someone picks this item (hammock) that everything else that is included with this items in there shopping cart are also free shipping.
But if they do not pick this item (hammock) then the other items are as they normally are and you have to pay for shipping.

8 Apr 2014, 12:44 PM
#4
ajeh avatar

ajeh

Oba-san

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

Post #4 by ajeh

So you are saying, buy a hammock and get totally Free Shipping, regardless of what is or isn't in the cart with the hammock, correct?

What shipping module(s) are you using?

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Apr 2014, 12:59 PM
#5
attroll avatar

attroll

Zen Follower

Join Date:
Dec 2007
Posts:
103
Plugin Contributions:
0

Post #5 by attroll

Ajeh:

So you are saying, buy a hammock and get totally Free Shipping, regardless of what is or isn't in the cart with the hammock, correct?

What shipping module(s) are you using?
Yes, this is exactly what I am saying and want.
I am currently only using Zone Rates for a shipping module.

8 Apr 2014, 1:39 PM
#6
ajeh avatar

ajeh

Oba-san

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

Post #6 by ajeh

You could use the Free Shipping Options freeoptions for Hammock and customize the two shipping modules ...

Customize the Zone Rates zones shipping module with the code in RED:

      // disable only when entire cart is free shipping

      if (zen_get_shipping_enabled($this->code)) {
        $this->enabled = ((MODULE_SHIPPING_ZONES_STATUS == 'True') ? true : false);
      }

[B]// bof: disable if products_id 12 is in cart
      if (!IS_ADMIN_FLAG) {
        $chk_product = 0;
        $chk_product = $_SESSION['cart']->in_cart_check('products_id','12');
        if ($chk_product > 0) {
          $this->enabled = false;
        }
      }
// eof: disable if products_id 12 is in cart
[/B]
      // CUSTOMIZE THIS SETTING FOR THE NUMBER OF ZONES NEEDED
      $this->num_zones = 3;

and reverse the logic for the Free Shipping Options freeoptions where you can set the Total >= 0 to manage that shipping module, customized with the code above, but reversed ...

[B]        if ($chk_product == 0) {
          $this->enabled = false;
}
[/B]

Linda McGrath
If you have to think ... you haven't been zenned ...

**Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!**

Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
Officially PayPal-Certified! Just click here

Try our Zen Cart Recommended Services - Hosting, Payment and more ...
Signup for our Announcements Forums to stay up to date on important changes and updates!

8 Apr 2014, 9:43 PM
#7
attroll avatar

attroll

Zen Follower

Join Date:
Dec 2007
Posts:
103
Plugin Contributions:
0

Post #7 by attroll

In the code where it says products_id 12 is that the id code of the hammock?

8 Apr 2014, 9:49 PM
#8
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #8 by mc12345678

attroll:

In the code where it says products_id 12 is that the id code of the hammock?

That is the expectation; however, you may need to modify the number to suit your store. The product_id can be easily seen to the left of the product name when viewing your categories/products in the admin panel.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

9 Apr 2014, 1:30 AM
#9
attroll avatar

attroll

Zen Follower

Join Date:
Dec 2007
Posts:
103
Plugin Contributions:
0

Post #9 by attroll

That's what I thought. So there is no easy way to do this in the attributes? I was planning on doing this with more than one item. This may turn out more difficult than what I thought.

9 Apr 2014, 1:59 AM
#10
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #10 by mc12345678

attroll:

That's what I thought. So there is no easy way to do this in the attributes? I was planning on doing this with more than one item. This may turn out more difficult than what I thought.

Sure it is. The provided method was for a single product. Please remember we can only help wiith those items and issues that are described. If you would like something more. Then would need to provide more information.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

9 Apr 2014, 2:22 AM
#11
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Post #11 by gilby

attroll:

That's what I thought. So there is no easy way to do this in the attributes? I was planning on doing this with more than one item. This may turn out more difficult than what I thought.
You asked about a single item in the cart to make free shipping for the entire order? You got the answer to that question.

If you want to "extend" it to more than the ONE item asked about then more work is required.

If you have a small-ish list of items?
That can be handled using the in_array( "list of items") function

If you have hundreds of such items then you would probably need to store the list in a table and use an sql search to check if the item is in that table.

All of this requires altering php files every time you want to alter the list. :no:

If you were looking to somehow do this from the admin by playing with attributes?
Then the answer is NO, without a LOT of custom coding

9 Apr 2014, 2:42 AM
#12
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #12 by mc12345678

Here's one of those times I could see a read only attribute being used... On the product(s) the attribute is hidden via css, then in the applicable shipping areas the cart is checked to see if the attribute is present. I'm thinking there may be some faster way than searching through the cart until either the attribute is found or all items searched (whichever comes first), but I haven't done much attribute searching any time recently.

Another suggestion (learned from one of the best public SQL writers of ZC) would be to possibly link said products into a category that isn't shown and check if the products in the cart appear in that category. Iknow there are other ideas, but it really helps to know what the constraints or needs are.

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

9 Apr 2014, 2:54 AM
#13
gilby avatar

gilby

Totally Zenned

Join Date:
Aug 2005
Location:
Vic, Oz
Posts:
1,816
Plugin Contributions:
0

Post #13 by gilby

mc12345678:

Another suggestion (learned from one of the best public SQL writers of ZC) would be to possibly link said products into a category that isn't shown and check if the products in the cart appear in that category. Iknow there are other ideas, but it really helps to know what the constraints or needs are.I like this idea as a Q & D solution. :smile:

You only need to alter the php files once
then
You can add / remove the items from the linked category as required from the admin

9 Apr 2014, 10:04 PM
#14
attroll avatar

attroll

Zen Follower

Join Date:
Dec 2007
Posts:
103
Plugin Contributions:
0

Post #14 by attroll

Thank you for your help. I am going to try a different approach. I will create another thread to ask those questions. If I decide to come back to this approach I will reply to this thread if I have any questions.

Thank you

9 Apr 2014, 10:09 PM
#15
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Post #15 by mc12345678

attroll:

Thank you for your help. I am going to try a different approach. I will create another thread to ask those questions. If I decide to come back to this approach I will reply to this thread if I have any questions.

Thank you

If the goal is the same, I am not so sure that a different thread is needed. If you're looking for something that gives a different end result then please feel free. Also, if you do start a new thread regarding the same outcome, feel free to post that link here at some point (preferably when a solution is found which is also why there shouldn't be a reason to start a new thread to obtain the same result.)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

4 Jan 2015, 8:46 AM
#16
raunharman avatar

raunharman

Zen Follower

Join Date:
Dec 2005
Posts:
165
Plugin Contributions:
0

Post #16 by raunharman

I have a similar query.

I am using Zen version 1.3.9 with Books module.
The shipping module is Flat Rate.
I want to offer free shipping on the entire order when a particular attribute is selected.
Could you please help.
Thanks in advance.

http://www.raunharman.com
http://www.raunharman.net
Website Development, E-Book Solutions & Handicraft Exports