Jump to content
Sign in to follow this  
dr_lucas

Time Zone Offset Contribution Support

Recommended Posts

Hello, I'm getting the following error in checkout_process.php when my customers use paypal to pay:

 

1064 - You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'where date_format(store_history_date, '%Y%m%d') = date_format(

update store_history set amount_orders = amount_orders + 1, amount_products = amount_products+1, orders_price=orders_price+ where date_format(store_history_date, '%Y%m%d') = date_format(now(), '%Y%m%d')

[TEP STOP]

 

I have modified paypal.php to include the same changes as made to checkout_process.php

 

any thoughts?

 

thanks!

 

Scott

 

Figured out the issue - it was not with time Zone, but with a contrib called Stats v3 - you just should NOT copy the lines inserted into checkout_process.php into paypal.php

 

Scott

Share this post


Link to post
Share on other sites
This is my first contribution (and first post too!)

 

I have made the changes required to get the order confirm emails as well as order status changes working. In addition, the date that appears in the footer has been fixed too. I have written a function to get the current database time and add the offset to it. You can then use it whenever you need the offset time (even outside of this contrib)

 

For people that are finding that the date is not changed in every place, I have added a comment at the end of the instructions. The most important parts of the application are fixed here (emails and visible date on site). You will need to modify a lot of files if you want to fix everything!

 

Thanks dr_lucas for your contribution. To be honest, from what I have read, the TZ is mostly ignored. I rely on the database date and add the offset and it seems to all work OK.

 

Contribution located at http://www.oscommerce.com/community/contributions,4156

 

 

 

Thanks for your contribute marty, works great! Do you have a solution for the time/date in the admin control panel/orders as well?

 

Cheers.

Share this post


Link to post
Share on other sites
Thanks for your contribute marty, works great! Do you have a solution for the time/date in the admin control panel/orders as well?

 

Cheers.

 

Yeah well i've just had a second look and as mentioned before - it's the database time which doesn't change. Mind to guide?

 

 

Cheers.

Share this post


Link to post
Share on other sites
You are right about that, it's the same on my system, with the old mod, and it's because its' code isn't standard osCommerce code. It also does not use the now() function, and that is why the time and date are showing in PST instead of Central. I am also using the excellent user tracking contribution (http://www.oscommerce.com/community/contributions,1055) and it works fine there simply because it's written according to osC standards...

 

You may want to replace your visitors mod with the updated one:

http://www.oscommerce.com/community/contributions,4067

 

 

I have this mod installed as well and the times in the visitor plugin are NOT being effected by the TZ offset.

 

Also, when order emails are generated and mailed I am still seeing the original server time on the emails instead of the offset time.

 

Any help/suggestions would be greatly appreciated.

Share this post


Link to post
Share on other sites
I have this mod installed as well and the times in the visitor plugin are NOT being effected by the TZ offset.

 

Also, when order emails are generated and mailed I am still seeing the original server time on the emails instead of the offset time.

 

Any help/suggestions would be greatly appreciated.

 

You should revise all occurences of now() in your /catalog/includes/visitors_count.php file to be as suggested in marty's latest update to this mod.

Share this post


Link to post
Share on other sites

Hi,

 

Just installed this contribution!! well done, works well to a point, that is if your time zone is in a whole hour ie +2 or -2 but what about if your time zone is +2.5 or -2.5??

I have managed to get the TZ to match from my hosted server... as in correct local time for server, but how do I set this in admin to get the correct local time for orders etc as my times are always 30 mins out with the server time!!!

 

any suggestions or help on this would be great, Thanks

Share this post


Link to post
Share on other sites

Hi all, I hope this contrib is still supported in this treat.

 

I got problem in footer or actually in the way it show date in footer as it is shown thice.

 

Has anyone got any idea where is mistake?

 

I will be appreciated for any clue.

Share this post


Link to post
Share on other sites

Anyone, any idea?

Maybe someone is still using this contribution?

If not, which one would you recommend?

 

regards

Share this post


Link to post
Share on other sites
Anyone, any idea?

Maybe someone is still using this contribution?

If not, which one would you recommend?

 

regards

 

ok, i found where was the problem,

 

I did not recognize correctly where php ends and tried to comment part of code using html comment metod.

Share this post


Link to post
Share on other sites

Have installed this patch - works great in the admin panel - however when I go to the site it displays the following message and I cant get any further.

 

PLEASE HELP

 

1298 - Unknown or incorrect time zone: 'CONFIG_TIME_ZONE'

 

SET time_zone='CONFIG_TIME_ZONE'

 

[TEP STOP]

Share this post


Link to post
Share on other sites

Did you run the sql steps in the installation process?


Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Share this post


Link to post
Share on other sites

No :blink: which part of the install should be run in sql????

 

I have just re-read everything and no mention of running any part - YES, I'm still learning.

Share this post


Link to post
Share on other sites

Just had a look at 5432 and it is not sql but

 

5. in the file catalog\includes\configure.php add the following code to the end of the file, but before the ending ?> :-

 

define('CONFIG_TIME_ZONE', '+10:00'); // add 10 hours to the time in mysql server. Your location may require some other value

 

6. in the file catalog\admin\includes\configure.php add the following code to the end of the file, but before the ending ?> :-

 

define('CONFIG_TIME_ZONE', '+10:00'); // add 10 hours to the time in mysql server. Your location may require some other value


Need help installing add ons/contributions, cleaning a hacked site or a bespoke development, check my profile

 

Virus Threat Scanner

My Contributions

Basic install answers.

Click here for Contributions / Add Ons.

UK your site.

Site Move.

Basic design info.

 

For links mentioned in old answers that are no longer here follow this link Useful Threads.

 

If this post was useful, click the Like This button over there ======>>>>>.

Share this post


Link to post
Share on other sites

Thanks heaps for your response.

 

Im in Oz too and the +10:00 suits me fine.

 

I followed all the steps dilligently including the ones you mentioned, and still got the error.

 

Whilst undoing all the changes, I thought about the +10:00 - this would put us Aussies out during daylight saving time - when we have it the difference is +11:00 and when we go off and you guys go on then its +9:00. This would mean having to do a manual adjustment at the start and end of Daylight Savings Time.

 

Did a quickie fix, good enough for me -

The files named in steps 1 and 2 being the two english.php - close to the top of the file, I comented out

setlocale(LC_TIME, 'en_US.ISO_8859-1'); and inserted on the next line

putenv("TZ=Australia/Victoria"); //this being appropriate for my area.

 

It works perfectly everywhere, except and there is always one - In Admin Customer Orders the date is correct but but the time is about 5 hours behind. Everything else that I have tested, incl emails had the time spot on to my local time.

 

I think that I am happy with that.

 

Thanks again

Tanya

Share this post


Link to post
Share on other sites

Hello,

 

Will be possible to add this fix en categories.php?

 

When I add or udpate a product, it take the server time...

 

Regards!!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×