Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16
  1. #11
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: "additional items ship free" is this possible?

    You would need to test then, in the Flat Rate flat shipping module to see if the cart only holds products from Category A and B ...

    To customize the Flat Rate file add the code to:
    /includes/modules/shipping/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 run Flat Rate if all Products in the cart are from categories_id 10 and 15
          if (!IS_ADMIN_FLAG) {
            global $cart;
            $chk_categories_a = $_SESSION['cart']->in_cart_check('master_categories_id', '10');
            $chk_categories_b = $_SESSION['cart']->in_cart_check('master_categories_id', '15');
            if ($chk_categories_a + $chk_categories_b != $_SESSION['cart']->count_contents()) {
              $this->enabled = false;
            }
          }
    // eof: only run Flat Rate if all Products in the cart are from categories_id 10 and 15
    
    Now for you, customize the categories_id of 10 and 15 to your categories_id for Category A and Category B

    Next, for your USPS shipping module, you would use the same code that is in red, but change the categories_id that are being tested to those for Category C and Category D ...

    NOTE: while we are wanting to test Products in Category A and B etc. we are using the master_categories_id as that is the categories_id that these Products belong to ... the master_categories_id makes it easier as it is in the products table and there is a handy function to this type of test in the shopping_cart class ...
    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: v1.5.5]
    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!

  2. #12
    Join Date
    Aug 2010
    Location
    Illinois
    Posts
    33
    Plugin Contributions
    0

    Default Re: "additional items ship free" is this possible?

    Why can I not take the above code and simply plug in categories_id 1 and 2 wherever the code says 10 & 15? Is there a signifigance to 10 & 15?

    Also, is there a way to change the Catregory ID at will from the Admin or do I have to create 15 generic categories and then go back and rename 10 & 15?

    I hope that all makes sense.

    Also, am I going in and making changes to the actual module? If it doesn't work is there a way to re-install or set to default?

    Thanks
    Last edited by Battlefront Games; 22 Aug 2010 at 06:32 PM.

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

    Default Re: "additional items ship free" is this possible?

    You should be able to do that ...

    Make sure the file on the server for:
    /includes/modules/shipping/flat.php

    is being updated correctly ...

    As to managing this via the Admin, you can always write the code to use constants that you store in the configuration table so that they could be customized via the Admin ...
    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: v1.5.5]
    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!

  4. #14
    Join Date
    Aug 2010
    Location
    Illinois
    Posts
    33
    Plugin Contributions
    0

    Default Re: "additional items ship free" is this possible?

    Ajeh, you are the best. Whatever "Oba-san" means...you're it brother.

    I'll post again with any other related issues and results.

    Thanks!

  5. #15
    Join Date
    Aug 2010
    Location
    Illinois
    Posts
    33
    Plugin Contributions
    0

    Default Re: "additional items ship free" is this possible?

    Hey Ajeh-

    So I am currently trying to insert the code you supplied but I am scratching my head a little as to wether I am ADDING this code or REPLACING code.

    Also, especially in the USPS module, can you please give a refernece point as to where this code should be inserted/replaced?

    Thanks.

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

    Default Re: "additional items ship free" is this possible?

    Look for the same code but where it says FLAT you will see USPS ...

    Example, this line in Flat Rate flat shipping module:
    Code:
            $this->enabled = ((MODULE_SHIPPING_FLAT_STATUS == 'True') ? true : false);
    would read in USPS shipping module as:
    Code:
            $this->enabled = ((MODULE_SHIPPING_USPS_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: v1.5.5]
    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 2 of 2 FirstFirst 12

Similar Threads

  1. v154 Is It Possible To Remove "Add This To My Cart" For Just Some Items
    By DK_Scully in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 13 Jan 2016, 11:52 PM
  2. v150 "Always free shipping" becomes "not possible"
    By kalastaja in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 8 Mar 2013, 08:00 PM
  3. Replies: 6
    Last Post: 22 May 2010, 08:13 PM
  4. Suddenly get "Sorry, we are not shipping to your region at this time" on free items?
    By sweetikins in forum Built-in Shipping and Payment Modules
    Replies: 15
    Last Post: 24 Oct 2009, 04:41 PM
  5. Replies: 7
    Last Post: 28 Mar 2008, 05:42 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR