quota per user for a coupon

  • Posts: 32
  • Thank you received: 0
9 years 6 months ago #201166

-- HikaShop version -- : 2.3.1
-- Joomla version -- : 2.5
-- PHP version -- : 5

Hi,

Two questions:-

(1)
If i set up a coupon in hikashop and configure it so that it can only be used once by a user, then when during the checkout process does hikashop specify that the user has used that coupon? As far as i can tell, it seems to be at the stage when the order is created and just as you go off to the payment gateway.

(2)
Which plugin function (event) could i write and call upon to replicate this event (described in question (1)) as i need to write a custom set of rules for my coupon which ultimately means that i cannot use the quota per user feature provided by hikashop?

Thanks in advance

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 6 months ago #201169

Hi,

1. It will be counted as used the moment the order is created at the end of the checkout, before the redirection to the payment gateway.

2. You can implement the onAfterCouponCheck(&$coupon, &$total, &$zones, &$products, &$display_error, &$error_message, &$do) trigger in your hikashop plugin and set the $do variable to false if you don't want the coupon to be used (when your rules don't match).

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

  • Posts: 9
  • Thank you received: 0
9 years 6 months ago #201215

hi same problem..


how can modify "AfterCouponCheck(&$coupon, &$total, &$zones, &$products, &$display_error, &$error_message, &$do) ",

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

  • Posts: 32
  • Thank you received: 0
9 years 6 months ago #201239

Hi Nicolas,

Thanks for your prompt response. Your answer to question (1) is excellent so thanks for that. However, i was looking for a slightly different answer for question (2). For question (2), I wanted to know what plugin event executes when an order is created (before going off to the payment gateway)?

Thanks again

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 6 months ago #201240

Hi,

@rturan:
What "same problem" are you talking about ?
There was no problem presented here. It was a question about how is the behavior of HikaShop and how can it be customized.
If your problem is www.hikashop.com/forum/discount-coupon/8...-first-purchase.html then please continue the discussion there and don't post your question for the same problem at different places.

@diesel1984:
Ah ok. Then it's the onBeforeOrderCreate(&$order,&$do) or onAfterOrderCreate(&$order) triggers that you want to implement.

The following user(s) said Thank You: diesel1984

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

  • Posts: 32
  • Thank you received: 0
9 years 6 months ago #201903

Hi Nicolas,

Fantastic - thank you. One last question for you - when a payment notification is received from a payment gateway (e.g. from sagepay) my order status gets updated from "created" to "confirmed". When the order status is updated in this manner (where the payment gateway sends the result of what happened there) does the onAfterOrderUpdate() plugin function also run?

Thanks in advance!

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

  • Posts: 82863
  • Thank you received: 13372
  • MODERATOR
9 years 6 months ago #201911

Hi,

Yes it does.

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

Time to create page: 0.081 seconds
Powered by Kunena Forum