Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Jul 2011
    Posts
    21
    Plugin Contributions
    0

    Default Shipping based on Product type?

    I am new to zen cart but have set up a shop ( which seems to be working ok )

    I just want to set up shipping based on product types if possible?

    Basically I have 2 product types,

    Product type 1 ( which requires flat rate priority shipping )

    Product type 2 ( which is standard economy shipping )

    Is there any way to set something like this up?

    I have installed a clone of the flat rate shipping which now shows the 2 shipping options but any way I can make these so that "product type 1" can only use the priority shipping ?

    Sorry if this isn't very clear, any more information needed, please ask.

    Regards

    Jake

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

    Default Re: Shipping based on Product type?

    What happens when Products from both Product Types are in the shopping 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!

  3. #3
    Join Date
    Jul 2011
    Posts
    21
    Plugin Contributions
    0

    Default Re: Shipping based on Product type?

    Those products will hopefully be combined and use a third flat rate shipping amount which will be the cost of the Priority shipping and a little extra ( to cover any extra weight )

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

    Default Re: Shipping based on Product type?

    These will check for what the products_type are in the cart ...

    Let's assume you are testing for products_type 1 and 2 ...

    Type 1 only in cart:
    Code:
    // bof: check products type for products_type 1 only
          if (!IS_ADMIN_FLAG) {
            global $cart;
    
            $chk_products_in_cart_type1 = 0;
            $chk_products_in_cart_type1 = $_SESSION['cart']->in_cart_check('products_type', '1');
            $full_count = $_SESSION['cart']->count_contents();
    
            if ($chk_products_in_cart_type1 > 0 && $full_count == $chk_products_in_cart_type1) {
              $this->enabled = true;
            } else {
              $this->enabled = false;
            }
          }
    // eof: check products type for products_type 1 only
    Type 2 only in cart:
    Code:
    // bof: check products type for products_type 2 only
          if (!IS_ADMIN_FLAG) {
            global $cart;
    
            $chk_products_in_cart_type2 = 0;
            $chk_products_in_cart_type2 = $_SESSION['cart']->in_cart_check('products_type', '2');
            $full_count = $_SESSION['cart']->count_contents();
    
            if ($chk_products_in_cart_type2 > 0 && $full_count == $chk_products_in_cart_type1) {
              $this->enabled = true;
            } else {
              $this->enabled = false;
            }
          }
    // eof: check products type for products_type 2 only
    Type 1 and 2 in the cart:
    Code:
    // bof: check products type for products_type 1 and products_type 2
          if (!IS_ADMIN_FLAG) {
            global $cart;
    
            $chk_products_in_cart_type1 = 0;
            $chk_products_in_cart_type2 = 0;
            $chk_products_in_cart_type1 = $_SESSION['cart']->in_cart_check('products_type', '1');
            $chk_products_in_cart_type2 = $_SESSION['cart']->in_cart_check('products_type', '2');
            $full_count = $_SESSION['cart']->count_contents();
    
            if ($chk_products_in_cart_type1 > 0 && $chk_products_in_cart_type2 > 0 ) {
              $this->enabled = true;
            } else {
              $this->enabled = false;
            }
          }
    // eof: check products type for products_type 1 and products_type 2
    To use them, let's say you were customizing flat.php, you would place the piece of code you need under the code:
    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);
          }
    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. #5
    Join Date
    Jul 2011
    Posts
    21
    Plugin Contributions
    0

    Default Re: Shipping based on Product type?

    Thanks very much for that Ajeh,

    Just one quick Q,

    Will I need to add another flat rate shipping module for both types of product in the basket?

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

    Default Re: Shipping based on Product type?

    You should have 3 ... 1 for each of the separate Product type and 1 for the combined Product Types ...
    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!

 

 

Similar Threads

  1. two "per item" shipping rates based on type of product
    By karine in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 27 Sep 2012, 11:26 PM
  2. Show shipping method based on product type
    By gpgoud in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 22 Sep 2009, 03:43 AM
  3. shipping cost based on product type?
    By shopper1 in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 19 Jul 2006, 07:14 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