Home › Forums › WoodMart support forum › Local time in woodmart.
Local time in woodmart.
- This topic has 4 replies, 2 voices, and was last updated 1 year, 3 months ago by
Artem Temos.
-
AuthorPosts
-
November 27, 2023 at 12:59 pm #515852
MatimtiParticipantI have a problem that has already been posted on the forum. Namely, the timers work based on universal time, not local time as I would like. This is relatively problematic. I used the code below for the child theme, but unfortunately the same problem still occurs. Is it possible to modify this code somehow to make the counters work based on local time? Woodmart timers are added using Elementor Pro.
“Hello,
We using GMT timezone for that element. If you want to use WordPress timezone, add the following code snippet to the functions.php file in your child themeadd_filter( ‘woodmart_wp_timezone_element’, ‘__return_true’ ); ”
Attachments:
You must be logged in to view attached files.November 27, 2023 at 1:14 pm #515864
Artem TemosKeymasterHello,
Please, disable all plugins that are not related to our theme and provide us with your admin access. We will log in and check what is wrong there. You can leave only the following plugins that are required for our theme:
WoodMart core
WooCommerce
ElementorThank you in advance
November 27, 2023 at 5:02 pm #515983
MatimtiParticipantI pasted this code: it didn’t work, then I re-pasted it to the first few lines of the child theme’s function.php file from the top, and I noticed that after re-pasting, the appearance of the quotation marks changed, as shown below – it works.
Please note that these are two different quotation marks:
add_filter( ‘woodmart_wp_timezone_element’, ‘__return_true’ ); ( this code is ok)
add_filter( ‘woodmart_wp_timezone_element’, ‘__return_true’ );
The difference between these quotation marks is crucial in programming:
Straight Quotation Marks: ‘ ‘ – These are standard quotation marks used in most programming languages, including PHP. They are straight-lined and look the same at both the beginning and the end of a string. For example: ‘__return_true’.
Curly or Typographic Quotation Marks: ‘ ’ – These quotation marks are often used in printed texts and have an aesthetic, slightly curved shape. They differ at the beginning and end of a string. However, in the context of programming, these quotation marks can cause errors because the programming language interprets them differently from the standard straight quotation marks. They are not recognized as proper syntax for defining strings in languages like PHP.
In your case, changing from curly to straight quotation marks corrected the syntax error, enabling the code to work properly.
November 27, 2023 at 5:06 pm #515988
MatimtiParticipantTo sum up, the code works, you just need to pay attention to the type of quotation marks – at least that was the case in my case.
November 27, 2023 at 5:25 pm #516015
Artem TemosKeymasterGreat, we are glad that you sorted it out. Thank you for sharing the information with us.
Kind Regards
-
AuthorPosts
- You must be logged in to create new topics. Login / Register