Viewing 8 replies - 1 through 8 (of 8 total)
  • Thread Starter Dmitry_Demir

    (@dmitry_demir)

    By the way, I’m making a custom theme that is based on this one: https://ww.wp.xz.cn/themes/blankslate/

    I also removed all the unneeded files (mostly CSS and JS), so maybe this plugin depends on some excluded JS?

    Thread Starter Dmitry_Demir

    (@dmitry_demir)

    There seems to be some conflict with another plugin: Smart Variations Images (https://ww.wp.xz.cn/plugins/smart-variations-images/)

    The error occurs only when both plugins are active.

    Plugin Author wpdevstudio

    (@wpdevstudio)

    The error comes in frontend ?

    Thread Starter Dmitry_Demir

    (@dmitry_demir)

    Yes, and while the error is triggered by Smart Variations Images plugin, the reason seems to be in this plugin, because when it’s active it somehow messes up the variations add-to-cart form, the markup there is wrong… The quotes inside of a data-product_variations attribute turn from " into ” (isn’t esc_attr made to prevent this? It is used on this attribute’s value in variable.php…) and that causes the mess in html, which in turn breaks the form and so the add-to-cart functionality doesn’t work properly (and then the JS error comes).

    I’ve tried it with Storefront theme and the result is the same, so it looks like it doesn’t have to do with my theme… I’ll write here if I manage to find the reason and the solution, but I’m quite puzzled at the moment.

    Thread Starter Dmitry_Demir

    (@dmitry_demir)

    If I comment out this line
    add_filter("attribute_escape", array($this,"change_insert_button_text"), 10, 2);
    The problem disappears. Can you tell me what exactly is this function used for?

    Thread Starter Dmitry_Demir

    (@dmitry_demir)

    By the way, attribute_escape seems to be deprecated.

    Plugin Author wpdevstudio

    (@wpdevstudio)

    fixed this in latest version . please pull updates

    Thanks

    Thread Starter Dmitry_Demir

    (@dmitry_demir)

    Thanks for informing!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘JS error on plugin activation’ is closed to new replies.