If this is your first visit, check our documentation. To post, register or login.
Forums / Built-in Shipping and Payment Modules / Different shipping methods for different categories

Different shipping methods for different categories

Started by tylerd213 on 13 Mar 2008, 2:16 AM · Views: 107,884

Results 161 to 180 of 554
4 Nov 2009, 8:09 AM
#161
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Different shipping methods for different categories

Brismods:

I'm not exactly the greatest when it comes to this sort of stuff. We previously had tried a few of the other solutions posted in the thread. For example there was one where we posted the code into the file, but it needed to be duplicated for the different categories, however when more than one copy of the code was in the file, the codes would seemingly clash and not work at all.

Somewhere in the thread someone mentioned using beyond two categories(I think it was two) causes problems. Was that you? Or are you trying to do beyond two?

This is where trying a solution similar to one I listed works better, which is to filter based on the product model. Are you currently using the Product Model for your products? If not, you could do that. Scroll bake a little to one of my last posts and take a look. If that doesn't make sense let me know.

-lindasdd

5 Nov 2009, 12:37 AM
#162
brismods avatar

brismods

New Zenner

Join Date:
Sep 2009
Posts:
4
Plugin Contributions:
0

Re: Different shipping methods for different categories

lindasdd:

Somewhere in the thread someone mentioned using beyond two categories(I think it was two) causes problems. Was that you? Or are you trying to do beyond two?
That wasn't us, but yeah. We were trying to do about four or so, and they just kept clashing with each other and it just wouldnt work :(

lindasdd:

This is where trying a solution similar to one I listed works better, which is to filter based on the product model. Are you currently using the Product Model for your products? If not, you could do that. Scroll bake a little to one of my last posts and take a look. If that doesn't make sense let me know.

I'll set the products up with a model type and try this out and let you know how it goes.

5 Nov 2009, 9:27 PM
#163
lyricwings avatar

lyricwings

Zen Follower

Join Date:
Oct 2006
Posts:
109
Plugin Contributions:
0

Re: Different shipping methods for different categories

Hello - I'm on v 1.3.8a

For three categories, all product have free shipping. For one category, shipping is based on dollar amount.

I have freeshipper and zones as the two shipping modules that are activated.

For the category with shipping based on dollar amount, I set up a zones chart with shipping calculated by weight. For each product, I enter the weight as being equal to the price. (i.e., $20 product is 20 in the weight box). This seems to calculate shipping perfectly, as long as only items from that category are in the cart.

The problem arises when a customer purchases both a free shipping item and an item from the category with shipping charges. I can't figure out how to get the shipping charges to apply when there is a free shipping item also in the cart. If there is a free shipping item in the cart, it seems to always make the shipping free, even if there is a product in the cart that is supposed to be charged for shipping.

Any advice?
**
**

6 Nov 2009, 2:49 AM
#164
brismods avatar

brismods

New Zenner

Join Date:
Sep 2009
Posts:
4
Plugin Contributions:
0

Re: Different shipping methods for different categories

Lindasdd, the method you posted using the low order fee code worked, however i was wondering if you knew if i was able to change the name of the 'low order fee' to something like 'large item fee'? Any help would be appreciated.

11 Nov 2009, 6:58 PM
#165
lyricwings avatar

lyricwings

Zen Follower

Join Date:
Oct 2006
Posts:
109
Plugin Contributions:
0

Re: Different shipping methods for different categories

Wanted to post this again - should I have started a new thread for this question?

lyricwings:

Hello - I'm on v 1.3.8a

For three categories, all product have free shipping. For one category, shipping is based on dollar amount.

I have freeshipper and zones as the two shipping modules that are activated.

For the category with shipping based on dollar amount, I set up a zones chart with shipping calculated by weight. For each product, I enter the weight as being equal to the price. (i.e., $20 product is 20 in the weight box). This seems to calculate shipping perfectly, as long as only items from that category are in the cart.

The problem arises when a customer purchases both a free shipping item and an item from the category with shipping charges. I can't figure out how to get the shipping charges to apply when there is a free shipping item also in the cart. If there is a free shipping item in the cart, it seems to always make the shipping free, even if there is a product in the cart that is supposed to be charged for shipping.

Any advice?

12 Nov 2009, 12:49 PM
#166
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Re: Different shipping methods for different categories

Brismods:

Lindasdd, the method you posted using the low order fee code worked, however i was wondering if you knew if i was able to change the name of the 'low order fee' to something like 'large item fee'? Any help would be appreciated.

For that you get the classic response of "Use the Developer's Toolkit." If your admin or customer pages have text, that means the text is coming from somewhere. So you need to figure out where. For stuff like this it is probably a language file.

My text was changed to "Frozen Bucket". It looks like this one is here:

includes/languages/english/modules/order_total/cutom_template/ot_loworderfee.php
Line #22 : define('MODULE_ORDER_TOTAL_LOWORDERFEE_TITLE', 'Frozen Shipping Bucket');

Line #23 : define('MODULE_ORDER_TOTAL_LOWORDERFEE_DESCRIPTION', 'Frozen Shipping Bucket');

Of course if you really wanted to do this correctly you would use this module as a template and actually create a new shipping module that does all this. That way you would avoid confusion. Me - I'm trying to make upgrades as hard as possible on myself.

-lindasdd

12 Nov 2009, 12:54 PM
#167
lindasdd avatar

lindasdd

Zen Follower

Join Date:
Jun 2007
Posts:
474
Plugin Contributions:
0

Re: Different shipping methods for different categories

lyricwings:

Hello - I'm on v 1.3.8a

For three categories, all product have free shipping. For one category, shipping is based on dollar amount.

I have freeshipper and zones as the two shipping modules that are activated.

For the category with shipping based on dollar amount, I set up a zones chart with shipping calculated by weight. For each product, I enter the weight as being equal to the price. (i.e., $20 product is 20 in the weight box). This seems to calculate shipping perfectly, as long as only items from that category are in the cart.

The problem arises when a customer purchases both a free shipping item and an item from the category with shipping charges. I can't figure out how to get the shipping charges to apply when there is a free shipping item also in the cart. If there is a free shipping item in the cart, it seems to always make the shipping free, even if there is a product in the cart that is supposed to be charged for shipping.

Any advice?

Nice idea on the weight=price. I may need to try that myself.

Based on what I have seen this should not have given free shipping. For the free shipping categories how are the categories designated as free shipping? Meaning is it on product level(Always Free Shipping radio button clicked) or is it via changes to the php files?

12 Nov 2009, 6:32 PM
#168
bassface avatar

bassface

New Zenner

Join Date:
Jan 2005
Location:
Aurora, CO USA
Posts:
71
Plugin Contributions:
1

Re: Different shipping methods for different categories

Ajeh:

  // disable for one master_categories_id
  if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','17') > 0)) {
      $this->enabled = false;
  }
Ajeh, I have this logic working on my site in flat.php and a clone of flat called flathalf.php, but with every new category I add, I have to add a new test 'if' statement to these files. To this point:
```php
    // disable for one master_categories_id for WOTM Full Year
      if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','72') > 0)) {
          $this->enabled = false;
      }      

    // disable for one master_categories_id for Dealer's Choice
      if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','67') > 0)) {
          $this->enabled = false;
      }      
    // disable for one master_categories_id for Wine Baskets
      if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','68') > 0)) {
          $this->enabled = false;
      }      
    // disable for one master_categories_id for Thirst-Aid Kits
      if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','69') > 0)) {
          $this->enabled = false;
      }      
    // disable for one master_categories_id for Personalized Labels
      if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','70') > 0)) {
          $this->enabled = false;
      }
    // disable for one master_categories_id for Accessories
      if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','74') > 0)) {
          $this->enabled = false;
      }  
    // disable for one master_categories_id for Wine Glasses
      if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','75') > 0)) {
          $this->enabled = false;
      }
      // disable for one master_categories_id for Wine Openers
      if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','76') > 0)) {
          $this->enabled = false;
      }
      // disable for one master_categories_id for Backpacks and Totes
      if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','77') > 0)) {
          $this->enabled = false;
      }
      // disable for one master_categories_id for Journals and Books
      if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','78') > 0)) {
          $this->enabled = false;
      }
      // disable for one master_categories_id for Wine Racks
      if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','79') > 0)) {
          $this->enabled = false;
      }
      // disable for one master_categories_id for Accessories->Miscellaneous
      if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','80') > 0)) {
          $this->enabled = false;
      }
      // disable for one master_categories_id for Featured Wines
      if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','99') > 0)) {
          $this->enabled = false;
      }

For me, flat and flathalf are each for one category only, so can I reverse this logic somehow so this tests for a category and enable the module?

I'm pretty good with php, but I am paranoid of breaking things on a live store!
Thanks so much! :cool:

13 Nov 2009, 2:45 PM
#169
ajeh avatar

ajeh

Oba-san

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

Re: Different shipping methods for different categories

To do this in more or less reverse logic ...

You could place above the IF statement:
$this->enabled = false;

Now the module is turned off ...

Then your IF statements when true, would have:
$this->enabled = true;

to trigger them on ...

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!

13 Nov 2009, 5:24 PM
#170
bassface avatar

bassface

New Zenner

Join Date:
Jan 2005
Location:
Aurora, CO USA
Posts:
71
Plugin Contributions:
1

Re: Different shipping methods for different categories

Thanks Ajeh! You're a peach! It's working perfectly and now I won't have to update those files every time a new category is added!

27 Nov 2009, 10:26 PM
#171
thebeveragegourmet avatar

thebeveragegourmet

Zen Follower

Join Date:
Nov 2006
Posts:
163
Plugin Contributions:
0

Re: Different shipping methods for different categories

Ajeh:

You have to edit the file:
/includes/modules/shipping/ups.php

and change the code ...

Let's say you do not want to allow UPS when products_id 15 is in the cart, change the code:

$this->types = array('1DM' => 'Next Day Air Early AM',
> ```
global $cart;
if (IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_id','15') > 0) {
  $this->enabled = false;
}
    $this->types = array('1DM' => 'Next Day Air Early AM',

So you would have to add the product_ID of each product correct? This solution would most likely work for me but I have around 200 products that cannot ship USPS. If I put 200 product_ID's in there, would that be the correct way to do it?
Would it look like this (where the $_SESSION line would just keep going with all hte ID's?):

    $this->types = array('1DM' => 'Next Day Air Early AM',
```to read:

global $cart;
if (IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_id','15','16','17','20') > 0) {
$this->enabled = false;
}
$this->types = array('1DM' => 'Next Day Air Early AM',


28 Nov 2009, 1:14 AM
#172
ajeh avatar

ajeh

Oba-san

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

Re: Different shipping methods for different categories

For you to do this based on so many products_id values, it would be better to add a new field to the products table for something like:
products_never_ups

Then you can test if 1 or more items in the cart is set as products_never_ups

and if there is 1 or more Products in the cart set as never being shipped by UPS, then you can then disable the UPS shipping module ...

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!

28 Nov 2009, 2:11 AM
#173
thebeveragegourmet avatar

thebeveragegourmet

Zen Follower

Join Date:
Nov 2006
Posts:
163
Plugin Contributions:
0

Re: Different shipping methods for different categories

Thanks. I'll have to try that.


28 Nov 2009, 2:14 AM
#174
ajeh avatar

ajeh

Oba-san

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

Re: Different shipping methods for different categories

Let us know how this works for you in adding a new field to control this ... :smile:

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!

30 Nov 2009, 8:48 PM
#175
dapottster avatar

dapottster

New Zenner

Join Date:
Jul 2009
Location:
Crystal Lake, IL
Posts:
50
Plugin Contributions:
0

Re: Different shipping methods for different categories

I'm having issues with this. When I "fixed" the problem using your first suggestion, it worked but admin got upset. When I scrolled down and used the fix to not upset the admin it didn't work. I don't upset admin anymore, but I also don't get rid of the options that I want to when my category is selected.
Thanks,
Matt

1 Dec 2009, 1:20 AM
#176
ajeh avatar

ajeh

Oba-san

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

Re: Different shipping methods for different categories

You really need to write more full and complete descriptions of what it is you are trying to do and exactly what you have already done ...

Pretend I have no clue what you need or what you are trying to do and type really, really slowly ... :smile:

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!

5 Dec 2009, 5:50 AM
#177
dapottster avatar

dapottster

New Zenner

Join Date:
Jul 2009
Location:
Crystal Lake, IL
Posts:
50
Plugin Contributions:
0

Re: Different shipping methods for different categories

I am trying to disable flat rate shipping when certain products are selected. I have two categories, both sub categories of 48, that have items that are too large for the flat rate shipping. I am using this code and it's not working:

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

  // disable for one master_categories_id 
  if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','48')) > 0) { 
      $this->enabled = false; 
  }  

When I tried your first suggestion on this thread, it worked but I had the problem with the admin. So when I tried this one, it got rid of the admin problem but also stopped taking flat rate off when a product from a sub category of 48 is selected.
Thanks,
Matt

5 Dec 2009, 3:49 PM
#178
ajeh avatar

ajeh

Oba-san

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

Re: Different shipping methods for different categories

Add above your IF test for the cart a line:
global $cart

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!

6 Dec 2009, 6:01 PM
#179
dapottster avatar

dapottster

New Zenner

Join Date:
Jul 2009
Location:
Crystal Lake, IL
Posts:
50
Plugin Contributions:
0

Re: Different shipping methods for different categories

Thanks, but from one of your other posts I realized that I was using a parent category and that is why it wasn't working.
Thanks for all your help, you're awesome!!!:clap::bigups:

6 Dec 2009, 7:33 PM
#180
ajeh avatar

ajeh

Oba-san

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

Re: Different shipping methods for different categories

Thanks for the update that the problem was just the wrong categories_id being tested for ... :smile:

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!