rockstaran wrote: Currently I have free shipping as an option when users are checking out (in addition to two UPS options).
I have an idea in using a coupon to provide free shipping.
By default, I can disable the radio button for Free shipping (dynamically via php).
I can create a coupon with 0% or .01% discount and give it a code.
When the user enters this coupon code, the radio button for free shipping will become available (I can check the array or variable that holds the value of coupons and depending if the code was valid or not, i will show the free shipping radio button).
Now my only issue is, what file should I look at that contains the shipping options? also what are the variables available that tell me if a coupon has been added (an array? variable?). Once I know that I think I can do this.
I figured it out!
views\checkout\tmpl\shipping.php
In the For Each loop for $rate, I wrote an IF statement:
if (!$this->coupon->discount_code == "1234" && $rate->shipping_name == "Free Shipping"){
//do nothing, this skips the free shipping radio button if coupon code is not valid
}
else
{
// show the remaining shipping methods
The only thing I have to make sure is that I always title Free Shipping as the manual shipping of $0, and I also set the coupon to .01% so it does not have an affect on price.
It works, let me know if there's a cleaner way you can recommend of me doing this, or any negative side effects of me doing this.