- Posts: 32
- Thank you received: 0
quota per user for a coupon
- diesel1984
-
Topic Author
- Offline
Less
More
11 years 4 months ago #201166
by diesel1984
quota per user for a coupon was created by diesel1984
-- 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
-- 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.
11 years 4 months ago #201169
by nicolas
Replied by nicolas on topic quota per user for a coupon
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).
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.
11 years 4 months ago #201215
by rturan
Replied by rturan on topic quota per user for a coupon
hi same problem..
how can modify "AfterCouponCheck(&$coupon, &$total, &$zones, &$products, &$display_error, &$error_message, &$do) ",
how can modify "AfterCouponCheck(&$coupon, &$total, &$zones, &$products, &$display_error, &$error_message, &$do) ",
Please Log in or Create an account to join the conversation.
- diesel1984
-
Topic Author
- Offline
Less
More
- Posts: 32
- Thank you received: 0
11 years 4 months ago #201239
by diesel1984
Replied by diesel1984 on topic quota per user for a coupon
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
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.
11 years 4 months ago #201240
by nicolas
Replied by nicolas on topic quota per user for a coupon
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.
@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.
- diesel1984
-
Topic Author
- Offline
Less
More
- Posts: 32
- Thank you received: 0
11 years 4 months ago #201903
by diesel1984
Replied by diesel1984 on topic quota per user for a coupon
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!
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.
11 years 4 months ago #201911
by nicolas
Replied by nicolas on topic quota per user for a coupon
Hi,
Yes it does.
Yes it does.
Please Log in or Create an account to join the conversation.
Time to create page: 0.165 seconds