- Posts: 9
- Thank you received: 0
Apply a discount and free shipping with a coupon
Question: Is there a simple hack to apply a discount when a coupon code is used? I need a coupon to discount each item from $46 to $40 (every item has the same price thus far.) not just a flat rate or percentage of the total sale.
Also, I found a post about free shipping with a coupon but have not been able to make the following hack work, it breaks the whole page. (not a PHP whiz) I don't suppose you could help in giving a sample of how the code would integrate into the existing view to work? I am messing up the syntax somewhere.
In the For Each loop for $rate, I wrote an IF statement:
if (!$this->coupon->discount_code == "Wanderlust2012" && $rate->shipping_name == "Free Shipping Promo"){
//do nothing, this skips the free shipping radio button if coupon code is not valid
}
else
{
// show the remaining shipping methods
Thank you!
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Can you show me exactly what is in your "For Each loop for $rate" ?
Please Log in or Create an account to join the conversation.
Thank you! Quick response!
Please Log in or Create an account to join the conversation.
After the line:
foreach($this->rates as $rate){
just add that line:
if ($this->coupon->discount_code != "Wanderlust2012" && $rate->shipping_name == "Free Shipping Promo") continue;
Note that it requires that the coupon and the shipping views are on the same step of the checkout workflow.
Please Log in or Create an account to join the conversation.
Can the something similar be done to apply a discount with a coupon code - making the discount apply ONLY if a coupon code is entered? If so, I can start a new thread.
Your support is great... REDSHOP takes DAYS to get back to you. I am sold on Hikashop!
Please Log in or Create an account to join the conversation.
It's not impossible but it would require proper development.
Please Log in or Create an account to join the conversation.
Thank you, great component great support. I will recommend HS!
Thanks, Nicolas!
Please Log in or Create an account to join the conversation.
I don't see a case where you would have to use a coupon+discount system like you want instead of just a coupon.
Please Log in or Create an account to join the conversation.
- Posts: 218
- Thank you received: 6
Please Log in or Create an account to join the conversation.
- Posts: 12953
- Thank you received: 1778
Please Log in or Create an account to join the conversation.