• Resolved Carlos Faria

    (@frendeliko)


    After 2.0.1 update, the plugin loads ywgc-frontend.js with the following line:

    ln:20

    
    datePicker.datepicker({dateFormat: ywgc_data.date_format, minDate: +1, maxDate: "+1Y"});
    

    ywgc_data is not declared in all pages firing that error and blocking all javascript to work properly.

    ywgc_data is declared in plugins/yith-woocommerce-gift-cards/lib/class-yith-ywgc-frontend.php but the function is loading the scripts on product, cart, checkout, and account_page. It also has a filter (yith_ywgc_do_eneuque_frontend_scripts) were you can force to always declare frontend scripts, but that’s not the best as there are locations where you don’t wan’t this.

    Can you replace your script to check if variable ywgc_data is defined on ywgc-frontend.js before trying to use it?

    The temporary fix for me is apply this filter, but, as I mentioned, not the best solution:

    
    add_filter( 'yith_ywgc_do_eneuque_frontend_scripts', '__return_true' );
    

    Thank you!!

    • This topic was modified 5 years, 1 month ago by Carlos Faria.
    • This topic was modified 5 years, 1 month ago by Carlos Faria.
    • This topic was modified 5 years, 1 month ago by Carlos Faria.

    The page I need help with: [log in to see the link]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hello there,
    hope you are doing well! ??

    Thanks for letting us know about this issue, we will check and fix it in the next plugin version.

    If you have any other issue let us know and we will be happy to help you.

    Have a nice day!

    Thread Starter Carlos Faria

    (@frendeliko)

    No problem!

    Thank you for your answer ;D

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘ywgc_data is not defined’ is closed to new replies.