Free shipping with Coupon Code

  • Posts: 57
  • Thank you received: 0
12 years 7 months ago #52055

Hello, how can I provide users with free shipping when they enter a coupon code?

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
12 years 7 months ago #52065

Hello,

Like it's said in this thread :

I don't see any easy way to do that. That's an interesting feature. We'll add that to the todo list.


You can't add a coupon for free shipping but you can just make a discount of the total amount of the order.

Please Log in or Create an account to join the conversation.

  • Posts: 57
  • Thank you received: 0
12 years 7 months ago #52070

The thing is, with UPS, there will be different shipping prices per zipcode/weight? Meaning there is not way of knowing exactly how much to discount in shipping.

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
12 years 7 months ago #52072

You can do it with a plugin, but for now you can't know exactly how much the shipping will cost and allow users to use the coupon just if they have choosen a shipping method.

Please Log in or Create an account to join the conversation.

  • Posts: 57
  • Thank you received: 0
12 years 7 months ago #52077

not sure I understood.
I can do what, with a plugin?

Please Log in or Create an account to join the conversation.

  • Posts: 57
  • Thank you received: 0
12 years 7 months ago #52082

What if I modify the cart code, so that if it finds a coupon code, then it will make the "free shipping" method available, if the coupon is not valid or found, then it will hide the "free shipping" method?

Please Log in or Create an account to join the conversation.

  • Posts: 12953
  • Thank you received: 1778
12 years 7 months ago #52083

I said that it was only possible with a plugin so if you don't know a bit of hikashop code and that you're not a developpper you'll not be able to develop such a plugin.

Please Log in or Create an account to join the conversation.

  • Posts: 57
  • Thank you received: 0
12 years 7 months ago #52088

Thanks for your response.
Now I am simply trying to just add a coupon but I keep getting:
"The coupon you entered is not valid"
Any suggestions?

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 57
  • Thank you received: 0
12 years 7 months ago #52095

Any ideas sir?

Please Log in or Create an account to join the conversation.

  • Posts: 57
  • Thank you received: 0
12 years 7 months ago #52096

There must be a bug in the coupon/discount, I was contacted and notified that the price on all the products had been changed in the store (even without applying coupon). One real order was placed at this discount price. Can you help me with this, on why the discount was applied to all the products without having to even enter a coupon. I disabled/unpublised the coupon and now all the products have correct price.

Last edit: 12 years 7 months ago by rockstaran.

Please Log in or Create an account to join the conversation.

  • Posts: 83050
  • Thank you received: 13409
  • MODERATOR
12 years 7 months ago #52180

You added a discount, not a coupon. Discounts apply directly to the price of products while coupons apply to the cart total after the coupon code has been entered.
Just change the type to "coupon" and it will work as a coupon, not as a discount.

Please Log in or Create an account to join the conversation.

  • Posts: 57
  • Thank you received: 0
12 years 7 months ago #52199

Thank you, that worked.

Please Log in or Create an account to join the conversation.

  • Posts: 57
  • Thank you received: 0
12 years 7 months ago #52200

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.

Please Log in or Create an account to join the conversation.

  • Posts: 57
  • Thank you received: 0
12 years 7 months ago #52211

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.

Please Log in or Create an account to join the conversation.

  • Posts: 83050
  • Thank you received: 13409
  • MODERATOR
12 years 7 months ago #52401

No, that's great.

Please Log in or Create an account to join the conversation.

  • Posts: 57
  • Thank you received: 0
12 years 7 months ago #53500

Thank you,
It is working great, we have had a few sales go through using the coupon.

The only thing that I would like to modify is the checkout text, it shows the discount amount for the coupon which in this case is .01

Is there a way to not display that in the checkout, but still apply the coupon in the backend?

Please Log in or Create an account to join the conversation.

  • Posts: 83050
  • Thank you received: 13409
  • MODERATOR
12 years 6 months ago #53576

You can edit the file "cart" of the view "checkout" via the menu Display->Views if you want to remove the display of the coupon.

Please Log in or Create an account to join the conversation.

  • Posts: 57
  • Thank you received: 0
12 years 6 months ago #53603

Thank you, i will try that.
Also
Is there a limit as to how many decimal places I can put for the value of discount amount? I want the coupon to be activated but have minimal affect on price, so i was thinking of putting .0001

Please Log in or Create an account to join the conversation.

  • Posts: 83050
  • Thank you received: 13409
  • MODERATOR
12 years 6 months ago #53693

If you're entering a flat fee, you can go down to 0.00001 I think. For a percentage value, you won't be able to go below 0.01.

Please Log in or Create an account to join the conversation.

  • Posts: 9
  • Thank you received: 0
12 years 5 months ago #58721

Hey rockstaran,

I am having the same issue, I need a coupon for free shipping. I cannot get your hack to work, it breaks the whole page! Can you give me the entire checkout/shipping view code so I can see where I am making my syntax mistake?

Much appreciated if you can help!

Thanks!

Please Log in or Create an account to join the conversation.

Time to create page: 0.078 seconds
Powered by Kunena Forum