Coupon Paramethers

  • Posts: 198
  • Thank you received: 5
  • Hikashop Business
3 days 14 hours ago #366347

This is an email I received from a client that is using the Pro version of Hikashop.
At the moment I don't have access to his website, but I figured this is a question that can be answered anyway without seeing the specific website.

"I made a coupon for 10% off purchase price, then put a purchase limit of $100. Then I went in and put items in my shopping cart totaling $129.00. When I then attempted to check out, and entered the coupon, rather than give me $10.00 off of the first $100 of the $129.00, it returned a message that I couldn't use the coupon for a purchase of over $100.00.
So my question is, can the coupon be configured so that, it will give the percentage off - up to the limit we put on - and then make the charge? In other words, why didn't it simply give me $10.00 off of the $129.00 purchase, rather than just telling me that I can't make that purchase? There must be a way to make it give the 10% off on the limit, but still allow a purchase that exceeds the limit?"


Naturally, I told them that the best option is to NOT limit the coupon., but I promised I'd place it here in the forum to see if there is an alternate solution.

Thank you.

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

  • Posts: 83488
  • Thank you received: 13510
  • MODERATOR
3 days 4 hours ago #366348

Hi,

The way the amount of a coupon is calculated is this:
- restrictions not on the amount and quantity are applied to see if a coupon can be used. If not, the coupon is discarded
- if a coupon is limited to only some products or some categories, then only these products will be taken into account
- the total amount and quantity of the products taken into account is calculated ( for example, if I have 10 products in the cart, but the coupon is restricted to only 5 products, the total amount and quantity is calculated on these 5 products )
- then, the restrictions on the amount and quantity are applied based on the total calculated in the previous step. If not, the coupon is discarded
- the percentage is applied on the total calculated to get the amount of the coupon

Why is it like that ? Well, historically, there was no "max amount" / "max quantity" restrictions on coupons, only minimums. The goal was to motivate users to purchase more on the shop. And so, below the minimums, the coupon would not be accepted. So, when we added the maximum settings, it was logical that they work the same way as the minimums, and above the maximums, the coupon would not be accepted.
So that's the reason why it's like that at the moment.

Is there a way to make it work like you want with the options available ? Not really.

Could it be done ? Sure.

First, you have the cart fees plugin:
www.hikashop.com/marketplace/product/279-cart-fee.html
With it, you can add extra fees to the cart between the subtotal and the total. The fee can have a positive or a negative amount. You can use conditions and formulas. And you can use the {cart.cart_coupon} to add an extra fee to correct the amount of the coupon on the fly.
While the result will do what you want, it's a bit finicky to configure, but at least, not code or modification is required.

Second, HikaShop has a coupon API:
www.hikashop.com/support/documentation/6...entation.html#coupon
So, it is possible to develop a small plugin to implement the calculation of the coupon value the way you want. It requires a bit of development, but with the help of chatGPT, any developer should be able to do it in less than an afternoon.

Third, we could implement something in HikaShop to support what you want.
Now, changing the behavior of the system so that it works like you want by default is out of the question. People already use coupons in the way we implemented it. And have a hard max amount cutoff is important when you configure several coupons with the "auto load in cart if possible" setting activated. That way, you can create a coupon from 0 to 50, another from 50 to 100, another from 100 to 200, etc and adapt the discount value and / or percentage for each range of total amount automatically. Not having a hard cutoff would mean that only one coupon would be taken into account and the others would be ignored.
And changing the default behavior would impact users with that kind of setup when updating their HikaShop.
We could potentially add an extra option. However, the coupon system already has a lot of complex options. I don't feel confortable adding yet another option.

I think that making a small plugin to adapt the behavior on the fly is the way to go here. It's relatively easy to do and won't impact others in any negative way.

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

Time to create page: 0.060 seconds
Powered by Kunena Forum