Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Jan 2014
    Posts
    18
    Plugin Contributions
    0

    Default Shipping combined categories - I am confused

    I have a category "category 4" that needs to be flat rate shipping.

    all the other categories are normal USPS shipping.

    Here is my issue,

    if they have multiple items in their cart, from the "category 4" and items from the other categories, it show the flat rate option.

    I need "flat rate" not to show up if their cart has items from other categories.

    I am new to the Zen Cart - and by no means am I a php person.

    any help would be appreciated.

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

    Default Re: Shipping combined categories - I am confused

    You have me confused ...

    You say:

    Quote Originally Posted by mhollibush View Post
    if they have multiple items in their cart, from the "category 4" and items from the other categories, it show the flat rate option.

    I need "flat rate" not to show up if their cart has items from other categories.
    So, please define what you want for:
    1 ALL products are from categories_id 4

    2 NO products are from categories_id 4

    3 Some products are from categories_id 4 and some products are from other categories_id other than 4
    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. #3
    Join Date
    Jan 2014
    Posts
    18
    Plugin Contributions
    0

    Default Re: Shipping combined categories - I am confused

    Quote Originally Posted by Ajeh View Post
    You have me confused ...

    You say:



    So, please define what you want for:
    1 ALL products are from categories_id 4

    2 NO products are from categories_id 4

    3 Some products are from categories_id 4 and some products are from other categories_id other than 4
    here is how I need it -
    ALL products from categories_id 4 are FLAT RATE
    ALL other categories normal shipping rates apply ( USPS )

    If a cart contains items from catergories_id 4 and items from ANY OTHER categories, then FLAT RATE is not an option and normal shipping rates apply..

    Does that make sense?

  4. #4
    Join Date
    Jan 2014
    Posts
    18
    Plugin Contributions
    0

    Default Re: Shipping combined categories - I am confused

    Quote Originally Posted by Ajeh View Post
    You have me confused ...

    You say:



    So, please define what you want for:
    1 ALL products are from categories_id 4

    2 NO products are from categories_id 4

    3 Some products are from categories_id 4 and some products are from other categories_id other than 4
    ALL products are from categories_id 4 = FLAT RATE SHIPPING

    NO products are from categories_id 4 = NORMAL SHIPPING

    Some products are from categories_id 4 and some products are from other categories_id other than 4 = NORMAL SHIPPING ( NO FLAT RATE OPTION )

    Hope that helps

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

    Default Re: Shipping combined categories - I am confused

    To manage the shipping so that you only see Flat Rate when all Products are from categories_id 4 and when a mixed cart or no products are from categories_id 4 show USPS you can use the code in RED:
    /includes/modules/flat.php

    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);
          }
    
    // bof: only show shipping if all products in the cart are from category 4
    $chk_cat = $_SESSION['cart']->in_cart_check('master_categories_id','4');
    if ($chk_cat != $_SESSION['cart']->count_contents()) {
      $this->enabled = false;
    }
    // eof: only show shipping if all products in the cart are from category 4
    
          if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {
    and in the USPS module use the code in RED:
    Code:
        // disable only when entire cart is free shipping
        if (zen_get_shipping_enabled($this->code) == FALSE) $this->enabled = FALSE;
    
    // bof: only show shipping if all products in the cart are not from category 4
    $chk_cat = $_SESSION['cart']->in_cart_check('master_categories_id','4');
    if ($chk_cat == $_SESSION['cart']->count_contents()) {
      $this->enabled = false;
    }
    // eof: only show shipping if all products in the cart are not from category 4
    
        if ($this->enabled == 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!

  6. #6
    Join Date
    Jan 2014
    Posts
    18
    Plugin Contributions
    0

    Default Re: Shipping combined categories - I am confused

    inserted new code as described...

    When I go to the admin area and click on shipping in the modules, I get a blank page?

    Not able to configure or edit any shipping modules

    I really appreciate you trying to help me -

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

    Default Re: Shipping combined categories - I am confused

    Silly me, I forgot to put in the safeties for the Admin ... add an IF around each section of the new code for:
    Code:
    if (!IS_ADMIN_FLAG) {
    // new code here
    }
    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. #8
    Join Date
    Jan 2014
    Posts
    18
    Plugin Contributions
    0

    Default Re: Shipping combined categories - I am confused

    Quote Originally Posted by Ajeh View Post
    Silly me, I forgot to put in the safeties for the Admin ... add an IF around each section of the new code for:
    Code:
    if (!IS_ADMIN_FLAG) {
    // new code here
    }
    Did as described - still get a blank page?

    HERE IS HOW I HAVE IT:
    flat.php
    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);
          }
    if (!IS_ADMIN_FLAG) {
    // new code here
    // bof: only show shipping if all products in the cart are from category 4
    $chk_cat = $_SESSION['cart']->in_cart_check('master_categories_id','4');
    if ($chk_cat != $_SESSION['cart']->count_contents()) {
      $this->enabled = false;
    }
    // eof: only show shipping if all products in the cart are from category 4
    usps.php
    Code:
        // disable only when entire cart is free shipping
        if (zen_get_shipping_enabled($this->code) == FALSE) $this->enabled = FALSE;
    if (!IS_ADMIN_FLAG) {
    // new code here
    // bof: only show shipping if all products in the cart are not from category 4
    $chk_cat = $_SESSION['cart']->in_cart_check('master_categories_id','4');
    if ($chk_cat == $_SESSION['cart']->count_contents()) {
      $this->enabled = false;
    }
    // eof: only show shipping if all products in the cart are not from category 4

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

    Default Re: Shipping combined categories - I am confused

    You did not do the code right ...

    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);
          }
    
    // bof: only show shipping if all products in the cart are from category 4
    if (!IS_ADMIN_FLAG) {
      $chk_cat = $_SESSION['cart']->in_cart_check('master_categories_id','4');
      if ($chk_cat != $_SESSION['cart']->count_contents()) {
        $this->enabled = false;
      }
    }
    // eof: only show shipping if all products in the cart are from category 4
    
          if ( ($this->enabled == true) && ((int)MODULE_SHIPPING_FLAT_ZONE > 0) ) {
    Code:
        // disable only when entire cart is free shipping
        if (zen_get_shipping_enabled($this->code) == FALSE) $this->enabled = FALSE;
    
    // bof: only show shipping if all products in the cart are not from category 4
    if (!IS_ADMIN_FLAG) {
      $chk_cat = $_SESSION['cart']->in_cart_check('master_categories_id','4');
      if ($chk_cat == $_SESSION['cart']->count_contents()) {
        $this->enabled = false;
      }
    }
    // eof: only show shipping if all products in the cart are not from category 4
    
        if ($this->enabled == 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!

  10. #10
    Join Date
    Jan 2014
    Posts
    18
    Plugin Contributions
    0

    Default Re: Shipping combined categories - I am confused


    Like I stated, I am no php person....

    Thank you very much - got it working....

    You are the greatest - donation to zen cart coming

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v151 Combined Shipping
    By GabyWalker in forum Built-in Shipping and Payment Modules
    Replies: 11
    Last Post: 27 Feb 2014, 07:33 PM
  2. Combined Shipping?
    By neurasthenia in forum Built-in Shipping and Payment Modules
    Replies: 1
    Last Post: 22 Nov 2010, 05:08 PM
  3. combined shipping
    By rbonja in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 16 Jun 2008, 06:52 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