Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1
    Join Date
    Nov 2010
    Posts
    84
    Plugin Contributions
    0

    Default exclude a product or category from Free Shipping freeoptions

    I am wanting to simply be able to flag a category, in my specific case, gift cards, from being included in the cart total when determining if the customer gets free shipping or not.

    I offer free shipping when the cart total goes over $57. Problem is a few people have figured out that when they add a gift card to their cart to make the total over 57.00, it triggers the free shipping.

    I read a thread trying to glean some info on how to do this but the solutions they seemed to be looking for were much more complicated than what I need and felt there MUST be an easy way to do this. I simply want to eliminate a category from figuring in the total to determine if they get free shipping.

    Any help would be appreciated.

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

    Default Re: exclude a product or category from Free Shipping freeoptions

    You would need to adjust all the references to:
    $_SESSION['cart']->show_total()

    by the amount of Products that you do not allow to be counted ...

    Are all of the Gift Certificates in the same Category and use the same master_categories_id on them?
    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!

  3. #3
    Join Date
    Nov 2010
    Posts
    84
    Plugin Contributions
    0

    Default Re: exclude a product or category from Free Shipping freeoptions

    Thanks Ajeh--yes they are all in same dedicated master category---actually I only use one product and I use attributes and price by attributes...


    Quote Originally Posted by Ajeh View Post
    You would need to adjust all the references to:
    $_SESSION['cart']->show_total()

    by the amount of Products that you do not allow to be counted ...

    Are all of the Gift Certificates in the same Category and use the same master_categories_id on them?

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

    Default Re: exclude a product or category from Free Shipping freeoptions

    This takes a little work ...

    Let's say we do not want to have products_id 47 and 32 included in the price check when the Free Shipping in the Modules ... Order Totals ... Shipping ot_shipping is set to 50.00 and enabled ...

    First, create a new file:
    /includes/functions/extra_functions/reduce_free_shipping.php

    and add the code:
    Code:
    <?php
    // calculate amount not to be used for Products 186 and 10 for free shipping
      function reduce_free_shipping() {
        global $cart;
        $exclude_products = "47, 32";
        $products = $_SESSION['cart']->get_products();
        $chk_price = 0;
        for ($i=0, $n=sizeof($products); $i<$n; $i++) {
          if (in_array((int)$products[$i]['id'], explode(",", $exclude_products))) {
            $chk_price += $products[$i]['final_price'] * $products[$i]['quantity'];
          }
        } // end FOR loop
    
        return $chk_price;
      }
    ?>
    Next, we have to customize a few files:
    /includes/modules/shipping_estimator.php

    and use your templates and overrides for:
    /includes/modules/your_template_dir/shipping_estimator.php

    and change around line 158:
    Code:
        if ( ($pass == true) && ($_SESSION['cart']->show_total() - reduce_free_shipping() >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER)) {
    Then we have to adjust the headers for the checkout_shipping, checkout_payment and checkout_confirmation ...

    Change the code around line 121:
    /includes/modules/pages/checkout_shipping/header_php.php

    Code:
        if ( ($pass == true) && ($_SESSION['cart']->show_total() - reduce_free_shipping() >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
    Change the code around line 36:
    /includes/modules/pages/checkout_payment/header_php.php

    Code:
    if (isset($_SESSION['shipping']['id']) && $_SESSION['shipping']['id'] == 'free_free' && defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER') && $_SESSION['cart']->show_total() - reduce_free_shipping() < MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) {
    Change the code around line 43:
    /includes/modules/pages/checkout_confirmation/header_php.php

    Code:
    if (isset($_SESSION['shipping']['id']) && $_SESSION['shipping']['id'] == 'free_free' && defined('MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER') && $_SESSION['cart']->show_total() - reduce_free_shipping() < MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) {
    Then, what I think is the final change around line 34:
    /includes/modules/order_total/ot_shipping.php

    Code:
            if ( ($pass == true) && ( (($order->info['total'] - reduce_free_shipping()) - $order->info['shipping_cost']) >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) ) {
    Now, if the Order Total, less the amount of the Products with products_id 47 and 32, is >= 50.00, as set in the Shipping ot_shipping, the shipping will be Free ...

    Easy smeazy, eh?

    That only took all morning ...
    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!

  5. #5
    Join Date
    Nov 2010
    Posts
    84
    Plugin Contributions
    0

    Default Re: exclude a product or category from Free Shipping freeoptions

    I have never been so humbled in a long long time...I don't even know what to say but thanks...I will be making a donation to the Zen Cart project whether I can get this going or not...having a little trouble after doing all this and double/triple checking. Sent you a PM about it.

    But either way many thanks.

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

    Default Re: exclude a product or category from Free Shipping freeoptions

    Looking at your site it appears that you are using the Free Shipping Options freeoptions shipping module ... this is not being used for the code that I posted ...

    This is setup for the Modules ... Order Total ... Shipping ot_shipping ...

    Set the Free Orders for over to 57.00 and set the Enable to True ...

    Does this fix things?
    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!

  7. #7
    Join Date
    Nov 2010
    Posts
    84
    Plugin Contributions
    0

    Default Re: exclude a product or category from Free Shipping freeoptions

    Works famously : ) Thank you...

    Is there any way I can still see other shipping modules on this though...now it only shows free shipping but I'd like to be able to let them choose my flat rate which is set up for Priority at 5.00 and also to upgrade to Express if they want that?

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

    Default Re: exclude a product or category from Free Shipping freeoptions

    Then we have to do it a totally different way ...

    Let me give this a little thought ...
    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!

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

    Default Re: exclude a product or category from Free Shipping freeoptions

    First, let's undo some code changes ...

    Remove the changes from the files ...

    Around line 158, remove the change:
    /includes/modules/your_template_dir/shipping_estimator.php

    Around line 121, remove the change:
    /includes/modules/pages/checkout_shipping/header_php.php

    Around line 36, remove the change:
    /includes/modules/pages/checkout_payment/header_php.php

    Around line 43, remove the change:
    /includes/modules/pages/checkout_confirmation/header_php.php

    Around line 34, remove the change:
    /includes/modules/order_total/ot_shipping.php

    Now, edit the file:
    /includes/modules/shipping/freeoptions.php

    and around line 93 change to:
    Code:
                if (($_SESSION['cart']->show_total() - reduce_free_shipping()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN) {
    Go to Modules ... Shipping ... and install the Free Shipping Options freeoptions and set the Total >= 57.00 ...

    Now, you will see all of your Shipping methods and only see the Free Shipping Options freeoptions when the Order, less anything excluded, is set >= $57.00 ...
    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!

  10. #10
    Join Date
    Sep 2011
    Posts
    19
    Plugin Contributions
    0

    Default Re: exclude a product or category from Free Shipping freeoptions

    Hi there,

    I was wondering if there is a way to exclude an entire category from free shipping? I offer free shipping for products totaling over $100, but would like to charge shipping for 1 or 2 categories no matter how much they order. Is that possible?

    Thank you,

    Tom

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. v139h exclude products from free shipping
    By mikestaps in forum General Questions
    Replies: 23
    Last Post: 15 Aug 2013, 11:14 PM
  2. v139h Exclude category or product from group discount
    By abcisme in forum Discounts/Coupons, Gift Certificates, Newsletters, Ads
    Replies: 0
    Last Post: 10 Aug 2012, 02:51 PM
  3. v139h exclude non continental united states zones from free shipping.
    By gloerick in forum Built-in Shipping and Payment Modules
    Replies: 103
    Last Post: 6 Mar 2012, 02:25 AM
  4. Exclude one category from shipping allow by 0 in stock
    By mdo82 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 26 Feb 2011, 09:56 AM
  5. exclude certain products from free shipping
    By emtecmedia in forum Built-in Shipping and Payment Modules
    Replies: 24
    Last Post: 28 Sep 2010, 05:15 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