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

#   "Rolling" Quarters for Limits

##

- **[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
-
-

9 years 10 months ago [\#258779](#258779) by [ifeldman0](/forum/user/37170-ifeldman0 "View ifeldman0's Profile")  *["Rolling" Quarters for Limits](/forum/27-checkout/888145-rolling-quarters-for-limits#258779 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6 -- Browser(s) name and version -- : Chrome 55.0.2883.87 m -- Error-message(debug-mod must be tuned on) -- : N/A  Currently, the &quot;Quarterly&quot; limit is a fixed quarter (Jan-Mar, Apr-Jun, Jul-Sep, Oct-Dec). If I wanted to change this to a &quot;rolling&quot; quarter (i.e. cannot buy a product if you have purchased the same product during the previous three months), all I would need to do is change line 788 of /administrator/components/com&#95;hikashop/classes/cart.php from to in the definition of the baseDates array, right? Is there anywhere else that needs to be updated for this to work?  I'm aware of the limitations of strtotime() with months of different lengths, and I'm OK with it being a couple days off either way, as long as the general gist is there.  Thanks, Ian")* was created by *[ifeldman0](/forum/user/37170-ifeldman0 "View ifeldman0's Profile")*

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.6.5
-- PHP version -- : 5.6
-- Browser(s) name and version -- : Chrome 55.0.2883.87 m
-- Error-message(debug-mod must be tuned on) -- : N/A

Currently, the "Quarterly" limit is a fixed quarter (Jan-Mar, Apr-Jun, Jul-Sep, Oct-Dec). If I wanted to change this to a "rolling" quarter (i.e. cannot buy a product if you have purchased the same product during the previous three months), all I would need to do is change line 788 of /administrator/components/com_hikashop/classes/cart.php from Code:

2 =&gt; mktime(0,0,0,$d['mon']-(($d['mon']-1)%4),1,$d['year']),

to Code:

2 =&gt; strtotime("-3 months"),

in the definition of the baseDates array, right? Is there anywhere else that needs to be updated for this to work?

I'm aware of the limitations of strtotime() with months of different lengths, and I'm OK with it being a couple days off either way, as long as the general gist is there.

Thanks,
Ian

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

9 years 10 months ago [\#258792](#258792) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *["Rolling" Quarters for Limits](/forum/27-checkout/888145-rolling-quarters-for-limits#258792 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6 -- Browser(s) name and version -- : Chrome 55.0.2883.87 m -- Error-message(debug-mod must be tuned on) -- : N/A  Currently, the &quot;Quarterly&quot; limit is a fixed quarter (Jan-Mar, Apr-Jun, Jul-Sep, Oct-Dec). If I wanted to change this to a &quot;rolling&quot; quarter (i.e. cannot buy a product if you have purchased the same product during the previous three months), all I would need to do is change line 788 of /administrator/components/com&#95;hikashop/classes/cart.php from to in the definition of the baseDates array, right? Is there anywhere else that needs to be updated for this to work?  I'm aware of the limitations of strtotime() with months of different lengths, and I'm OK with it being a couple days off either way, as long as the general gist is there.  Thanks, Ian")*

Hi,

I don't think that it requires any other modification.
Note that the cart system will be completely rewritten for HikaShop 3.0. We're actually working on finishing the modifications to the limit system to cope with that. So the modification will have to be different when you update in the future.

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

9 years 10 months ago [\#258815](#258815) by [ifeldman0](/forum/user/37170-ifeldman0 "View ifeldman0's Profile")  Replied by *[ifeldman0](/forum/user/37170-ifeldman0 "View ifeldman0's Profile")* on topic *["Rolling" Quarters for Limits](/forum/27-checkout/888145-rolling-quarters-for-limits#258815 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.6.5 -- PHP version -- : 5.6 -- Browser(s) name and version -- : Chrome 55.0.2883.87 m -- Error-message(debug-mod must be tuned on) -- : N/A  Currently, the &quot;Quarterly&quot; limit is a fixed quarter (Jan-Mar, Apr-Jun, Jul-Sep, Oct-Dec). If I wanted to change this to a &quot;rolling&quot; quarter (i.e. cannot buy a product if you have purchased the same product during the previous three months), all I would need to do is change line 788 of /administrator/components/com&#95;hikashop/classes/cart.php from to in the definition of the baseDates array, right? Is there anywhere else that needs to be updated for this to work?  I'm aware of the limitations of strtotime() with months of different lengths, and I'm OK with it being a couple days off either way, as long as the general gist is there.  Thanks, Ian")*

Thanks! I'll be sure to re-evaluate our solution once HikaShop 3 comes out.

Ian

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

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