Time offset in orders is 7 hours back, how to fix this?

Hi guys,



New here, i m making the store right now and during the tests I’m doing i saw that when an order is placed the time in the invoice is 7 hours behind and that’s my server’s hour, not my local time. The hour displays wrong inside the admin panel too, in the orders section.



Is there a fix for this or an option inside the admin panel that i cannot find/see? This could be very misleading for me as a merchant but for the customer also.



An other question is, how can i add the price with (xxxx.xx$ inc.tax) when i click a product that belongs to a configured product? To be more specific, when i click a product a pop up opens with specifications about it and the price, but the price shows up without the VAT/tax. I know there is a template edit for it but i cannot find/dont know the appropriate template to edit.



Thanks!



p.s. Amazing ecommerce solution!:cool:

[quote name=‘Predator’]Hi guys,



New here, i m making the store right now and during the tests I’m doing i saw that when an order is placed the time in the invoice is 7 hours behind and that’s my server’s hour, not my local time. The hour displays wrong inside the admin panel too, in the orders section.[/quote]



There should be a .htaccess TMZ timezone type parameter, I can’t find it unforunately.:oops:

Thanks for the reply, the parameter is



SetEnv TZ Europe/Athens



But it wont fix the problem…



Any other suggestions?

Contact your webhost.



This is a common problem with most e-commerce scripts and scripts in general

It’s necessary for CS-Cart to code a time offset as far as I’m aware of

this is what i have found…and please save a copy of the file before editing.



In order to set the date and time to be the time/date of the time zone where orders are placed you should modify the “sessions.php” file located in the “/core” directory of your CS-Cart installation. Please find and replace there the following line of code:





define(‘TIME’, time());





with this one:





define(‘TIME’, time()- 8*3600);







Please note that this change will affect all future dates that will be saved in the database(time of placed orders and time of user’s registration, etc.).



and i am GMT-6 if this helps i hope

Much thanks iionc,



I’ll test this as soon as I can.

I should ask the time variable of 8*3600 refers to what exactly? I’m in GMT +10 and so would like to use this myself. :slight_smile:



I can’t test this from where I am at the moment (My PC’s Sata channel died in the …) but will get back to you as soon as possible

Thanks llonc, it worked like a charm!!



JesseLeeStringer, I’m GMT+7 so my code is: (maybe you need to play a little bit with the daylight saving in your area)



```php define(‘TIME’, time()+ 7*3600); ```

[quote name=‘llonc’]this is what i have found…and please save a copy of the file before editing.



In order to set the date and time to be the time/date of the time zone where orders are placed you should modify the “sessions.php” file located in the “/core” directory of your CS-Cart installation. Please find and replace there the following line of code:





define(‘TIME’, time());





with this one:





define(‘TIME’, time()- 83600);







Please note that this change will affect all future dates that will be saved in the database(time of placed orders and time of user’s registration, etc.).



and i am GMT-6 if this helps i hope[/QUOTE]

Hi Guys

I am trying to change the time as well but can not seem to see where the file"/core" directory is located to edit. Is it in Cpanel? or cart admin? Any basic info would be great.

I need to change mine to this define(‘TIME’, time()+ 10
3600);



Thank you in advance

[quote name=‘familydeals’]where the file"/core" directory is located to edit.[/quote]



Using FTP edit the file called 'sessions.php available in:



/domain.com/cscartdirectory/core/sessions.php



this structure will show it is:



wxw.southeastauto.com/store/core/sessions.php

OR something along the lines of



wxw.southeastauto.com.au/core/sessions.php

[quote name=‘JesseLeeStringer’]Using FTP edit the file called 'sessions.php available in:



/domain.com/cscartdirectory/core/sessions.php



this structure will show it is:



wxw.southeastauto.com/store/core/sessions.php

OR something along the lines of



wxw.southeastauto.com.au/core/sessions.php[/QUOTE]

Hi

Sorry i am really new to this. When you say Using FTP edit do you mean use Frontpage program? I found the file in Cpanel called /core/sessions.php but when i opened it could not see the bit define(‘TIME’, time());



Thank you in advance

Hi

Actually you can do this with htaccess - I am under GMT (england) so I add the following line to my htaccess file at the top just under the first line (DirectoryIndex index.html index.php) …

SetEnv TZ GMT

If you are elsewhere you probably need to add a + or - x where x is the number of hours you are in front or behind GMT.

The above does work - I use it myself.



UKAV :wink:

Hi ukav

Thanks, do you no how to do it in /core/sessions.php. I have been trying for hours. I found the file in Cpanel called /core/sessions.php but when i opened it could not see the bit define(‘TIME’, time()); or do i use frontpage to edit the file, iam really new to this web stuff. Any one with real basic instructions that would be great



Thank you in advance

[quote name=‘familydeals’]Hi ukav

Thanks, do you no how to do it in /core/sessions.php. I have been trying for hours. I found the file in Cpanel called /core/sessions.php but when i opened it could not see the bit define(‘TIME’, time()); or do i use frontpage to edit the file, iam really new to this web stuff. Any one with real basic instructions that would be great



Thank you in advance[/QUOTE]



hi Mate

First things first - do you have an FTP client installed on your computer ?

If yes (and I assume you must have or else how did you upload your cs-cart files in the first place) then simply log into your server and download the htaccess file which is in the root of your cs-cart installation (the ‘root’ is the folder into which you installed cs-cart), then modify it as I showed above - save it and re-upload. That’s it - your done ! (how easy was that :wink: )

Seriously - you just don’t need to go digging into core files for this, though I’m sure it probably works, but why complicate things when you have a simple solution available.

I understand this all seems a bit complicated right now, but it was the same for me when I started and you soon pick it up - really it’s more about having the confidence to dive in and play around. All I would say though is to back up any file you intend to mess with so you can always go back if needed.

If you need more help just ask - I am not a real expert like jesseleestringer et al, but if I can help I will.



Incidentally - if you really want to modify your sessions.php then the relevant code is at line 52.







UKAV

Hi Ukav

Is ftp FrontPage? If it is not I do not have it installed on my computer. Cs-cart was installed by Cs-cart people. I really do thank you for your help as it does seem over whelming most of the time. I have done a back up using cs-cart store manager with.



Thank you in advance

Ah, mmm, err well ok - to be honest I don’t know anything about frontpage, but go to [url]http://www.smartftp.com/[/url] and download the FTP program (assuming your using some kind of windoze os). Smart is free for non-commercial applications.

Install it and set up a connection using your server login and password (this will be the same as you supplied to cs-cart for them to install it for you).

FTP is really easy to use - it’s just like using explorer on your local computer and should be obvious once your looking at it.

Once you are connected to the server just drag and drop the htaccess file from one window (the server or ‘remote’ window) to the other window (some folder on your local machine) and it will download to your computer. now go to that folder and find/open the htaccess file (useing a text editor - notepad will do) and modify it, then save. Once you are done modifying the htaccess file just reverse the drag and drop and it will upload to your server.



Hope that helps :wink:



UKAV



By the way - this takes longer to explain and looks much more complicated than it really is - honestly once you’ve done this once you will wonder what all the fuss was about :lol:

Hi ukav

Thank you, That sounds easy, well i hope so. Thanks again i give it a go on the weekend. The program smartftp looks great can’t wait to give that a go



Thank you

and have a great day or night

[quote name=‘familydeals’]Hi ukav

Thank you, That sounds easy, well i hope so. Thanks again i give it a go on the weekend. The program smartftp looks great can’t wait to give that a go



Thank you

and have a great day or night[/QUOTE]



My pleasure familydeals - I received some very kind help on this forum myself when I first started with cs-cart and I’m very pleased to be able to give something back;)

Don’t be affraid to ask again if you run into problems - if you really can’t figure it out I would be happy to do it for you, but if possible it’s better if you do it your self because you never know whan you might need to do something similar in the future, so it’s good to learn.



UKAV

Hi There UKAV

Thank you once again, you have been a great help. I let you no if i have problems with the setup





Thanks

Hi UKAV

Thank you so much for your help and telling me about smartftp. It all worked out great and not too hard even for me. I can’t wait to try to add something else to my sight. I will defiantly ask you for help next time and thank you for offering your help



Thanks again