Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Time Zone Offset Contribution Support


dr_lucas

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

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 64
  • Created
  • Last Reply

Top Posters In This Topic

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.

Link to comment
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.

Link to comment
Share on other sites

  • 5 months later...
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.

Link to comment
Share on other sites

  • 1 month later...
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.

Link to comment
Share on other sites

  • 1 month later...

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

Link to comment
Share on other sites

  • 1 year later...

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.

Link to comment
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.

Link to comment
Share on other sites

  • 4 weeks later...

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]

Link to comment
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 ======>>>>>.

Link to comment
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 ======>>>>>.

Link to comment
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

Link to comment
Share on other sites

  • 1 year later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...