Home Forums WoodMart support forum Necessary script for plugin not loading (YITH WooCommerce Product…

Necessary script for plugin not loading (YITH WooCommerce Product…

Viewing 30 posts - 1 through 30 (of 32 total)
  • Author
    Posts
  • #656140

    BPP
    Participant

    Hi Woodmart Team

    I’ve reached out to the YITH Support with the request below: It’s all about a feature in the cart that let’s you edit product options inside the cart but the Button for that won’t work with woodmart theme.

    ———————————–
    i’m Building a Print-on-Demand Shop with Woocommerce, the Woodmart Theme and your plugin YITH WooCommerce Product Add-Ons & Extra Options.

    I’ve noticed the feature to Edit options in the Cart is not Working on the Woodmart Theme. If i cklick the LInk in the Cart nothings happens while it works fine when tested with storefront.

    Can you fix this compatibility issue for me? This Feature is very important for our use case and the main reason i’ve decided to go with your plugin.

    —————————————

    I wasn’t able to fix it with them because something seems to Block a Script that is needed, can you please assist with this? This is what they have figured out…

    —————————————
    I’ve done some tests, and it seems that something is preventing the plugin from loading the JavaScript files needed for the button in the cart page.
    If you try using another theme, like Twenty Twenty-Four, it works correctly, so I suggest you check the theme and Elementor settings to check why the following file isn’t being loaded.
    wp-content/plugins/yith-woocommerce-advanced-product-options-premium/assets/js/front.min.js
    —————————————

    kind regards
    Christoph Hofstetter

    #656238

    Artem Temos
    Keymaster

    Hello,

    Try to disable custom layouts for cart and checkout in WoodMart -> Layouts and test how it works.

    Kind Regards

    #656240

    BPP
    Participant

    I’ve tried, it does not work with the standard Layouts.

    kind regards

    #656246

    Artem Temos
    Keymaster

    Please disable all plugins that are not related to our theme so we can test this. We will need to switch between themes and check the difference.

    #656259

    BPP
    Participant

    I’ve also tried disabling all but some critical plugins but it still did not work.
    But you are free to check for yourself and also switch Theme for debugging (with storefront it worked).

    I think its best i’ve i grant you access for further tests.
    I’ve also added a screenshot of the plugin overview so you see which plugins should be turned on again after testing.

    As i have a meeting regarding other aspects of the shop right now please don’t change anything for the next hour, after that you are free to Test.

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

    Artem Temos
    Keymaster

    We just checked your website and see that this script is loaded on the cart page. Here is a screenshot https://gyazo.com/6c53293760bc4fbd76d6d5782278719d

    #656315

    BPP
    Participant

    I’ve noticed there is some more specific info on the ticket from the plugin support i haven’t shared yet, sorry – please check below:

    ––––

    The main problem here is that the enqueue_scripts is not executed on your site.

    If you check the following action

    add_action( ‘wp_enqueue_scripts’, array( $this, ‘enqueue_scripts’ ), 11 );

    We use a function hooked on wp_enqueue_scripts in order to register the file and also localize some data stored in the yith_wapo variable.

    Seems your theme or other plugin prevent to enqueue the file and also to pass the data to the js. For this reason you get this error.

    Probably you have a custom code that prevent to execute the do_action(‘wp_enqueue_scripts’)

    I suggest you to check with theme developers in order to understand if you have a custom code or option in order to disable the possibility to enqueue the scripts.

    #656513

    Artem Temos
    Keymaster

    Hello,

    wp_enqueue_scripts is a core WordPress hook and our theme doesn’t remove it. We use it to load all our theme scripts, which work without any issues.

    Kind Regards

    #657500

    BPP
    Participant

    Hi Support Team

    I’ve checked again with yith support and they say the problem still persists. The script was only loaded because force-enqued by a temporary code snippet.

    Please check the full statment in the attached screenshot and reconsider what i might do to get it to work.

    kind regards
    Chris

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

    Artem Temos
    Keymaster

    Hello,

    It doesn’t make much sense. If the file is loaded, then it is executed. You can easily check it by adding the following line of code

    alert('script works');

    If you see the alert when you visit the page, then the script is executed.

    Kind Regards

    #657570

    BPP
    Participant

    i can confirm that the functionality still won’t work even if the script is force enqued. Then there is some error about missing arguments.

    What do you propose i can do to find out what is blocking it to work?

    #657692

    Artem Temos
    Keymaster

    We don’t see the alert added to the file at the moment. Could you please send us a screenshot where you added it?

    #657749

    BPP
    Participant

    where should i add that alert exactly?

    #657779

    Artem Temos
    Keymaster

    You need to add it to the first line in this file. Then clear your browser cache and test how it works.

    #657800

    BPP
    Participant

    I’ve added the alert to the minified javascript.
    It seems to fire on every single page load around the website but NOT in the cart.
    Any ideas?

    #657816

    Artem Temos
    Keymaster

    As we can see, this file is no longer loaded on the cart page. Have you changed anything? As we can understand, you had some custom code to load it on the cart page.

    #657822

    BPP
    Participant

    True – i disabled the snippet that enforced the load of the script because it was never meant to be the solution (even with this snippet enabled the functionality of the yith plugin in the cart was not given).

    But the question is: what prevents the loading of this script on the cart page in the first place? I think solving this will solve the whole problem…

    #657897

    Artem Temos
    Keymaster

    It’s a different question. Plugin developers said that this script is not executed when loaded on the cart page. So we need to investigate this first.

    #657940

    BPP
    Participant

    That would be great, looking forward to hear from you.

    #657945

    Artem Temos
    Keymaster

    To do this, you need to revert the code you had to load the script and add the alert provided above. Than clear your browser cache and test the alrt.

    #657976

    BPP
    Participant

    i ‘ve reactivated the snippet that enforces the scrip load. If it helps to debug that’s fine but remember that i’ would ultimately like to get rid of it. Also I’ve left the alert unchanged it is still active.

    Result is that the alert now fires on the cart page (so the script is enforced) but we were at this point already, it does not solve anything.
    Why won’t the script load under normal circumstances?

    you may toggle the snippet that enforces the script load here if that helps:
    //remax.bacher.swiss/wp-admin/admin.php?page=edit-snippet&id=45

    #657990

    BPP
    Participant

    Please also tell me when i can deactivate that alert again as it’s very annoying when working on the site.

    #657999

    BPP
    Participant

    I removed the alert. I think the information you wanted that it does fire on the cart page when the snippet is active which i can confirm. Tell me if otherwise.

    #658027

    Artem Temos
    Keymaster

    Now we have the answer to the question from this reply https://xtemos.com/forums/topic/necessary-script-for-plugin-not-loading-yith-woocommerce-product/#post-657500
    The script is loaded and executed on the cart page. That is why it should work as expected. You need to continue conversation with plugin’s developers.

    #658031

    BPP
    Participant

    i do not agree entirely – the script should be executed on the cart page by default and not by some janky workaround with a code snippet which i will disable again now.

    I’m pretty confident solving the issue why it won’t load by default on the cart will solve the entire problem and that’s what i’m asking your help for.

    #658036

    Artem Temos
    Keymaster

    It will not solve the problem and we don’t know why it is not loaded by default. If you want, we can give you a custom snippet to fix this loading issue to load the script on the cart page so you can see if it helps.

    #659014

    BPP
    Participant

    If you might help find me the reason why the script does not load on the cart page in the first place that would be the thing i need. Because this should be the the default behaviour and you do at very least need to confirm this problem is not anyhow related to the theme and maybe point me in the right direction towards solving the problem.

    #659074

    Artem Temos
    Keymaster

    Hello,

    We checked it deeper and see that this script depends on the WooCommerce zoom library. And since you disabled this zoom on your website, this script is no longer loaded. You can return default WooCommerce zoom which this plugin relies on in Theme Settings https://gyazo.com/546ad07cb9385d13f63e00bdef857aea

    Kind Regards

    #660351

    BPP
    Participant

    Now that was helpful – thank you!

    it does indeed start to work when the setting is switched. I do not really like the zoom effect on the product images but i guess i can live with that if there is suitable workaround.

    i’m also gonna bring that dependancy to the plugin creators attention.

    kind regards
    Chris

    #660359

    Artem Temos
    Keymaster

    You can disable zoom for single product page only using our custom presets. Read more here https://xtemos.com/docs-topic/theme-settings-presets/

Viewing 30 posts - 1 through 30 (of 32 total)

The topic ‘Necessary script for plugin not loading (YITH WooCommerce Product…’ is closed to new replies.