Page 12 of 56 FirstFirst ... 2101112131422 ... LastLast
Results 111 to 120 of 552
  1. #111
    Join Date
    Apr 2009
    Posts
    18
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    I have read this thread through for several days and I am still unable to hide a shipping method.

    I have two shipping methods, zone and item.

    I checked in the products table and one of the items I wanted to only display item shipping had a master id of 6. I change it as below edited the item.php file.

    // disable for one master_categories_id
    if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','6') > 0)) {
    // show UPS
    $this->enabled = true;
    } else {
    // hide UPS
    $this->enabled = false;
    }
    Then I changed the zones.php to
    // disable for one master_categories_id
    if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','6') > 0)) {
    // show
    $this->enabled = false;
    } else {
    // hide
    $this->enabled = true;
    }
    I switched the true and false in the last two statement. I even made them all false but nothing I do makes either of the shipping methods disappear.

    In Products, I then edited the products_model to be 'book' (which is really what I want to do) and tried this code
    // disable for one products_model
    if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_model','book') > 0)) {
    // hide

    $this->enabled = false;
    } else {
    // show
    $this->enabled = true;
    }
    Still no luck. Can someone (Linda?) show me the error of my ways?
    Here's my store's url. It is not live yet. Thanks!

  2. #112
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Different shipping methods for different categories

    Did you add the line:
    Code:
    global $cart;
    Just above the IF statement?
    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. #113
    Join Date
    Apr 2009
    Posts
    18
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    Thanks for the quick reply but I guess I put it in the wrong place because I did this in the zones.php file

    define('MODULE_SHIPPING_ZONES_TEXT_TITLE', 'Zone Rates');
    define('MODULE_SHIPPING_ZONES_TEXT_DESCRIPTION', 'Zone Based Rates');
    define('MODULE_SHIPPING_ZONES_TEXT_WAY', 'Shipping to');
    define('MODULE_SHIPPING_ZONES_TEXT_UNITS', ' grams');
    define('MODULE_SHIPPING_ZONES_INVALID_ZONE', 'No shipping available');
    define('MODULE_SHIPPING_ZONES_UNDEFINED_RATE', 'The shipping rate cannot be determined at this time');
    // disable for one master_categories_id
    global $cart;
    if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('master_categories_id','6') > 0)) {
    // show UPS
    $this->enabled = false;
    } else {
    // hide UPS
    $this->enabled = true;
    }
    ?>
    And now I see this error text in my cart
    PS $this->enabled = false; } ?> PS $this->enabled = true; } ?>
    Obviously I put that statement in wrong place to get this syntax error. Can you take a look and tell me where I went wrong?

  4. #114
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Different shipping methods for different categories

    It looks like you stuck the new code in the bottom of the language file and not in the shipping code module ...

    There are two files:
    /includes/modules/shipping/zones.php
    /includes/languages/english/modules/shipping/zones.php

    You need to be customizing the file:
    /includes/modules/shipping/zones.php
    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. #115
    Join Date
    Apr 2009
    Posts
    18
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    Geez, I knew I was missing something. Yea. It works for selecting on products_model 'book'. thank you thank you thank you.

    Now one more questions... please. In this thread, people have mentioned cloning shipping methods. I need to clone the zone shipping methods. Can you tell me exactly which files I need to copy and rename?

    Thanks again. You are a life saver.

    For those just checking in, here's my code for zones.php which hides zones when the product model is book.

    // disable for one products_model is books
    global $db;
    if ((IS_ADMIN_FLAG == false && $_SESSION['cart']->in_cart_check('products_model','book') > 0)) {
    // hide

    $this->enabled = false;
    } else {
    // show
    $this->enabled = true;
    }

  6. #116
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Different shipping methods for different categories

    Cloning Zone Rate zones shipping module can be tricky ...

    But if you look at this thread, you should find the code for it:
    http://www.zen-cart.com/forum/showth...ght=clone+zone
    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!

  7. #117
    Join Date
    Sep 2009
    Posts
    1
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    I know this is an older post, but it is relevant to me. Instead of just one master category, I want it to apply to several. How could I modify the code for that?

  8. #118
    Join Date
    Apr 2009
    Posts
    18
    Plugin Contributions
    0

    Default Re: Different shipping methods for different categories

    I got the this code to work by putting 'book" in the model and using that code that I posted a couple of days ago. So if you can use the model field in the product info, that should work. My main problem is now that my code works too well. I would really like it to just show item shipping when ALL the items are books. I am not a php programmer but I put this code together. The logic being that if the number of items in the cart are equal to the number of books in the cart then show item shipping. Here's my code. It does NOT work but maybe someone can show me how to fix it.
    // disable when products_model is not all books this goes in item
    global $db;
    if (($total_count - $_SESSION['cart']->count_contents('products_model','book') = 0)) {
    // show
    $this->enabled = true;
    } else {
    // hide
    $this->enabled = false;
    }

  9. #119
    Join Date
    Jul 2009
    Posts
    234
    Plugin Contributions
    1

    Default Re: Different shipping methods for different categories

    Hi all, i have been trying to implement the code from page 1 into my table rate php file, but with no luck....it just doesnt seem to make any difference

    Here is a little bit of info about what i am trying to achieve.....for ease lets say i have 2 categories, each with x amount of products in.

    Category 1 is chairs, and needs 2 shipping options, 48hr delivery at £15 and 24hr delivery at £30. But if you buy 2 you get it for cost of one delivery rate ( hence why i chose table rate shipping)

    Category 2 is stools, and needs 2 shipping options, 48hr delivery at £10 and 24hr delivery at £20. And once again if you buy 2 you get it for cost of one delivery rate


    I decided that probably best way would be to duplicate the table shipping rate 3 extra times, and then only show 2 that is needed per category.

    Sadly i cant seem to get the code from page one to work correctly ( i did change the category id to be my id, and changed it from ITEM to TABLE)

    Where should this code be placed, and does it overwrite any other code?

    Any help would be greatly appreciated!!

    Thanks in advance

    Scott

  10. #120
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: Different shipping methods for different categories

    Quote Originally Posted by christmascoralfarm View Post
    I know this is an older post, but it is relevant to me. Instead of just one master category, I want it to apply to several. How could I modify the code for that?
    You can use multiple IF statements one for each of the categories ...
    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!

 

 
Page 12 of 56 FirstFirst ... 2101112131422 ... LastLast

Similar Threads

  1. Re: Different shipping methods for different categories
    By kaddie in forum Built-in Shipping and Payment Modules
    Replies: 14
    Last Post: 19 Nov 2010, 04:37 AM
  2. Replies: 2
    Last Post: 27 Oct 2010, 01:45 PM
  3. Different shipping methods for different categories and mixed categories
    By neit in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 10 Aug 2010, 12:20 AM
  4. Separate Shipping Methods for Different Categories
    By MortalWombat in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 28 Jul 2010, 08:57 AM
  5. Different shipping methods for different product types?
    By talisman-studios in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 17 Sep 2008, 04:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg