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 321 to 340 of 554
2 Mar 2011, 8:48 PM
#321
hornsales avatar

hornsales

New Zenner

Join Date:
Nov 2007
Posts:
54
Plugin Contributions:
0

Different shipping methods for different categories

Ok that worked fine

Thanks for the help again

2 Mar 2011, 8:50 PM
#322
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 ... thanks for the update that this worked for you ... :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!

9 Mar 2011, 10:01 PM
#323
hornsales avatar

hornsales

New Zenner

Join Date:
Nov 2007
Posts:
54
Plugin Contributions:
0

Re: Different shipping methods for different categories

Ok

I have run into a few obstacles. I run a drop shipping business. But some of my manyfacturer;s will not ship internationally. SO the products have to be sent to me first. And with most products the profit margin is big enough and the products are small enough that I am fine with eating the extra shipping. But on large oversized items, this is not working.

So what I want to do is in my shipping modules instead of using category I want to use the product id.

So Using the same method as Ajeh mentioned a few posts up, what do I change master_category_id to so I can input the product id number instead?

And can I mix the

  $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','10');

statements with both master_categories_id and product id

9 Mar 2011, 11:29 PM
#324
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 count your products in any manner that works for you ...

If not all can be done by master_categories_id then you can count them by individual products_id to get the total in the 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!

12 Mar 2011, 2:26 PM
#325
johnniejetski avatar

johnniejetski

New Zenner

Join Date:
Jan 2011
Posts:
66
Plugin Contributions:
0

Re: Different shipping methods for different categories

I asked this on another thread, so I hope I am not over posting, but this is very close to what I need to do. If I could just turn OFF flat rate shipping for one category, I could do what I need

17 Mar 2011, 2:28 PM
#326
hornsales avatar

hornsales

New Zenner

Join Date:
Nov 2007
Posts:
54
Plugin Contributions:
0

Re: Different shipping methods for different categories

Ajeh

I don't know what I did. but I believe it is not possible to use master_categories_id and products_id in the same if statement

When I do I get this

select master_categories__id as check_it from products where products_id

on my shopping cart page instead of the shipping estimator
regardless of what products are in the cart.

17 Mar 2011, 2:33 PM
#327
hornsales avatar

hornsales

New Zenner

Join Date:
Nov 2007
Posts:
54
Plugin Contributions:
0

Re: Different shipping methods for different categories

I just tried to make 2 separate if statements in the same module and that causes the same problem. So within a module you have to either do it by products_id or master_categories_id at least using the code we have on this thread.

17 Mar 2011, 3:28 PM
#328
hornsales avatar

hornsales

New Zenner

Join Date:
Nov 2007
Posts:
54
Plugin Contributions:
0

Re: Different shipping methods for different categories

Well I have it working now using two separate modules.

But another problem in my business just arose and I realized that this code will work for it

If you are a drop shipper like me you can create multiple clones of your shipping module and change the code for the zip code to a specific zip code.

So if you have some products coming from Florida you can make a shipping module that only activates for those products_id or master_categories_id and change this
SHIPPING_ORIGIN_ZIP

to the actual zip code of your warehouse in Florida.

You just have to make sure that the other modules do not activate for those products.

This code is extremely useful.

Unfortunately with all the products and suppliers I have etc I am going to wind up with 50 shipping modules.

17 Mar 2011, 6:25 PM
#329
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Different shipping methods for different categories

Pardon me if this is not the right thread, but this is the only I found that more or less provides the info I need, not quite though.

This is my predicament:
I use the USPS shipping module exclusively as we only ship via USPS. We only offer Express and Priority for domestic and international for 99% of our products (unregulated category), but 1 category of products have to be shipped separately via Parcel and can only be shipped within the US. So this means, if client buys products from unregulated category and products from regulated category 2 customer is charged with 2 quotes, as we would have to ship 2 different packages.

I've tried doing the first change for the item.php found at the beginning of the page, but I'm afraid it doesn't solve this since customer can only pick one or the other shipping method. I need customer to have Parcel mandatory if purchasing items from regulated category, and then be able to select any other shipping method but the unregulated categories. Does this make sense?

Thank you in advance for any help.

M.Valenti
Contemporary Artist - Entrepreneur
http://www.manuelavalenti.com - http://www.byvalenti.com

25 Mar 2011, 9:07 PM
#330
mvstudio avatar

mvstudio

Zen Follower

Join Date:
Apr 2008
Posts:
447
Plugin Contributions:
1

Re: Different shipping methods for different categories

I couldn't figure out the solution to my question, so I found another approach which seems to work, so I'm sharing it below.

My dilemma is I can't ship perfumes via airmail, only parcel post. Additionally they can't ship international only within the continental US. So I needed to stop showing Priority and Express mail instead only show Parcel Post.

This was my solution for the USPS module to show only parcel post when certain products in cart.

global $cart;
if (IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_id','114','116') > 0) {
  $this->enabled = true;
    $this->types = array('PARCEL' => 'Parcel Post');
        } else {

    $this->types = array('EXPRESS' => 'Express Mail',
        'FIRST CLASS' => 'First-Class Mail',
        'PRIORITY' => 'Priority Mail',
        'PARCEL' => 'Parcel Post',
        'MEDIA' => 'Media Mail',
        'BPM' => 'Bound Printed Matter',
        'LIBRARY' => 'Library'
        );
        }

To stop showing all international shipping options if alcohol products present in the shopping cart changed to this

global $cart;
if (IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_id','114','116') > 0) {
  $this->enabled = false;
  
  }
    $this->intl_types = array(

I tested it and it works. Hope this is useful to someone else. :smile:

M.Valenti
Contemporary Artist - Entrepreneur
http://www.manuelavalenti.com - http://www.byvalenti.com

31 Mar 2011, 7:15 PM
#331
pinkleopard avatar

pinkleopard

Zen Follower

Join Date:
Jun 2009
Posts:
383
Plugin Contributions:
0

Re: Different shipping methods for different categories

I would like to have master cat 62 & 76 set to flat rate of $3.00 and the rest set to a flat rate of $8.00.

I have cloned the flat rate BUT I am lost on how to implement it into my zen cart.

Right now I just have a flat rate of $8.00.

Please help:lookaroun

31 Mar 2011, 9:18 PM
#332
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 customize the Flat Rate shipping module that should not work for categories_id 62 and 76 with:

    // bof: disable for these master_categories_id
    if (IS_ADMIN_FLAG == false) {
      // check master_categories_id add one line per master_categories_id
      $chk_cat = 0;
      $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','62');
      $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','76');
      if ($chk_cat > 0) {
        $this->enabled = false;
      }
    }
    // eof: disable for these master_categories_id

Then for the one that should run for categories_id 62 and 76 with:

    // bof: disable for these master_categories_id
    if (IS_ADMIN_FLAG == false) {
      // check master_categories_id add one line per master_categories_id
      $chk_cat = 0;
      $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','62');
      $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','76');
      if ($chk_cat < 1) {
        $this->enabled = false;
      }
    }
    // eof: disable for these master_categories_id

What happens when you have Products from Categories 62, 76 and 48? :unsure:

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!

31 Mar 2011, 11:20 PM
#333
pinkleopard avatar

pinkleopard

Zen Follower

Join Date:
Jun 2009
Posts:
383
Plugin Contributions:
0

Re: Different shipping methods for different categories

Hi, Ms. A and thanks for the reply.

Here is what I am trying to do and this is what I have gathered here from searching on the forum.

My objective is to have two different flat rates.

One flat rate being $8.00 and the other flat rate being $3.00.

Master Cat 62 & 76 I would like to be $3.00. All others $8.00.

Here is what I have done so far.

I cloned flat.php and added these files to the below referenced directories. Every time I tried to add some code my whole shipping module is admin disappears.

/includes/modules/shipping/flat3.php
/includes/languages/english/modules/shipping/flat3.php

Then I tried adding code to flat.php but not sure which file directory? Or both?

/includes/modules/shipping/flat.php
/includes/languages/english/modules/shipping/flat.php

I need to tell flat.php not include Mast Cat 62 & 76. And I need to tell flat3.php only to include Mast Cat 62 & 76.

I am not sure which code to add to flat.php and which code to add to flat3.php.

And lastly...I have not tried to resolved "what if" they buy from both categories...

I need a little help from Ms. A if possible on coding.

Thank you for your time.:smile:

31 Mar 2011, 11:39 PM
#334
ajeh avatar

ajeh

Oba-san

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

Re: Different shipping methods for different categories

If you read my post ...

The first set of code is to NOT show if Products from 62 or 76 are in the cart ...

The second set of code is to NOT show if Products from 62 or 76 are NOT in the cart ...

So this means that the first piece of code would show that shipping module on a cart that has Products from 62 or 76 -- or -- either of those two categories and any other category at the same time ...

The code always go into the files in the code directory for:
/includes/modules/shipping

The language defines go in the:
/includes/languages/english/modules/shipping

You add the code right after the existing code for:

      // disable only when entire cart is free shipping
      if (zen_get_shipping_enabled($this->code)) {
        $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : 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!

1 Apr 2011, 3:23 AM
#335
pinkleopard avatar

pinkleopard

Zen Follower

Join Date:
Jun 2009
Posts:
383
Plugin Contributions:
0

Re: Different shipping methods for different categories

Hi thanks so much for your help. I have done what you said.

Both flat rates are showing up in the cart.

I will attached both files.

Can you take a moment to let me know what I have done wrong.

Thanks again for your help

1 Apr 2011, 3:25 AM
#336
pinkleopard avatar

pinkleopard

Zen Follower

Join Date:
Jun 2009
Posts:
383
Plugin Contributions:
0

Re: Different shipping methods for different categories

<?php /** * @package shippingMethod * @copyright Copyright 2003-2009 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 */ // $Id: flat.php 14498 2009-10-01 20:16:16Z ajeh $ // class flat { var $code, $title, $description, $icon, $enabled; // class constructor function flat() { global $order, $db; $this->code = 'flat'; $this->title = MODULE_SHIPPING_FLAT_TEXT_TITLE; $this->description = MODULE_SHIPPING_FLAT_TEXT_DESCRIPTION; $this->sort_order = MODULE_SHIPPING_FLAT_SORT_ORDER; $this->icon = ''; $this->tax_class = MODULE_SHIPPING_FLAT_TAX_CLASS; $this->tax_basis = MODULE_SHIPPING_FLAT_TAX_BASIS; // disable only when entire cart is free shipping if (zen_get_shipping_enabled($this->code)) { $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false); } if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) { $check_flag = false; $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FLAT_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 ($check_flag == false) { $this->enabled = false; } } } // class methods function quote($method = '') { global $order; $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FLAT_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_FLAT_TEXT_WAY, 'cost' => MODULE_SHIPPING_FLAT_COST))); if ($this->tax_class > 0) { $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); } if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title); return $this->quotes; } function check() { global $db; if (!isset($this->_check)) { $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_FLAT_STATUS'"); $this->_check = $check_query->RecordCount(); } return $this->_check; } function install() { global $db; $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Flat Shipping', 'MODULE_SHIPPING_FLAT_STATUS', 'True', 'Do you want to offer flat rate shipping?', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_FLAT_COST', '5.00', 'The shipping cost for all orders using this shipping method.', '6', '0', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_FLAT_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'zen_get_tax_class_title', 'zen_cfg_pull_down_tax_classes(', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Tax Basis', 'MODULE_SHIPPING_FLAT_TAX_BASIS', 'Shipping', 'On what basis is Shipping Tax calculated. Options are<br />Shipping - Based on customers Shipping Address<br />Billing Based on customers Billing address<br />Store - Based on Store address if Billing/Shipping Zone equals Store zone', '6', '0', 'zen_cfg_select_option(array(\'Shipping\', \'Billing\', \'Store\'), ', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_FLAT_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_FLAT_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())"); } function remove() { global $db; $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key like 'MODULE\_SHIPPING\_FLAT\_%'"); } function keys() { return array('MODULE_SHIPPING_FLAT_STATUS', 'MODULE_SHIPPING_FLAT_COST', 'MODULE_SHIPPING_FLAT_TAX_CLASS', 'MODULE_SHIPPING_FLAT_TAX_BASIS', 'MODULE_SHIPPING_FLAT_ZONE', 'MODULE_SHIPPING_FLAT_SORT_ORDER'); } } // bof: disable for these master_categories_id if (IS_ADMIN_FLAG == false) { // check master_categories_id add one line per master_categories_id $chk_cat = 0; $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','62'); $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','76'); if ($chk_cat > 0) { $this->enabled = false; } } // eof: disable for these master_categories_id ?>
1 Apr 2011, 3:26 AM
#337
pinkleopard avatar

pinkleopard

Zen Follower

Join Date:
Jun 2009
Posts:
383
Plugin Contributions:
0

Re: Different shipping methods for different categories

<?php // // +----------------------------------------------------------------------+ // |zen-cart Open Source E-commerce | // +----------------------------------------------------------------------+ // | Copyright (c) 2004 The zen-cart developers | // | | // | <http://www.zen-cart.com/index.php> | // | | // | Portions Copyright (c) 2003 osCommerce | // +----------------------------------------------------------------------+ // | This source file is subject to version 2.0 of the GPL license, | // | that is bundled with this package in the file LICENSE, and is | // | available through the world-wide-web at the following url: | // | <http://www.zen-cart.com/license/2_0.txt>. | // | If you did not receive a copy of the zen-cart license and are unable | // | to obtain it through the world-wide-web, please send a note to | // | [email protected] so we can mail you a copy immediately. | // +----------------------------------------------------------------------+ // $Id: flatClone.php 1969 2008-01-25 01:15:21p DWells $ // cloned from $Id: flat.php 1969 2005-09-13 06:57:21Z drbyte $ // class flatClone { var $code, $title, $description, $icon, $enabled; // class constructor function flatClone() { global $order, $db; $this->code = 'flatClone'; $this->title = MODULE_SHIPPING_FLATCLONE_TEXT_TITLE; $this->description = MODULE_SHIPPING_FLATCLONE_TEXT_DESCRIPTION; $this->sort_order = MODULE_SHIPPING_FLATCLONE_SORT_ORDER; $this->icon = ''; $this->tax_class = MODULE_SHIPPING_FLATCLONE_TAX_CLASS; $this->tax_basis = MODULE_SHIPPING_FLATCLONE_TAX_BASIS; // disable only when entire cart is free shipping if (zen_get_shipping_enabled($this->code)) { $this->enabled = ((MODULE_SHIPPING_FLATCLONE_STATUS == 'True') ? true : false); } if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLATCLONE_ZONE > 0) ) { $check_flag = false; $check = $db->Execute("select zone_id from " . TABLE_ZONES_TO_GEO_ZONES . " where geo_zone_id = '" . MODULE_SHIPPING_FLATCLONE_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 ($check_flag == false) { $this->enabled = false; } } } // class methods function quote($method = '') { global $order; $this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FLATCLONE_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_FLATCLONE_TEXT_WAY, 'cost' => MODULE_SHIPPING_FLATCLONE_COST))); if ($this->tax_class > 0) { $this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']); } if (zen_not_null($this->icon)) $this->quotes['icon'] = zen_image($this->icon, $this->title); return $this->quotes; } function check() { global $db; if (!isset($this->_check)) { $check_query = $db->Execute("select configuration_value from " . TABLE_CONFIGURATION . " where configuration_key = 'MODULE_SHIPPING_FLATCLONE_STATUS'"); $this->_check = $check_query->RecordCount(); } return $this->_check; } function install() { global $db; $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Enable Flat Shipping', 'MODULE_SHIPPING_FLATCLONE_STATUS', 'True', 'Do you want to offer flatClone rate shipping?', '6', '0', 'zen_cfg_select_option(array(\'True\', \'False\'), ', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Shipping Cost', 'MODULE_SHIPPING_FLATCLONE_COST', '5.00', 'The shipping cost for all orders using this shipping method.', '6', '0', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Tax Class', 'MODULE_SHIPPING_FLATCLONE_TAX_CLASS', '0', 'Use the following tax class on the shipping fee.', '6', '0', 'zen_get_tax_class_title', 'zen_cfg_pull_down_tax_classes(', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, set_function, date_added) values ('Tax Basis', 'MODULE_SHIPPING_FLATCLONE_TAX_BASIS', 'Shipping', 'On what basis is Shipping Tax calculated. Options are<br />Shipping - Based on customers Shipping Address<br />Billing Based on customers Billing address<br />Store - Based on Store address if Billing/Shipping Zone equals Store zone', '6', '0', 'zen_cfg_select_option(array(\'Shipping\', \'Billing\', \'Store\'), ', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, use_function, set_function, date_added) values ('Shipping Zone', 'MODULE_SHIPPING_FLATCLONE_ZONE', '0', 'If a zone is selected, only enable this shipping method for that zone.', '6', '0', 'zen_get_zone_class_title', 'zen_cfg_pull_down_zone_classes(', now())"); $db->Execute("insert into " . TABLE_CONFIGURATION . " (configuration_title, configuration_key, configuration_value, configuration_description, configuration_group_id, sort_order, date_added) values ('Sort Order', 'MODULE_SHIPPING_FLATCLONE_SORT_ORDER', '0', 'Sort order of display.', '6', '0', now())"); } function remove() { global $db; $db->Execute("delete from " . TABLE_CONFIGURATION . " where configuration_key in ('" . implode("', '", $this->keys()) . "')"); } function keys() { return array('MODULE_SHIPPING_FLATCLONE_STATUS', 'MODULE_SHIPPING_FLATCLONE_COST', 'MODULE_SHIPPING_FLATCLONE_TAX_CLASS', 'MODULE_SHIPPING_FLATCLONE_TAX_BASIS', 'MODULE_SHIPPING_FLATCLONE_ZONE', 'MODULE_SHIPPING_FLATCLONE_SORT_ORDER'); } } // bof: disable for these master_categories_id if (IS_ADMIN_FLAG == false) { // check master_categories_id add one line per master_categories_id $chk_cat = 0; $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','62'); $chk_cat += $_SESSION['cart']->in_cart_check('master_categories_id','76'); if ($chk_cat < 1) { $this->enabled = false; } } // eof: disable for these master_categories_id ?>
1 Apr 2011, 3:47 AM
#338
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 stuck the new code in the bottom of the files where it does nothing ... :eek:

Place it under the code:

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

and in the clone code under the code:

// disable only when entire cart is free shipping
if (zen_get_shipping_enabled($this->code)) {
  $this->enabled = ((MODULE_SHIPPING_FLATCLONE_STATUS == 'True') ? true : 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!

1 Apr 2011, 4:20 AM
#339
pinkleopard avatar

pinkleopard

Zen Follower

Join Date:
Jun 2009
Posts:
383
Plugin Contributions:
0

Re: Different shipping methods for different categories

You are amazing and after I went through learning how to do this...it was not that painful. I just did not know where to add the code. And I tried a zillion times over.

Do you mind if I add it to the free downloads?

And trust me...I will donate. I feel confident I will get some sales now because I think my shipping was too high.

Thanks again.

1 Apr 2011, 1:20 PM
#340
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 that it is worth being an add on as there are so many different methods and a zillion are already posted on the Free Forums ...

Glad you have this working now ... :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!