Results 1 to 10 of 24

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Re: exclude products from free shipping

    The thumb twiddling has begun!

    The only thing I could think to do was to put a simple if/else statement around that chunk of code so it wouldn't calculate those items towards free ship if a certain qty of each was in the cart, but that still doesn't solve the 20 + 20 issue...

  2. #2
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Re: exclude products from free shipping

    I thought I had it figured out....

    I created functions/extra_functions/reduce_free_shipping.php
    Code:
    <?php
    // calculate amount not to be used for Products 144, 443, 148, 473 if all items in cart are from category 93
      function reduce_free_shipping() {
        global $cart;
        $how_many_items = $_SESSION['cart']->count_contents();
    	$how_many_oils = $_SESSION['cart']->in_cart_check('master_categories_id', '93');
    	if ($how_many_items == $how_many_oils) {  
    	$exclude_products = "144, 443, 148, 473";
        $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;
        }
      }
    ?>
    and added to freeoptions.php:
    Code:
    if (($_SESSION['cart']->show_total() - reduce_free_shipping()) >= MODULE_SHIPPING_FREEOPTIONS_TOTAL_MIN
    Nothing happened!?!?!

    Thumb twiddling continues!

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

    Default Re: exclude products from free shipping

    So your new function is only saying to do this when the number of Products in the cart is the same quantity as the Products in Category 93:
    Code:
        if ($how_many_items == $how_many_oils) {
    Is that what you really mean?

    Or do you mean, always do this and based on whether or not Products in the cart are any of the Products in Category 93, then do the test to reduce the total should any of those Products be in the 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!

  4. #4
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Re: exclude products from free shipping

    That is what I mean to do. All of the oils are in cat 93. I don't want the customer to be able to get free shipping on just oils.
    I sell the oils as an add item at a low price for the customers convenience, if they order just oil I end up loosing money by the time I pay the shipping.
    If the customer orders a bunch of other stuff and then adds one or two of the oils I still want that to count towards free shipping.

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

    Default Re: exclude products from free shipping

    Okay so I have Free Shipping Options set with Total >= 350.00 ...

    I add to the cart a $300.00 worth of Products NOT is cat 93 ... then another $100.00 worth of Products from cat 93 ... do I get Free Shipping on my $400.00 order?

    I add to the cart a $325.00 worth of Products NOT is cat 93 ... then another $100.00 worth of Products from cat 93 ... do I get Free Shipping on my $425.00 order?

    I add to the cart a $340.00 worth of Products NOT is cat 93 ... then another $100.00 worth of Products from cat 93 ... do I get Free Shipping on my $440.00 order?

    I add to the cart a $340.00 worth of Products NOT is cat 93 ... then another $25.00 worth of Products from cat 93 ... do I get Free Shipping on my $365.00 order?

    I add to the cart a $350.00 worth of Products NOT is cat 93 ... then another $100.00 worth of Products from cat 93 ... do I get Free Shipping on my $450.00 order?
    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
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Re: exclude products from free shipping

    Yes - free shipping on all examples.
    Only when cat 93 makes up 100% of cart is freeoptions to be off.

  7. #7
    Join Date
    Aug 2010
    Location
    Hartland, MI
    Posts
    303
    Plugin Contributions
    3

    Default Re: exclude products from free shipping

    I see where your going....
    I was over complicating this to the "N"th degree!!!
    I should be able to just add to the freeoptions.php:

    Code:
    // disable only when entire cart is free shipping
          if (zen_get_shipping_enabled($this->code)) {
              $this->enabled = ((MODULE_SHIPPING_FREEOPTIONS_STATUS == 'True') ? true : false);
           }      
     //check if entire cart is oils
    		$how_many_items = $_SESSION['cart']->count_contents();
    		$how_many_oils = $_SESSION['cart']->in_cart_check('categories_id', '93');
    	
    		if ($how_many_items == $how_many_oils) {
    			$this->enabled = false;
    			}
    right?

 

 

Similar Threads

  1. exclude a few products from one shipping service
    By Princess in forum General Questions
    Replies: 3
    Last Post: 3 Nov 2012, 03:41 PM
  2. v139h Exclude FREE SHIPPING on Two Items
    By kstew923 in forum Built-in Shipping and Payment Modules
    Replies: 16
    Last Post: 6 Mar 2012, 11:34 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 a product or category from Free Shipping freeoptions
    By gotlogos in forum Built-in Shipping and Payment Modules
    Replies: 18
    Last Post: 14 Feb 2012, 01:05 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

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