Page 1 of 2 12 LastLast
Results 1 to 10 of 13
  1. #1
    Join Date
    May 2010
    Posts
    222
    Plugin Contributions
    0

    Default Flat rate shipping only for certain products

    Forgive me if this has been asked before. I was unsure what exactly to search for.

    Let us say I sell shirts and pants. If a customer orders less than four shirts, I would like to give them a flat shipping rate. If a customer orders less than three shirts and a pair of pants, I would also like to give them a flat shipping rate. If a customer orders anything else, they can choose between my normal shipping options.

    Is there a way to set that up?

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

    Default Re: Flat rate shipping only for certain products

    What in the products table identifies Pants?

    What identifies Shirts?

    What are you "normal" shipping options?
    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
    May 2010
    Posts
    222
    Plugin Contributions
    0

    Default Re: Flat rate shipping only for certain products

    What do you mean by "products table"? My normal shipping options are USPS First Class and Priority Mail. If certain products fit in flat rate boxes, I would like to give the customers that option.

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

    Default Re: Flat rate shipping only for certain products

    You would have to identify the number of shirts and pants in the order to know what shipping module to offer ...

    To do this, you have to be able to identify how many shirts and pants are in the order ...

    Is there some way to identify the Shirts and Pants such as the master_categories_id in the products table?
    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
    May 2010
    Posts
    222
    Plugin Contributions
    0

    Default Re: Flat rate shipping only for certain products

    I am totally lost. Does this require a bunch of custom coding?

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

    Default Re: Flat rate shipping only for certain products

    This would require some custom code to manage whish shipping modules show based on the content of the cart ...

    If you are able to identify the Products in the Shopping Cart by their Master Category ID (master_catetgories_id) you can count how many are in the cart with:
    // shirts in master_categories_id 10, 12, 15
    $chk_shirts = 0;
    $chk_shirts += $_SESSION['cart']->in_cart_check('master_categories_id','10');
    $chk_shirts += $_SESSION['cart']->in_cart_check('master_categories_id','12');
    $chk_shirts += $_SESSION['cart']->in_cart_check('master_categories_id','15');

    // pants in master_categories_id 2, 4, 9
    $chk_pants = 0;
    $chk_pants += $_SESSION['cart']->in_cart_check('master_categories_id','2');
    $chk_pants += $_SESSION['cart']->in_cart_check('master_categories_id','4');
    $chk_pants += $_SESSION['cart']->in_cart_check('master_categories_id','9');

    Then you can tell how many shirts and pants are in the cart ...

    Based on this, you could control whether you use the Flat Rate flat shipping module or your regular USPS for the shipping ...
    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. #7
    Join Date
    May 2010
    Posts
    222
    Plugin Contributions
    0

    Default Re: Flat rate shipping only for certain products

    So let us say I want to offer the Flat Rate shipping module to any customer who orders less than four of the soaps in this category or less than four of the soaps in this category. Would my coding look like the following?

    // hand and body soap in products_id 80, 79, 81
    $chk_hand_and_body_soap = 0;
    $chk_hand_and_body_soap += $_SESSION['cart']->in_cart_check('products_id','80');
    $chk_hand_and_body_soap += $_SESSION['cart']->in_cart_check('products_id','79');
    $chk_hand_and_body_soap += $_SESSION['cart']->in_cart_check('products_id','81');

    // shampoo bars in products_id 73, 74
    $chk_shampoo_bars = 0;
    $chk_shampoo_bars += $_SESSION['cart']->in_cart_check('master_categories_id','73');
    $chk_shampoo_bars += $_SESSION['cart']->in_cart_check('master_categories_id','74');

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

    Default Re: Flat rate shipping only for certain products

    Now you can use the results to control the $this->enabled in the shipping modules to manage which is enabled or disabled ...

    What happens if they order 3 soaps in the first set and 7 soaps in the second set of soaps?
    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. #9
    Join Date
    May 2010
    Posts
    222
    Plugin Contributions
    0

    Default Re: Flat rate shipping only for certain products

    Quote Originally Posted by Ajeh View Post
    What happens if they order 3 soaps in the first set and 7 soaps in the second set of soaps?
    Oh, that would be a problem. Is there a way to make it so they can order any combination, but it has to be less than four?

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

    Default Re: Flat rate shipping only for certain products

    Add the two calculations together and use the results to manage your code ...
    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 1 of 2 12 LastLast

Similar Threads

  1. Shopping Cart: loop through products to turn off Flat Rate shipping for certain prods
    By bobcnj in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 30 Aug 2011, 02:38 PM
  2. Shipping only costs under certain value flat rate
    By Muzz in forum Built-in Shipping and Payment Modules
    Replies: 10
    Last Post: 26 Oct 2009, 04:48 AM
  3. Certain items flat rate only
    By Childproof in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 28 Mar 2009, 02:42 PM
  4. USPS and Disabling Flat Rate for Certain Products
    By accension in forum Built-in Shipping and Payment Modules
    Replies: 0
    Last Post: 27 Mar 2008, 08:12 PM
  5. Flat rate, then another flat rate for certain heavy products?
    By JohneeMac in forum Built-in Shipping and Payment Modules
    Replies: 3
    Last Post: 27 Mar 2007, 07:37 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