- Posts: 37
- Thank you received: 1
Coupon expiration decreases by one hour on save
11 years 6 months ago #196372
by tidosho
Coupon expiration decreases by one hour on save was created by tidosho
-- HikaShop version -- : 2.4.0
I was trying to set a coupon to expire on a future date at 23:59 (the coupon is restricted to the UK zone in case this is relevant) but every time I save the coupon the expiration time decreases by one hour. SAVE 22:59, SAVE 21:59, etc. To achieve what I wanted I had to set the expiration time to 24:59 and press SAVE, which is clearly a little bizarre.
This would appear to be a bug. What are these expiration times relative to? Server time?
Regards,
Martin
I was trying to set a coupon to expire on a future date at 23:59 (the coupon is restricted to the UK zone in case this is relevant) but every time I save the coupon the expiration time decreases by one hour. SAVE 22:59, SAVE 21:59, etc. To achieve what I wanted I had to set the expiration time to 24:59 and press SAVE, which is clearly a little bizarre.
This would appear to be a bug. What are these expiration times relative to? Server time?
Regards,
Martin
Please Log in or Create an account to join the conversation.
11 years 6 months ago #196375
by Xavier
Replied by Xavier on topic Coupon expiration decreases by one hour on save
Hi,
I think indeed that the server hour is different than the one used in Joomla, and that could cause this behavior.
I was not able to reproduce the issue on my end.
I think indeed that the server hour is different than the one used in Joomla, and that could cause this behavior.
I was not able to reproduce the issue on my end.
Please Log in or Create an account to join the conversation.
8 years 11 months ago #280166
by dyvel
Replied by dyvel on topic Coupon expiration decreases by one hour on save
Have the exact same issue - tried different time zone settings in joomla config, but it didn't make a difference to the behavior.
Please Log in or Create an account to join the conversation.
8 years 11 months ago #280187
by dyvel
Replied by dyvel on topic Coupon expiration decreases by one hour on save
Actually I just found out how to "trigger" this issue, and what is causing the issue... It's related to daylight saving time.
Currently we are on "summer time" and if I select a starting date within summer time, everything is ok.
But if I select a starting date after oct. 29 (winter time), then one hour is added to the time every time I save the coupon.
Currently we are on "summer time" and if I select a starting date within summer time, everything is ok.
But if I select a starting date after oct. 29 (winter time), then one hour is added to the time every time I save the coupon.
Please Log in or Create an account to join the conversation.
8 years 11 months ago #280199
by nicolas
Replied by nicolas on topic Coupon expiration decreases by one hour on save
Hi,
Thank you for your feedback.
Thanks to that, and after numerous tests, I think we found the cause and the solution.
It happens only when the current date is in a different summer/winter time range than the date you're entering. So if you're in summer time and you enter a date in summer date, or if you're in winter time and enter a date in winter time, it works fine.
Change the line:
return $date - $timeoffset *60*60 + date('Z');
to:
return $date - $timeoffset *60*60 + date('Z', $date);
in the file administrator/components/com_hikashop/helpers/helper.php and that should fix the issue like it did on our end. We'll add that patch for the next version of HikaShop.
Thank you for your feedback.
Thanks to that, and after numerous tests, I think we found the cause and the solution.
It happens only when the current date is in a different summer/winter time range than the date you're entering. So if you're in summer time and you enter a date in summer date, or if you're in winter time and enter a date in winter time, it works fine.
Change the line:
return $date - $timeoffset *60*60 + date('Z');
to:
return $date - $timeoffset *60*60 + date('Z', $date);
in the file administrator/components/com_hikashop/helpers/helper.php and that should fix the issue like it did on our end. We'll add that patch for the next version of HikaShop.
The following user(s) said Thank You: dyvel
Please Log in or Create an account to join the conversation.
8 years 11 months ago #280243
by dyvel
Replied by dyvel on topic Coupon expiration decreases by one hour on save
This fixed the issue at our end as well - thanks
The following user(s) said Thank You: Philip
Please Log in or Create an account to join the conversation.
Time to create page: 0.223 seconds