Free shipping and 50% off two or more products

marketing_guymarketing_guy Member
in Help edited February 2013
Another shipping question. Client wants to have free shipping when two or more bottles of product are purchased. As well, this is to kick in a 50% off all subsequent bottles of sauce. So two bottles at $6 each for example = $12 but free shipping. Three bottles at $6 each equals $15 and free shipping. Six bottles = $24 and free shipping, etc.

Out of my "design and CSS" skill set. Any pointers? Thanks!

http://www.chameleonchilisauce.com/
Comments
  • fc_adamfc_adam FoxyCart Team
    @marketing_guy,

    The free shipping for 2 or more bottles would be a javascript set up on your checkout, and as you're using live rates, you'd use the live rates modification snippet from here: http://wiki.foxycart.com/snippets/start - you could either set an existing rate to free, or conditionally display the 'free shipping' custom shipping option depending on the number of bottles in the cart.

    The discounting for bottles would be a discount - either at the product or category level. If you need to order two or more of the same bottle for the discount to kick in, you'll need to add it at the product level - but if it's two or more of any bottle, go for the category.

    In terms of the actual discount string, you'd want "incremental|3-50" of the type "discount by percentage based on the quantity. At the product level, in a form, that would look like this:
    <input type="hidden" name="discount_quantity_percentage" value="Bulk Discount{incremental|3-50}" />
    
  • Thanks.

    So on the snippet, where do I find the javascript info to insert into that? That is, what do I replace
    fc_json.total_price
    
    with...assuming that IS what I replace.

    Very novice on doing these customizations.
  • fc_adamfc_adam FoxyCart Team
    @marketing_guy,

    So you are wanting to give free shipping for 2 more bottles - do you only sell bottles (so it could just be if the total products is 2 or more) or do you sell other products and only two bottle products or more gets free shipping?
  • That's correct. It's just bottles of sauce. There are three flavors, each set up as their own product.

    I thought maybe changing it to fc_json.product_count > 2 but that didn't work.

    Also tried quantity with no result. The free shipping option was there even if I just put one bottle in the cart.
  • fc_adamfc_adam FoxyCart Team
    So yeah, if it's just bottles, you should be fine to do the conditional based on fc_json.product_count.

    So what I'd do is something like this:
    if (fc_json.product_count == 1) {
      FC.customLiveShipping.remove("free");
    }
    

    That basically says if only one product is present, then remove any products with "free" in the label.
  • @fc_adam

    I appreciate all your help but I'm not getting it to work. Below is what I put into the checkout template, just before the </head>
    <script type="text/javascript" charset="utf-8" >
    var myCustomShipping = function() {
      if (fc_json.product_count == 1) {
        FC.customLiveShipping.remove("free");
      }
    }
     
    jQuery(document).ready(function() {
      jQuery("#fc_shipping_methods_inner").ajaxComplete(function(event, request, settings) {
        myCustomShipping();
      });
    });
    </script>
    

    The Free Ground Shipping still came up along with the usual live rate.
  • fc_adamfc_adam FoxyCart Team
    @marketing_guy,

    Sorry - I should have been clearer in my last post - that logic needs to be included with the live rates shipping modification snippet I discussed earlier, which is available from http://wiki.foxycart.com/snippets/start - you'll include that last bit of code I posted as the custom logic in that snippet.
  • @fc_adam

    No, you were perfectly clear! I just missed it in the reply you made previously and was putting in the wrong code snippet. That works just fine. I also see there are additional instructions down there. I was messing around to see if I could get the USPS priority mail to be removed on 2 or more bottles, but it seemed to persist. It works to show both. I just changed the autoselect to true.

    Thanks again. You guys are great!
  • fc_adamfc_adam FoxyCart Team
    @marketing_guy,

    If you do want to remove the priority mail option - that would look like this:
    if (fc_json.product_count == 1) {
      FC.customLiveShipping.remove("free");
    } else if (fc_json.product_count > 1) {
      FC.customLiveShipping.remove("priority");
    }
    

    Although, one way to look at it is that if the customer wants to pay for quick shipping, they'll have that option. However if your free shipping is the same as priority shipping, it might make sense to remove it...
Sign In or Register to comment.