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 221 to 240 of 554
26 Mar 2010, 3:38 AM
#221
pamcc avatar

pamcc

New Zenner

Join Date:
Aug 2009
Posts:
16
Plugin Contributions:
0

Different shipping methods for different categories

Okay. Thank you for your reply. I appreciate it.

I will probably settle with Per Unit for now until I get this to work.

This will be one bloody programming/customization

But thanks for your reply!

Will be back for some more questions, as I work on this :smile:

3 Apr 2010, 3:33 AM
#222
lindasdd avatar

lindasdd

Zen Follower

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

Re: Different shipping methods for different categories

Ajeh,
I've previously set up my shipping to turn off certain types based on model using the below code. Now I'd like to adjust it to turn off all shipping based on both a model and a zone. If I can get the basic code I can adjust it to work in the appropriate shipping files.

I've played around with the code, but can't get it to work since it isn't really a "check in cart items" thing, but rather possibly a SQL pull.

Any ideas?

Thanks for your help,
Lindasdd

Current code:
if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_model','frozen') > 0)) {
$this->enabled = false;
}

3 Apr 2010, 3:56 AM
#223
ajeh avatar

ajeh

Oba-san

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

Re: Different shipping methods for different categories

What shipping module are you customizing?

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!

3 Apr 2010, 1:48 PM
#224
lindasdd avatar

lindasdd

Zen Follower

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

Re: Different shipping methods for different categories

Right now I have customized the Fedex Ground module, but I'm sorta revamping the whole thing(USPS and Fedex Ground):

  • if a product with a certain model is chosen AND the shipping address is outside of a certain zone - no shipping options are available. Otherwise, both USPS and Fedex Ground are available

-lindasdd

P.S. If we can get this to work I'm due for more than a couple coffee cup donations to the fund.

3 Apr 2010, 2:07 PM
#225
ajeh avatar

ajeh

Oba-san

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

Re: Different shipping methods for different categories

Create a valid Zone for the shipping and add it to the shipping module ...

Then, put your test for the model under that zone ... but, only run the test if $this->enabled is true ... as it will only be true if the shipping address passed the zone test ...

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!

3 Apr 2010, 3:56 PM
#226
lindasdd avatar

lindasdd

Zen Follower

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

Re: Different shipping methods for different categories

Unless I'm misreading I don't think that is the end goal I am looking for. I think you may be forgetting this part, "Otherwise, both USPS and Fedex Ground are available."

Maybe the solution I was shooting for is too simple, but I figured that similar to how the code currently looks up whether the in cart items are a certain model I would be able to look up whether the shipping address is within a certain zone.

Maybe I need to just fiddle with the zone lookup that is in the file and try to duplicate/modify it to fit.

3 Apr 2010, 4:31 PM
#227
ajeh avatar

ajeh

Oba-san

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

Re: Different shipping methods for different categories

So the zone only counts based on the model ...

Then, you need to test your model first ...

Then, test the zone ...

If the model is true, but the zone is false ... $this->enabled needs to be false ...

If the model is false ... then don't test the zone and set $this->enabled to true ...

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!

3 Apr 2010, 5:27 PM
#228
lindasdd avatar

lindasdd

Zen Follower

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

Re: Different shipping methods for different categories

Correct!

The part I can't get though is "Then, test the zone ..."

I can't figure out the correct code to use to test the zone.

3 Apr 2010, 6:34 PM
#229
ajeh avatar

ajeh

Oba-san

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

Re: Different shipping methods for different categories

Build the zone for who can NOT have frozen ...

Add to USPS ...

Then change the code for:

    if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_USPS_ZONE > 0) ) {
      $check_flag = false;
      $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_USPS_ZONE . "' and zone_country_id = '" . $order->delivery['country']['id'] . "' order by zone_id");
      while (!$check->EOF) {
        if ($check->fields['zone_id'] < 1) {
          $check_flag = true;
          break;
        } elseif ($check->fields['zone_id'] == $order->delivery['zone_id']) {
          $check_flag = true;
          break;
        }
        $check->MoveNext();
      }

// if not in zone set for valid $check_flag to allow checkout
        if ($check_flag != true) {
          $check_flag = true;
        } else {
// if in zone check for products_model
          if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_model','frozen') > 0)) {
            $check_flag = false;
          }
        }

      if ($check_flag == false) {
        $this->enabled = false;
      }

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!

4 Apr 2010, 6:36 AM
#230
lindasdd avatar

lindasdd

Zen Follower

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

Re: Different shipping methods for different categories

Genius.

I fiddled and got it to work.

Thanks for your help.....again.

4 Apr 2010, 2:13 PM
#231
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 you were able to get things working with this ...

Doing the reverse on the zone was the fun part ... but only when the conditions were right ... :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!

11 Apr 2010, 12:56 AM
#232
jacon1965 avatar

jacon1965

New Zenner

Join Date:
Feb 2008
Posts:
32
Plugin Contributions:
0

Re: Different shipping methods for different categories

Can i use class tax id instead of master categories id to disable a shipping module

11 Apr 2010, 1:24 AM
#233
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 can use anything to control the modules ... you just have to be able to test for the content that you want to find ...

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!

11 Apr 2010, 1:40 AM
#234
jacon1965 avatar

jacon1965

New Zenner

Join Date:
Feb 2008
Posts:
32
Plugin Contributions:
0

Re: Different shipping methods for different categories

well i'm not vey good with php. how would i possibly do this? thanks for your quick response

11 Apr 2010, 1:51 AM
#235
ajeh avatar

ajeh

Oba-san

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

Re: Different shipping methods for different categories

I don't know what you are trying to do with the tax class to control a shipping module ... can you be more specific?

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!

11 Apr 2010, 2:03 AM
#236
jacon1965 avatar

jacon1965

New Zenner

Join Date:
Feb 2008
Posts:
32
Plugin Contributions:
0

Re: Different shipping methods for different categories

// 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','17') > 0)) { 
      $this->enabled = false; 
  }  

I would like to do something like this above, but i can't seem to call up the class tax id like you have with the categories. this way i can make my own class tax for each different type of shipping method. Kinda like an earlier post about using the sort number to differentiate which shipping module to show at check out. does that make sense? thanks again

11 Apr 2010, 3:23 AM
#237
ajeh avatar

ajeh

Oba-san

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

Re: Different shipping methods for different categories

The $_SESSION['cart']->in_cart_check will check what is in the products table ...

I am not sure if you are trying to test the products_tax_class_id or something else ...

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!

11 Apr 2010, 3:08 PM
#238
jacon1965 avatar

jacon1965

New Zenner

Join Date:
Feb 2008
Posts:
32
Plugin Contributions:
0

Re: Different shipping methods for different categories

yes. that is the field I wanted to test. Thank you. I've set up my tax classes to reflect what shipping module I will use at check out. I have five different shipping modules i use-free ship, ups, fedex, state zone, and multi zone. Most customers usually only order one type of product at a time, so this work great right now. Now, I have to tackle the problem of ordering products with different shipping methods. Thanks a million times over!,I have been working on this problem for a long time

11 Apr 2010, 3:11 PM
#239
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 are most welcome ... glad that this was able to help you out ... :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!

20 Jun 2010, 10:04 PM
#240
aly22 avatar

aly22

Zen Follower

Join Date:
Feb 2008
Posts:
174
Plugin Contributions:
0

Re: Different shipping methods for different categories

I'm reading this entire thread and just a bit overwhelmed so apologies if the answer to my question already exists.

Just changed my client's store over to use table rate shipping based on total sale price. That's all good BUT she has one category offering a "product of the month" club, allowing purchase of 3, 6, 9 or 12 months of items to be shipped -- and costing more for shipping than the regular table rate calculations.

So I am assuming that I need to set up a separate table rate module for this item of the month club -- Category ID is 51 -- that only turns up in checkout if item from category 51 is added to cart?

Unfortunately though that would mean that other items added to cart would end up being over-charged on total shipping simply because Category 51 ship rates are incurred.

Is there an alternative to this? I think ideally she should build the shipping into the item price and call it free shipping (sigh)