Date field / checkout 1day date displace bug

  • Posts: 32
  • Thank you received: 0
9 years 2 months ago #193665

-- HikaShop version -- : HikaShop Business: 2.3.5
-- Joomla version -- : Joomla! 3.3.6
-- PHP version -- : 5.3.28
-- Browser(s) name and version -- : any

Can chose any product, for example:
www.novodreams.com/rezerv/product/314-av...chenij-port-aventura
Pick any date - (5may2015, for example), go to checkout, and in order review appears previous date from chosen (4may2015) :ohmy:

I was try to change server time-zone (both direction), test any possible configurations of advanced date picker, try to install different version of date picker, disable system cache, disable mootools... nothing...

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

  • Posts: 329
  • Thank you received: 94
9 years 2 months ago #193669

Hello alexintras,

I had a similar issue with a client. I was able to fix it by modifying the plugin file of datefiledpicker_class.php, specifically the getTimestamp function. In there, it is only getting the Year, Month, and Day to get the timestamp which is used by get date. I added ".' 12:00:00'" to the end of the value set line so now my getTimestamp function looks like this below. Best I can figure out by tracking the code is that the timezone offset is causing the problem and by setting the time to like noon fixes it. I may be wrong but that is what worked for our client.

Hope this helps.

Regards,
Donald

	private function getTimestamp($value) {
		if(is_array($value)) {
			$value = $value['y'] . '/' . $value['m'] . '/' . $value['d'].' 12:00:00';
		}
		$ret = hikashop_getTime($value);

		return $ret;
	}


~ Deb Cinkus, CEO

Polished Geek: more with monday․com
eCommerce Business Process Automation Experts
The following user(s) said Thank You: alexintras

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

  • Posts: 26025
  • Thank you received: 4006
  • MODERATOR
9 years 2 months ago #193670

Hi,

It shouldn't be required if the timezone is right configured in your server+joomla.
We made a timezone fix in HikaShop 2.4.0 for the setting "hour extra day" (which add an extra day when a specific hour has passed), otherwise we did not have specific issue reported for the rest of the plugin.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

  • Posts: 32
  • Thank you received: 0
9 years 2 months ago #193704

Resolved! Thank you very much!

PolishedGeek wrote: Hello alexintras,

I had a similar issue with a client. I was able to fix it by modifying the plugin file of datefiledpicker_class.php, specifically the getTimestamp function. In there, it is only getting the Year, Month, and Day to get the timestamp which is used by get date. I added ".' 12:00:00'" to the end of the value set line so now my getTimestamp function looks like this below. Best I can figure out by tracking the code is that the timezone offset is causing the problem and by setting the time to like noon fixes it. I may be wrong but that is what worked for our client.

Hope this helps.

Regards,
Donald

	private function getTimestamp($value) {
		if(is_array($value)) {
			$value = $value['y'] . '/' . $value['m'] . '/' . $value['d'].' 12:00:00';
		}
		$ret = hikashop_getTime($value);

		return $ret;
	}

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

  • Posts: 329
  • Thank you received: 94
9 years 2 months ago #194219

Hello Jerome,

I agree that it shouldn't happen but you may want to consider an option to add it in for some hosting environments. The client's site is hosted on a SiteGround VPS and we only have Cpanel access so we can only do so much with the hosting. We can say the Joomla configuration is set up correctly.

To figure this one out, I had to put in a lot of debug code and testing to get to this point and it finally taking a look at all the client's orders who had issues (there were a lot) to see the pattern. Not to mention it was correct in the DB but just wasn't going out right in the email nor showed up in order correctly. It was the part about the conversion to timestamp that really seemed off after it converted it back to a date. This is where I first had the idea to add noon to the "date to timestamp" conversion code. So far, my "hack" has stabilized the client and made all the customer chosen delivery dates match up with what they selected during checkout.

Regards,
Donald


~ Deb Cinkus, CEO

Polished Geek: more with monday․com
eCommerce Business Process Automation Experts

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

  • Posts: 329
  • Thank you received: 94
9 years 2 months ago #194220

Hello alexintras,

Glad that helped you. Mind telling me where the site it hosted? Just curious to see if it is the same hosting company.

Regards,
Donald.


~ Deb Cinkus, CEO

Polished Geek: more with monday․com
eCommerce Business Process Automation Experts

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

  • Posts: 32
  • Thank you received: 0
9 years 2 months ago #194262

hostgator :-)

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

  • Posts: 26025
  • Thank you received: 4006
  • MODERATOR
9 years 2 months ago #194408

Hi,

Thanks for your report.
I'll see to include the patch in the next release.

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.
The following user(s) said Thank You: PolishedGeek

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

  • Posts: 25
  • Thank you received: 1
8 years 4 months ago #226116

Hi

I am strangling to make the datepicker to have the right time but it has the server timezone time.
Joomla has the correct timezone selected but the datepicker goes with the server time zone.
Server is the Siteground at Chicago and we are at Los Angeles time zone, so we have 2 hours difference.

I tried:
1. Datapicker plugin parameters "Set hour to 12:00 when processing time" to Yes
2. php.ini: date.timezone = "America/Los_Angeles"
Without any luck.

PolishedGeek solution can not be accomplished as the code has changed and looks to incorporate his hack.

Any other solution? It is critical for our website!

I have the latest 2.6.0 Hikashop on Joomla 3.4.8

Thank you

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

  • Posts: 26025
  • Thank you received: 4006
  • MODERATOR
8 years 3 months ago #226557

Hi,

I don't know what I can tell you.
The PolishedGeek's patch has been include in HikaShop ; like I previously wrote.

Please note that Joomla is not using the PHP timezone ; so the datepicker plugin neither (because it uses Joomla).

Regards,


Jerome - Obsidev.com
HikaMarket & HikaSerial developer / HikaShop core dev team.

Also helping the HikaShop support team when having some time or couldn't sleep.
By the way, do not send me private message, use the "contact us" form instead.

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

Time to create page: 0.103 seconds
Powered by Kunena Forum