- Posts: 7
- Thank you received: 0
"Rolling" Quarters for Limits
9 years 9 months ago #258779
by ifeldman0
"Rolling" Quarters for Limits was created by ifeldman0
-- 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
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
-- 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 => mktime(0,0,0,$d['mon']-(($d['mon']-1)%4),1,$d['year']),
Code:
2 => strtotime("-3 months"),
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 or Create an account to join the conversation.
9 years 9 months ago #258792
by nicolas
Replied by nicolas on topic "Rolling" Quarters for Limits
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.
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 or Create an account to join the conversation.
9 years 9 months ago #258815
by ifeldman0
Replied by ifeldman0 on topic "Rolling" Quarters for Limits
Thanks! I'll be sure to re-evaluate our solution once HikaShop 3 comes out.
Ian
Ian
Please Log in or Create an account to join the conversation.
Time to create page: 0.182 seconds