Home Forums WoodMart support forum Local time in woodmart.

Local time in woodmart.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #515852

    Matimti
    Participant

    I 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 theme

    add_filter( ‘woodmart_wp_timezone_element’, ‘__return_true’ ); ”

    Attachments:
    You must be logged in to view attached files.
    #515864

    Artem Temos
    Keymaster

    Hello,

    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
    Elementor

    Thank you in advance

    #515983

    Matimti
    Participant

    I 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.

    #515988

    Matimti
    Participant

    To 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.

    #516015

    Artem Temos
    Keymaster

    Great, we are glad that you sorted it out. Thank you for sharing the information with us.

    Kind Regards

Viewing 5 posts - 1 through 5 (of 5 total)