[Skip to main content](#vessel-content)

#   quota per user for a coupon

##

- **[diesel1984](/forum/user/30999-diesel1984 "View diesel1984's Profile")**
- [![diesel1984's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30999-diesel1984 "View diesel1984's Profile") Topic Author
- [ Offline](/forum/user/30999-diesel1984)

Less More

- Posts: 32
- Thank you received: 0
-
-

11 years 5 months ago [\#201166](#201166) by [diesel1984](/forum/user/30999-diesel1984 "View diesel1984's Profile")  *[quota per user for a coupon](/forum/46-discount-coupon/876864-quota-per-user-for-a-coupon#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")* was created by *[diesel1984](/forum/user/30999-diesel1984 "View diesel1984's Profile")*

-- 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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84NzY4NjQtcXVvdGEtcGVyLXVzZXItZm9yLWEtY291cG9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86286
- Thank you received: 14263
-
-

11 years 5 months ago [\#201169](#201169) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[quota per user for a coupon](/forum/46-discount-coupon/876864-quota-per-user-for-a-coupon#201169 "-- 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")*

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(&amp;$coupon, &amp;$total, &amp;$zones, &amp;$products, &amp;$display_error, &amp;$error_message, &amp;$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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84NzY4NjQtcXVvdGEtcGVyLXVzZXItZm9yLWEtY291cG9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[rturan](/forum/user/36589-rturan "View rturan's Profile")**
- [![rturan's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/36589-rturan "View rturan's Profile")
- [ Offline](/forum/user/36589-rturan)

Less More

- Posts: 9
- Thank you received: 0
-
-

11 years 5 months ago [\#201215](#201215) by [rturan](/forum/user/36589-rturan "View rturan's Profile")  Replied by *[rturan](/forum/user/36589-rturan "View rturan's Profile")* on topic *[quota per user for a coupon](/forum/46-discount-coupon/876864-quota-per-user-for-a-coupon#201215 "-- 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")*

hi same problem..

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84NzY4NjQtcXVvdGEtcGVyLXVzZXItZm9yLWEtY291cG9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[diesel1984](/forum/user/30999-diesel1984 "View diesel1984's Profile")**
- [![diesel1984's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30999-diesel1984 "View diesel1984's Profile") Topic Author
- [ Offline](/forum/user/30999-diesel1984)

Less More

- Posts: 32
- Thank you received: 0
-
-

11 years 5 months ago [\#201239](#201239) by [diesel1984](/forum/user/30999-diesel1984 "View diesel1984's Profile")  Replied by *[diesel1984](/forum/user/30999-diesel1984 "View diesel1984's Profile")* on topic *[quota per user for a coupon](/forum/46-discount-coupon/876864-quota-per-user-for-a-coupon#201239 "-- 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")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84NzY4NjQtcXVvdGEtcGVyLXVzZXItZm9yLWEtY291cG9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86286
- Thank you received: 14263
-
-

11 years 5 months ago [\#201240](#201240) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[quota per user for a coupon](/forum/46-discount-coupon/876864-quota-per-user-for-a-coupon#201240 "-- 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")*

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](http://www.hikashop.com/forum/discount-coupon/861737-discount-on-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(&amp;$order,&amp;$do) or onAfterOrderCreate(&amp;$order) triggers that you want to implement.

The following user(s) said Thank You: [diesel1984](/forum/user/30999-diesel1984 "View diesel1984's Profile")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84NzY4NjQtcXVvdGEtcGVyLXVzZXItZm9yLWEtY291cG9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[diesel1984](/forum/user/30999-diesel1984 "View diesel1984's Profile")**
- [![diesel1984's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/30999-diesel1984 "View diesel1984's Profile") Topic Author
- [ Offline](/forum/user/30999-diesel1984)

Less More

- Posts: 32
- Thank you received: 0
-
-

11 years 5 months ago [\#201903](#201903) by [diesel1984](/forum/user/30999-diesel1984 "View diesel1984's Profile")  Replied by *[diesel1984](/forum/user/30999-diesel1984 "View diesel1984's Profile")* on topic *[quota per user for a coupon](/forum/46-discount-coupon/876864-quota-per-user-for-a-coupon#201903 "-- 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")*

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](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84NzY4NjQtcXVvdGEtcGVyLXVzZXItZm9yLWEtY291cG9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86286
- Thank you received: 14263
-
-

11 years 5 months ago [\#201911](#201911) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[quota per user for a coupon](/forum/46-discount-coupon/876864-quota-per-user-for-a-coupon#201911 "-- 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")*

Hi,

Yes it does.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2Rpc2NvdW50LWNvdXBvbi84NzY4NjQtcXVvdGEtcGVyLXVzZXItZm9yLWEtY291cG9uP3RtcGw9bWFya2Rvd24=) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop- Install &amp; Update- Product &amp; Category Display- Content Creation- Sales and Orders- - Orders management- - Reports &amp; Statistics- Customers- Checkout- Payment Methods- Shipping Methods- Import &amp; Export (CSV, XLS…)- Specific Features- - Affilation- - Taxes- - Wishlist- - Vote- - Carousel &amp; Slider- - Mass Actions- - Filters &amp; Search- - Discount &amp; Coupon- - Feature Request- Integrations- Showcase- General Talk about HikaShop- Development- - HikaShop 3.0 Beta- Translation- Commercial Jobs HikaShop Components- HikaMarket- - Market: Feature requests- - Market: How to?- - Market: Bug Report- HikaSerial- - General talk about HikaSerial- - Serial: Bug Report- - Serial: How to?- - Support en Français de HikaSerial (French Support)- - HikaSubscription- HikaAuction- - Auction: Feature requests- - Auction: How to?- - Auction: Bug report Hikashop around the world- Support en Français (French Support)- Russian- - FAQ. Курс выживания с Hikashop. Частые вопросы и о- - Расширения Hikashop- - Наши сайты на Hikashop- 日本語版サポート(Japanese Support)- Thai- German Archives- Bug Report- How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.281 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)

[](#top)
