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

#   Limit Bug

##

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

Less More

- Posts: 7
- Thank you received: 0
-
-

8 years 10 months ago [\#284621](#284621) by [ifeldman0](/forum/user/37170-ifeldman0 "View ifeldman0's Profile")  *[Limit Bug](/forum/27-checkout/893219-limit-bug#284621 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.6.5 -- PHP version -- : 7.0.22 -- Browser(s) name and version -- : Chrome 63.0.3239.84 -- Error-message(debug-mod must be tuned on) -- : N/A  I've encountered an issue with limits in HikaShop 3.2.1. When I have a quantity limit and leave the currency as the default value (Euros), the limit does not apply if the previous orders to which it should apply are in US dollars. Changing the currency to USD fixes the issue.  For reference, this is a quantity limit being applied to a category. The time period selected does not seem to affect the issue, though the limit in question on my site is quarterly. Using (or not using) start date/end date does not seem to affect the issue either. Selected order statuses are created, confirmed, shipped, and pending.  Thanks! Ian")* was created by *[ifeldman0](/forum/user/37170-ifeldman0 "View ifeldman0's Profile")*

-- HikaShop version -- : 3.2.1
-- Joomla version -- : 3.6.5
-- PHP version -- : 7.0.22
-- Browser(s) name and version -- : Chrome 63.0.3239.84
-- Error-message(debug-mod must be tuned on) -- : N/A

I've encountered an issue with limits in HikaShop 3.2.1. When I have a quantity limit and leave the currency as the default value (Euros), the limit does not apply if the previous orders to which it should apply are in US dollars. Changing the currency to USD fixes the issue.

For reference, this is a quantity limit being applied to a category. The time period selected does not seem to affect the issue, though the limit in question on my site is quarterly. Using (or not using) start date/end date does not seem to affect the issue either. Selected order statuses are created, confirmed, shipped, and pending.

Thanks!
Ian

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5MzIxOS1saW1pdC1idWc/dG1wbD1tYXJrZG93bg==) 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: 86564
- Thank you received: 14311
-
-

8 years 10 months ago [\#284626](#284626) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Limit Bug](/forum/27-checkout/893219-limit-bug#284626 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.6.5 -- PHP version -- : 7.0.22 -- Browser(s) name and version -- : Chrome 63.0.3239.84 -- Error-message(debug-mod must be tuned on) -- : N/A  I've encountered an issue with limits in HikaShop 3.2.1. When I have a quantity limit and leave the currency as the default value (Euros), the limit does not apply if the previous orders to which it should apply are in US dollars. Changing the currency to USD fixes the issue.  For reference, this is a quantity limit being applied to a category. The time period selected does not seem to affect the issue, though the limit in question on my site is quarterly. Using (or not using) start date/end date does not seem to affect the issue either. Selected order statuses are created, confirmed, shipped, and pending.  Thanks! Ian")*

Hi,

Could you provide:
- a screenshot of the settings of your limit
- a link to your shop
- precise instructions to reproduce the issue on your website
so that we can better understand the situation ?

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

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

Less More

- Posts: 7
- Thank you received: 0
-
-

8 years 10 months ago [\#284673](#284673) by [ifeldman0](/forum/user/37170-ifeldman0 "View ifeldman0's Profile")  Replied by *[ifeldman0](/forum/user/37170-ifeldman0 "View ifeldman0's Profile")* on topic *[Limit Bug](/forum/27-checkout/893219-limit-bug#284673 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.6.5 -- PHP version -- : 7.0.22 -- Browser(s) name and version -- : Chrome 63.0.3239.84 -- Error-message(debug-mod must be tuned on) -- : N/A  I've encountered an issue with limits in HikaShop 3.2.1. When I have a quantity limit and leave the currency as the default value (Euros), the limit does not apply if the previous orders to which it should apply are in US dollars. Changing the currency to USD fixes the issue.  For reference, this is a quantity limit being applied to a category. The time period selected does not seem to affect the issue, though the limit in question on my site is quarterly. Using (or not using) start date/end date does not seem to affect the issue either. Selected order statuses are created, confirmed, shipped, and pending.  Thanks! Ian")*

Link to shop: [ www.ncemsf.org/conference/2018-conferenc...ividual-registration](https://www.ncemsf.org/conference/2018-conference/individual-registration) (must have an account and be logged in to view).

Our shop is being used as a Conference registration system. Individuals should only be able to register once in each registration period. A quarterly limit was imposed to handle this, with a limit type of "Quantity," applied to the Conference Registration product category (which includes the three registration types--Early, Regular, and Late). Per the Limits tutorial (and what worked in the previous version of HikaShop we were using, which was 2.6.3), if we set the Period to Quarterly, Type to Quantity, Quantity to One, Category to the appropriate product Category, and order status to "Created," "Confirmed," and "Shipped," that was sufficient to prevent duplicate registrations.

After upgrading to 3.2.1, the limit stopped functioning. When I looked at the query to get past orders in administrator/components/com_hikashop/classes/limit.php, I saw that it was including currency as part of the WHERE clause. Reexamining the Limit settings, I saw that the Currency was set to EUR, even though our shop uses USD. Switching the currency to USD allowed the query to see past orders and apply the limit correctly.

A fix would either be to modify limit.php to not use currency in the WHERE clause unless the limit type is "Price" or update the directions on the Limits Tutorial to state that the currency is needed even if the Limit Type isn't "Price."

The current (functioning) limit settings are attached. The only difference with the non-functioning settings is the Currency Type.

Thanks!
Ian

- [ ![limit-ncemsf.jpg](/forum/attachment/41867) ](/forum/attachment/41867 "limit-ncemsf.jpg") [ ](/forum/attachment/41867?download=1 "limit-ncemsf.jpg")

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzI3LWNoZWNrb3V0Lzg5MzIxOS1saW1pdC1idWc/dG1wbD1tYXJrZG93bg==) 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: 86564
- Thank you received: 14311
-
-

8 years 10 months ago [\#284677](#284677) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[Limit Bug](/forum/27-checkout/893219-limit-bug#284677 "-- HikaShop version -- : 3.2.1 -- Joomla version -- : 3.6.5 -- PHP version -- : 7.0.22 -- Browser(s) name and version -- : Chrome 63.0.3239.84 -- Error-message(debug-mod must be tuned on) -- : N/A  I've encountered an issue with limits in HikaShop 3.2.1. When I have a quantity limit and leave the currency as the default value (Euros), the limit does not apply if the previous orders to which it should apply are in US dollars. Changing the currency to USD fixes the issue.  For reference, this is a quantity limit being applied to a category. The time period selected does not seem to affect the issue, though the limit in question on my site is quarterly. Using (or not using) start date/end date does not seem to affect the issue either. Selected order statuses are created, confirmed, shipped, and pending.  Thanks! Ian")*

Hi,

Thank you for your feedback.
That is indeed a good point.
Try changing the code: Code:

$limit_rules[$dl]['currency'][(int)$limiter-&gt;limit_currency_id ] = (int)$limiter-&gt;limit_currency_id;

to:
Code:

if($limiter-&gt;limit_type == 'price') { $limit_rules[$dl]['currency'][(int)$limiter-&gt;limit_currency_id ] = (int)$limiter-&gt;limit_currency_id; }

in the administrator/components/com_hikashop/classes/limit.php file. That should be enough to avoid that issue so that the limit's currency is only taken into account when the limit is in price mode.

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

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

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