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

#   Error on Discounts making restrictions

##

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

Less More

- Posts: 49
- Thank you received: 0
-
-

15 years 11 months ago [\#2339](#2339) by [thewedge](/forum/user/350-thewedge "View thewedge's Profile")  *[Error on Discounts making restrictions](/forum/3-bug-report/2339-error-on-discounts-making-restrictions#2339 "When I make a coupon, with $500 and I select a product as restriction it makes it, but if I go back to it and try to edit it, I get this error:  Fatal error: Call to a member function setQuery() on a non-object in /home/vg004web03/86/89/2008986/web/administrator/components/com&#95;hikashop/views/discount/view.html.php on line 187  When I try to use the coupon on any product, not just the one I want it on it works, which it shouldn't.  Also, if I set an all capped code, and I put in at checkout no capped code it works. Should it not be capitalization sensitive?  If I just make a coupon with no restrictions, I have no problem going back and editing it.")* was created by *[thewedge](/forum/user/350-thewedge "View thewedge's Profile")*

When I make a coupon, with $500 and I select a product as restriction it makes it, but if I go back to it and try to edit it, I get this error:

Fatal error: Call to a member function setQuery() on a non-object in /home/vg004web03/86/89/2008986/web/administrator/components/com_hikashop/views/discount/view.html.php on line 187

When I try to use the coupon on any product, not just the one I want it on it works, which it shouldn't.

Also, if I set an all capped code, and I put in at checkout no capped code it works. Should it not be capitalization sensitive?

If I just make a coupon with no restrictions, I have no problem going back and editing it.

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

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

Less More

- Posts: 49
- Thank you received: 0
-
-

15 years 11 months ago [\#2340](#2340) by [thewedge](/forum/user/350-thewedge "View thewedge's Profile")  Replied by *[thewedge](/forum/user/350-thewedge "View thewedge's Profile")* on topic *[Re: Error on Discounts making restrictions](/forum/3-bug-report/2339-error-on-discounts-making-restrictions#2340 "When I make a coupon, with $500 and I select a product as restriction it makes it, but if I go back to it and try to edit it, I get this error:  Fatal error: Call to a member function setQuery() on a non-object in /home/vg004web03/86/89/2008986/web/administrator/components/com&#95;hikashop/views/discount/view.html.php on line 187  When I try to use the coupon on any product, not just the one I want it on it works, which it shouldn't.  Also, if I set an all capped code, and I put in at checkout no capped code it works. Should it not be capitalization sensitive?  If I just make a coupon with no restrictions, I have no problem going back and editing it.")*

I tried this on your demo system and it doesn't restrict either and it calls the error. I hope you can fix this by your morning as I am trying to go live tomorrow by 1pm Canada MST. My biggest concern is the restriction, not the cap. But the cap would be great if you could.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzMtYnVnLXJlcG9ydC8yMzM5LWVycm9yLW9uLWRpc2NvdW50cy1tYWtpbmctcmVzdHJpY3Rpb25zP3RtcGw9bWFya2Rvd24=) 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")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86358
- Thank you received: 14293
-
-

15 years 11 months ago [\#2351](#2351) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Re: Error on Discounts making restrictions](/forum/3-bug-report/2339-error-on-discounts-making-restrictions#2351 "When I make a coupon, with $500 and I select a product as restriction it makes it, but if I go back to it and try to edit it, I get this error:  Fatal error: Call to a member function setQuery() on a non-object in /home/vg004web03/86/89/2008986/web/administrator/components/com&#95;hikashop/views/discount/view.html.php on line 187  When I try to use the coupon on any product, not just the one I want it on it works, which it shouldn't.  Also, if I set an all capped code, and I put in at checkout no capped code it works. Should it not be capitalization sensitive?  If I just make a coupon with no restrictions, I have no problem going back and editing it.")*

For the setQuery error you can do that: [ www.hikashop.com/en/support/forum/3-bug-...ot-working.html#2272](http://www.hikashop.com/en/support/forum/3-bug-report/2024-coupon-restriction-on-product-not-working.html#2272)

The check on the code is indeed case insensitive. That's because in the database hikashop_discount table the column discount_code's collation is utf8_general_ci. You can edit that column via phpmyadmin and set it's collation to utf8_bin. I'm not sure if we want to include that in HikaShop... We think that it's nice that users don't have to respect the case of the coupon code. That's less frustration on them and less support for you since you won't have users complaining that the coupon didn't work and then have to explain them that they need to respect the case.

For the restriction on products not being applied there's indeed a problem. As changes needed to be done in several files, we prefered to just released a new version of HikaShop as it will be easier for you to apply it. That will also fix the first issue (the fatal error).

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

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

Less More

- Posts: 49
- Thank you received: 0
-
-

15 years 11 months ago [\#2357](#2357) by [thewedge](/forum/user/350-thewedge "View thewedge's Profile")  Replied by *[thewedge](/forum/user/350-thewedge "View thewedge's Profile")* on topic *[Re: Error on Discounts making restrictions](/forum/3-bug-report/2339-error-on-discounts-making-restrictions#2357 "When I make a coupon, with $500 and I select a product as restriction it makes it, but if I go back to it and try to edit it, I get this error:  Fatal error: Call to a member function setQuery() on a non-object in /home/vg004web03/86/89/2008986/web/administrator/components/com&#95;hikashop/views/discount/view.html.php on line 187  When I try to use the coupon on any product, not just the one I want it on it works, which it shouldn't.  Also, if I set an all capped code, and I put in at checkout no capped code it works. Should it not be capitalization sensitive?  If I just make a coupon with no restrictions, I have no problem going back and editing it.")*

Upgrade applied. Everything seems to be working properly. Thanks for getting this done today.

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

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