"Rolling" Quarters for Limits

  • Posts: 7
  • Thank you received: 0
7 years 10 months ago #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 "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

2 => mktime(0,0,0,$d['mon']-(($d['mon']-1)%4),1,$d['year']),
to
2 => 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 or Create an account to join the conversation.

  • Posts: 82868
  • Thank you received: 13377
  • MODERATOR
7 years 10 months ago #258792

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 or Create an account to join the conversation.

  • Posts: 7
  • Thank you received: 0
7 years 10 months ago #258815

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

Ian

Please Log in or Create an account to join the conversation.

Time to create page: 0.042 seconds
Powered by Kunena Forum