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

#   Automatically loaded Coupon

##

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

Less More

- Posts: 251
- Thank you received: 2
-
-

15 years 4 months ago [\#20476](#20476) by [Nello](/forum/user/1361-nello "View Nello's Profile")  *[Automatically loaded Coupon](/forum/3-bug-report/20476-automatically-loaded-coupon#20476 "Hi Nicolas,  I set a coupon that is automatically loaded into cart, but this is the result I obtained...")* was created by *[Nello](/forum/user/1361-nello "View Nello's Profile")*

Hi Nicolas,

I set a coupon that is automatically loaded into cart, but this is the result I obtained...

[ ![&#91;img](http://www.hikashop.com/media/kunena/attachments/legacy/images/coupon-20110703.jpg) ](http://www.hikashop.com/media/kunena/attachments/legacy/images/coupon-20110703.jpg "&#91;img")

- [ ![coupon-20110703.jpg](/forum/attachment/1389) ](/forum/attachment/1389 "...n-20110703.jpg") [ ](/forum/attachment/1389?download=1 "...n-20110703.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMDQ3Ni1hdXRvbWF0aWNhbGx5LWxvYWRlZC1jb3Vwb24/bGFuZz1lbiZ0bXBsPW1hcmtkb3du) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

15 years 4 months ago [\#20506](#20506) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Automatically loaded Coupon](/forum/3-bug-report/20476-automatically-loaded-coupon#20506 "Hi Nicolas,  I set a coupon that is automatically loaded into cart, but this is the result I obtained...")*

It seems that you don't have the latest version of HikaShop. Please update and try again.

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

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

Less More

- Posts: 251
- Thank you received: 2
-
-

15 years 4 months ago -  15 years 4 months ago [\#20518](#20518) by [Nello](/forum/user/1361-nello "View Nello's Profile")  Replied by *[Nello](/forum/user/1361-nello "View Nello's Profile")* on topic *[Re: Automatically loaded Coupon](/forum/3-bug-report/20476-automatically-loaded-coupon#20518 "Hi Nicolas,  I set a coupon that is automatically loaded into cart, but this is the result I obtained...")*

Hi Nicolas I updated to the version 1.5.2.
I set a new coupon this way

[ ![&#91;img](http://www.hikashop.com/media/kunena/attachments/legacy/images/coupon-20110704.jpg) ](http://www.hikashop.com/media/kunena/attachments/legacy/images/coupon-20110704.jpg "&#91;img")

I obtained this

[ ![&#91;img](http://www.hikashop.com/media/kunena/attachments/legacy/images/result.jpg) ](http://www.hikashop.com/media/kunena/attachments/legacy/images/result.jpg "&#91;img")

I noted that If I try to set the date the error disappear but the coupon isn't applied.

Also I noted that the Discount Quota Per User don't work..

- [ ![coupon-20110704.jpg](/forum/attachment/1391) ](/forum/attachment/1391 "...n-20110704.jpg") [ ](/forum/attachment/1391?download=1 "...n-20110704.jpg")
- [ ![result.jpg](/forum/attachment/1392) ](/forum/attachment/1392 "result.jpg") [ ](/forum/attachment/1392?download=1 "result.jpg")

Last edit: 15 years 4 months ago by [Nello](/forum/user/1361-nello "View Nello's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMDQ3Ni1hdXRvbWF0aWNhbGx5LWxvYWRlZC1jb3Vwb24/bGFuZz1lbiZ0bXBsPW1hcmtkb3du) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

15 years 4 months ago [\#20521](#20521) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Automatically loaded Coupon](/forum/3-bug-report/20476-automatically-loaded-coupon#20521 "Hi Nicolas,  I set a coupon that is automatically loaded into cart, but this is the result I obtained...")*

Please edit the file administrator/com_hikashop/classes/discount.php and change the line:
$query = 'SELECT COUNT(order_id) AS already_used FROM '.hikashop_get('order').' WHERE order_user_id='.(int)$user_id.' AND order_status NOT IN ('.$cancelled_order_status.') AND order_discount_code='.$db-&gt;Quote($coupon-&gt;discount_code).' GROUP BY order_id';

to:
$query = 'SELECT COUNT(order_id) AS already_used FROM '.hikashop_table('order').' WHERE order_user_id='.(int)$user_id.' AND order_status NOT IN ('.$cancelled_order_status.') AND order_discount_code='.$db-&gt;Quote($coupon-&gt;discount_code).' GROUP BY order_id';

and try again.

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

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

Less More

- Posts: 251
- Thank you received: 2
-
-

15 years 4 months ago [\#20528](#20528) by [Nello](/forum/user/1361-nello "View Nello's Profile")  Replied by *[Nello](/forum/user/1361-nello "View Nello's Profile")* on topic *[Re: Automatically loaded Coupon](/forum/3-bug-report/20476-automatically-loaded-coupon#20528 "Hi Nicolas,  I set a coupon that is automatically loaded into cart, but this is the result I obtained...")*

it seems to work!

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMDQ3Ni1hdXRvbWF0aWNhbGx5LWxvYWRlZC1jb3Vwb24/bGFuZz1lbiZ0bXBsPW1hcmtkb3du) 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?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Away](/forum/user/63-nicolas)

Less More

- Posts: 86541
- Thank you received: 14304
-
-

15 years 4 months ago [\#20530](#20530) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Automatically loaded Coupon](/forum/3-bug-report/20476-automatically-loaded-coupon#20530 "Hi Nicolas,  I set a coupon that is automatically loaded into cart, but this is the result I obtained...")*

Great. We'll add that to next release.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMDQ3Ni1hdXRvbWF0aWNhbGx5LWxvYWRlZC1jb3Vwb24/bGFuZz1lbiZ0bXBsPW1hcmtkb3du) 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.058 seconds

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