Skip to content
Advertisement

Enable user local time in Woocommerce Cart and Checkout date time display

For a bookings website I have activated ‘Timezones’. The visitor’s local time should be displayed. In the booking form everything is working fine. The cart data ($start_time, $end_time) is not being displayed correctly when using the function below.

JavaScript

The output of $start_time and $end_time should be displayed in the visitor’s local time. How can I achieve this?

Advertisement

Answer

@LoicTheAztec: Thanks for the update. Still not working. I’ve updated the code based on file ‘class-wc-booking-cart-manager.php’:

JavaScript

With this code step 1 to step 4 in your first comment are not necessary. Tested and it works!

User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement