The Foxy forums are on the move!

We're in the process of moving our forums over to a new system, and so these forums are now read-only.
If you have a question about your store in the meantime, please don't hesitate to reach out to us via email.

Free shipping for 5 or more items

BillDABillDA Member
in Help edited August 2011
Hey guys, I'm trying to implement free shipping for all orders with 5 or more items (regardless if it's all the same product code or not). I can't figure out a way to do this with the built in discounting, so I've got the below Javascript on the checkout template, though it doesn't seem to work. Can you help me out? We are using live shipping rates with USPS.
function fc_UpdateShipping() {
	var quantities = document.getElementById( "fc_cart_table" ).getElementsByTagName( "td" );
	var totalQuantities = 0;
	for ( var n = 0; n < quantities.length; n++ ) {
		if ( quantities[n].className == "fc_cart_item_quantity" )
		totalQuantities += parseInt( quantities[n].firstChild.data );
	}
	if ( totalQuantities >= 5 ) {
		$('#shipping_cost').val('0.00');
		$('#fc_cart_foot_shipping').html('$0.00');
		$('#shipping_note').html('Free Shipping - 5 or more items.');
	}
}

$(document).ready(function(){
	$('#li_subtotal_shipping_cost').after('<span id="shipping_note"><\/span>');
	fc_UpdateShipping();
});
Comments
  • fc_adamfc_adam FoxyCart Team
    @BillDA,

    I'd suggest giving the following a go instead of what you have above.

    1) In your shipping settings in the FoxyCart administration, enable free shipping (Under Shipping > CUSTOM OPTIONS > custom domestic services > free ground shipping)

    2) Paste the following before the closing
    </head>
    
    tag in your checkout template: http://pastie.org/2306895

    3) In the languages section of the administration, under 'Checkout' look for 'free ground shipping', and edit the string for that entry to be what you want shown to your customers (like 'Free Shipping - 5 or more items' as in the example you posted above).
  • brettbrett FoxyCart Team
    @BillDA, did that work out for you? Let us know. We're here to help.
  • Hey guys - I tried the above (see the store at http://underfitshirts.com/temp) and I'm not seeing the shipping charge zero out with more than 5 items. Can you see what I'm doing wrong?

    Bill
  • Rather, I'd actually like to use a flat rate shipping of $5.95 (which I have setup in the default category). Doesn't seem to be working with the solution above...
  • fc_adamfc_adam FoxyCart Team
    Ah ok - so to confirm - you're not using live rates anymore, but flat rate - or you'd like the 'free shipping' to actually be a flat rate of 5.95 as opposed to whatever the returned rates are?
  • BillDABillDA Member
    edited August 2011
    Sorry, I can see how that got confusing. What I'd like to do is have free shipping on all orders with more than 5 items, and $5.95 shipping on all smaller orders.

    Bill
  • fc_adamfc_adam FoxyCart Team
    @Bill, give this post a look - specifically the second code block at the end of that post - http://forum.foxycart.com/comments.php?DiscussionID=2880&page=1#Item_10
Sign In or Register to comment.