Notice: Only variables should be assigned by reference in /var/www/clients/client4/web20/web/templates/shape5_vertex/vertex/responsive/responsive_mobile_sidebar.php on line 8

Notice: Only variables should be assigned by reference in /var/www/clients/client4/web20/web/templates/shape5_vertex/vertex/responsive/responsive_mobile_menu.php on line 278

VirtueMart

WooCommerce

Others

Docs

Support

Demo

Blog

About

Forum
Welcome, Guest
Username: Password: Remember me

TOPIC: [SOLVED] Time Zone when using Date in the order number

Time Zone when using Date in the order number 03 May 2017 20:19 #1

Thank you for the extension. I have it installed and configured to my liking with one exception. I am using YY-MM-DD in the order / invoice number. The extension seems to use the server time zone and not the time zone set in Magento's 'locale' setting. In my case orders placed in the evening show create order numbers with the next day's date; note I'm UTC -5. Is there a way to adjust for the local timezone?

Thanks!
The administrator has disabled public write access.

Time Zone when using Date in the order number 13 May 2017 19:39 #2

Dear in_mtl,
Yes, you are right, the php code uses standard PHP functions to get the date and thus ignores the magento settings. Unfortunately, I don't even have a full Magento installation around to test it, let alone that I have any resources to still support this extension.

However, you can change things yourselves: The file app/code/community/OpenTools/Ordernumber/Helper/Data.php contains the OpenTools_Ordernumber_Helper_Data::setupDateTimeReplacements function that sets up all date/time-releated variables. You'll need to change all date(..) calls to magento-specific code...

Best regards and sorry that I can't provide you with the ready solution,
Reinhold
The administrator has disabled public write access.

Time Zone when using Date in the order number 09 Jun 2017 14:01 #5

Hi In_mtl

Are you able to point me in the right direction with the correct code for retrieving the system time for this module? I am very new to magento (& php in general). I have tried googling the issue without any luck. I am a little confused where you say " I swapped $utime where needed with Mage::getModel('core/date')->timestamp(time()) and now the date fields in my order numbers match my local timezone". When I put "Mage::getModel('core/date')->timestamp(time())" in the place of "$utime" in the Data.php file in the Helper folder the module throws up an error. I am sure I am doing something quite stupid but for the life of me I can't figure what. I appreciate your help if possible.

Cheers

Ian
The administrator has disabled public write access.

Time Zone when using Date in the order number 15 May 2017 22:13 #3

Dear Reinhold,

Thank you for pointing me in the right direction. I swapped $utime where needed with Mage::getModel('core/date')->timestamp(time()) and now the date fields in my order numbers match my local timezone.

Great extension!
Thanks again
The administrator has disabled public write access.

[SOLVED] Time Zone when using Date in the order number 19 May 2017 22:45 #4

Problem solved.
The administrator has disabled public write access.

VM - Shopping cart

 x 

Cart empty

Login Formular