frontends icon indicating copy to clipboard operation
frontends copied to clipboard

[BUG] Different order date hour in order confirmation email

Open mdanilowicz opened this issue 10 months ago • 4 comments

Current Behavior

There is a difference in the time of placing the order in the email confirming the order between storefront and API order

Frontends Image

Storefornt Image

This difference is caused by the lack of the timezone cookie in frontend calls. By default, the email template uses the en_GB timezone, and this explains why there is 1 hour difference.

To decide whether it should be handled on the backed side - by removing this solution with timezone or Frontends by adding cookie

Expected Behavior

No response

Steps To Reproduce

No response

Anything else?

No response

mdanilowicz avatar Feb 24 '25 19:02 mdanilowicz

Via the store API, you get the UTC dates from the DB. You need to calculate them for the user based on the timezone you get from the browser/cookie. There is no logic for store API routes that handles that for you.

In the default Twig storefront, a Twig Listener looks for the browser's timezone cookie to set the correct timezone in PHP. src/Storefront/Framework/Twig/TwigDateRequestListener.php

BrocksiNet avatar Feb 25 '25 07:02 BrocksiNet

@BrocksiNet should we wait for Your fix or should We do some changes in frontends ?

ghost avatar Mar 04 '25 09:03 ghost

I would not wait; the fix in the core will take more time. You can also fix it in Frontend.

BrocksiNet avatar Mar 05 '25 08:03 BrocksiNet

Ok. Can You explain what should be fixed in frontends ?

ghost avatar Mar 05 '25 08:03 ghost