Guest Posted May 5, 2006 Posted May 5, 2006 Hi! I have a shop that I am currently building and I am having some problems trying to work out how to give the customer free shipping if they order 3 or more of the same product. i.e. 3 x Red yoyos = Free Shipping BUT 1 x Yellow Yoyo 1 x Pink Yoyo 1 x Black Yoyo = Charged for shipping. Is there something that I can do to allow this. Thanks, Owain. Quote
Guest Posted May 20, 2006 Posted May 20, 2006 are these colors in your example product attributes? or separate products? Either case you edit your shipping module function quote. And you retrieve the products from the cart. $products = $cart->get_products(); for( $i=0, $n=sizeof($products); $i<$n; $i++) { if($products[$i]['qty'] >= 3) { // flag free shipping for this item and recalculate cost. } } further down when it assigns the $cost variable to the shipping method you could subtract the items that should have free shipping. And make the $cart object global in the quote function. Quote
Guest Posted May 25, 2006 Posted May 25, 2006 are these colors in your example product attributes? or separate products? Either case you edit your shipping module function quote. And you retrieve the products from the cart. $products = $cart->get_products(); for( $i=0, $n=sizeof($products); $i<$n; $i++) { if($products[$i]['qty'] >= 3) { // flag free shipping for this item and recalculate cost. } } further down when it assigns the $cost variable to the shipping method you could subtract the items that should have free shipping. And make the $cart object global in the quote function. My actual example is bags of dog food. I want to give free shipping to anyone that orders 3 bags of dog food, doesnt matter what make or size. Owain. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.