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

#   Automatic Coupons - Assign to Specific User

##

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

Less More

- Posts: 55
- Thank you received: 2
-
-

5 years 10 months ago [\#328588](#328588) by [ohall](/forum/user/16115-ohall "View ohall's Profile")  *[Automatic Coupons - Assign to Specific User](/forum/17-serial-how-to/901726-automatic-coupons-assign-to-specific-user#328588 "Hi, I have configured a Coupon Pack which creates a product category specific, time limited coupon. The coupon is set to automatically load if possible.  So far - perfect!  The trouble is, the coupon needs to be assigned to the purchasing user and I don't seem to be able to find the right settings to enforce this. I have changed the Pack settings (I've tried various options, but currently have: Unlimited Qty: Y Consumable: Y Consume will check: Y Websvc Access: N No User Assign: N ")* was created by *[ohall](/forum/user/16115-ohall "View ohall's Profile")*

Hi,
I have configured a Coupon Pack which creates a product category specific, time limited coupon.
The coupon is set to automatically load if possible.

So far - perfect!

The trouble is, the coupon needs to be assigned to the purchasing user and I don't seem to be able to find the right settings to enforce this.
I have changed the Pack settings (I've tried various options, but currently have:
Unlimited Qty: Y
Consumable: Y
Consume will check: Y
Websvc Access: N
No User Assign: N &lt;-- Not "No User Assign" (double negative) should mean "Assign to User" shouldn't it?
Random: N

The No User Assign doesn't seem to make any different - I've had another user add products to their cart and they automatically get *my* coupon assigned.

Where am I going wrong here?
Many thanks,
Oliver

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

5 years 10 months ago [\#328602](#328602) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Automatic Coupons - Assign to Specific User](/forum/17-serial-how-to/901726-automatic-coupons-assign-to-specific-user#328602 "Hi, I have configured a Coupon Pack which creates a product category specific, time limited coupon. The coupon is set to automatically load if possible.  So far - perfect!  The trouble is, the coupon needs to be assigned to the purchasing user and I don't seem to be able to find the right settings to enforce this. I have changed the Pack settings (I've tried various options, but currently have: Unlimited Qty: Y Consumable: Y Consume will check: Y Websvc Access: N No User Assign: N ")*

Hello,

The configuration for the generation of the "coupon" is related to the "coupon generator".
There is no setting in the pack settings to change that.

The user assignation is not available in the current version of the coupon generator ; it has not be requested before since the coupon code is random and only the user know it in its order configuration email (and can be use only once if you configure the "coupon template" accordingly).
[ www.hikashop.com/support/documentation/1...ugins-coupongen.html](https://www.hikashop.com/support/documentation/139-hikaserial-plugins-coupongen.html)

But if you really need to have a user assignation on the coupon generator ; it is something we can add in your TODO list for future improvements.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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

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

Less More

- Posts: 55
- Thank you received: 2
-
-

5 years 10 months ago [\#328705](#328705) by [ohall](/forum/user/16115-ohall "View ohall's Profile")  Replied by *[ohall](/forum/user/16115-ohall "View ohall's Profile")* on topic *[Automatic Coupons - Assign to Specific User](/forum/17-serial-how-to/901726-automatic-coupons-assign-to-specific-user#328705 "Hi, I have configured a Coupon Pack which creates a product category specific, time limited coupon. The coupon is set to automatically load if possible.  So far - perfect!  The trouble is, the coupon needs to be assigned to the purchasing user and I don't seem to be able to find the right settings to enforce this. I have changed the Pack settings (I've tried various options, but currently have: Unlimited Qty: Y Consumable: Y Consume will check: Y Websvc Access: N No User Assign: N ")*

Hi Jerome,
It's a shame that isn't already supported - so - yes, if I could request that as a future feature, I think it would be a better user experience to have a discount coupon automatically add to cart if it's available (and still "in date").
We'll just have people do it manually for now.
Thanks,
Oliver

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

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

5 years 10 months ago [\#328728](#328728) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Automatic Coupons - Assign to Specific User](/forum/17-serial-how-to/901726-automatic-coupons-assign-to-specific-user#328728 "Hi, I have configured a Coupon Pack which creates a product category specific, time limited coupon. The coupon is set to automatically load if possible.  So far - perfect!  The trouble is, the coupon needs to be assigned to the purchasing user and I don't seem to be able to find the right settings to enforce this. I have changed the Pack settings (I've tried various options, but currently have: Unlimited Qty: Y Consumable: Y Consume will check: Y Websvc Access: N No User Assign: N ")*

Hello,

Can you please describe your "need" regarding that auto-coupon you want to generate for your customers ?
I want to fully understand what you want to implement in order to see what can be done.
Generally, HikaSerial users want to create a coupon with the same price than the bought product ; so they can sell "gift cards" (And gift cards do not require a user restriction).

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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

Less More

- Posts: 55
- Thank you received: 2
-
-

5 years 9 months ago [\#328746](#328746) by [ohall](/forum/user/16115-ohall "View ohall's Profile")  Replied by *[ohall](/forum/user/16115-ohall "View ohall's Profile")* on topic *[Automatic Coupons - Assign to Specific User](/forum/17-serial-how-to/901726-automatic-coupons-assign-to-specific-user#328746 "Hi, I have configured a Coupon Pack which creates a product category specific, time limited coupon. The coupon is set to automatically load if possible.  So far - perfect!  The trouble is, the coupon needs to be assigned to the purchasing user and I don't seem to be able to find the right settings to enforce this. I have changed the Pack settings (I've tried various options, but currently have: Unlimited Qty: Y Consumable: Y Consume will check: Y Websvc Access: N No User Assign: N ")*

Hi Jerome,

By "need" I assume you're talking about "requirements gathering"? ("need" is possibly a bit strong here!)

The use case is:
We sell software modules - each module purchase generates a key which is delivered to the customer. This part of the process is fine (we use custom fields to collect customer info and a custom serial generator for this).

We would like to offer discounts to customers for qualifying products (products that are listed under a specific, unpublished, category) where they are awarded a time-limited (e.g. 30 day) coupon code that will give them a percentage discount on a future purchase. We're using the canned coupon generator plugin with a specific product category, a time limit and a single use quota.

At the moment, this serial is attached to the qualifying order and the user will have to (a) remember they have a coupon and (b) apply it manually at their next purchase.

I would prefer that the coupon could automatically apply to the next purchase. This would require the original user being assigned to the new coupon at generation. This currently doesn't appear to be possible.

Request: Could the coupon serial generator please add the purchasing user to the generated coupon so that we can enable "automatically apply" and have the whole process "hands free" from the customer's perspective?

I hope that makes sense.
Oliver

The following user(s) said Thank You: [Jerome](/forum/user/80-jerome "View Jerome's Profile")

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

5 years 9 months ago [\#328773](#328773) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Automatic Coupons - Assign to Specific User](/forum/17-serial-how-to/901726-automatic-coupons-assign-to-specific-user#328773 "Hi, I have configured a Coupon Pack which creates a product category specific, time limited coupon. The coupon is set to automatically load if possible.  So far - perfect!  The trouble is, the coupon needs to be assigned to the purchasing user and I don't seem to be able to find the right settings to enforce this. I have changed the Pack settings (I've tried various options, but currently have: Unlimited Qty: Y Consumable: Y Consume will check: Y Websvc Access: N No User Assign: N ")*

Hello,

Try to replace that code Code:

$result = $discountClass-&gt;save($data);

By Code:

$data-&gt;discount_user_id = !empty($order-&gt;order_user_id) ? $order-&gt;order_user_id : @$order-&gt;old-&gt;order_user_id; if(empty($data-&gt;discount_user_id)) unset($data-&gt;discount_user_id); $result = $discountClass-&gt;save($data);

In the plugin hikaserial/coupongen/coupongen.php

It would copy the order user ID into the generated coupon.
If it suits your needs, I'll add a new setting in the plugin to enable that assignation.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

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

Less More

- Posts: 461
- Thank you received: 36
-
-

5 years 8 months ago [\#330344](#330344) by [joomleb](/forum/user/2322-joomleb "View joomleb's Profile")  Replied by *[joomleb](/forum/user/2322-joomleb "View joomleb's Profile")* on topic *[Automatic Coupons - Assign to Specific User](/forum/17-serial-how-to/901726-automatic-coupons-assign-to-specific-user#330344 "Hi, I have configured a Coupon Pack which creates a product category specific, time limited coupon. The coupon is set to automatically load if possible.  So far - perfect!  The trouble is, the coupon needs to be assigned to the purchasing user and I don't seem to be able to find the right settings to enforce this. I have changed the Pack settings (I've tried various options, but currently have: Unlimited Qty: Y Consumable: Y Consume will check: Y Websvc Access: N No User Assign: N ")*

Hi guys,
@Jerome +1 about the "User assignation coupon" that could be really useful like in [ this case](https://www.hikashop.com/forum/14-hikaserial/890455-how-to-creat-coupons-or-discounts-or-gift-certificates.html)
and would be great to have the AcyMailing 7 integration, to be able to send the assigned coupon to the user directly by email...

Please, Do you have any plan for it ?

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26402
- Thank you received: 4081
-
- [](http://obsi.dev)
-

5 years 8 months ago [\#330354](#330354) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[Automatic Coupons - Assign to Specific User](/forum/17-serial-how-to/901726-automatic-coupons-assign-to-specific-user#330354 "Hi, I have configured a Coupon Pack which creates a product category specific, time limited coupon. The coupon is set to automatically load if possible.  So far - perfect!  The trouble is, the coupon needs to be assigned to the purchasing user and I don't seem to be able to find the right settings to enforce this. I have changed the Pack settings (I've tried various options, but currently have: Unlimited Qty: Y Consumable: Y Consume will check: Y Websvc Access: N No User Assign: N ")*

Hello,

The feature has been implemented and will be in the next release.

Regards,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzE3LXNlcmlhbC1ob3ctdG8vOTAxNzI2LWF1dG9tYXRpYy1jb3Vwb25zLWFzc2lnbi10by1zcGVjaWZpYy11c2VyP3RtcGw9bWFya2Rvd24=) 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?

Moderators: [Obsidev](/forum/user/7040-obsidev "View Obsidev's Profile")

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

Time to create page: 0.106 seconds

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