Home › Forums › WoodMart support forum › Necessary script for plugin not loading (YITH WooCommerce Product…
Necessary script for plugin not loading (YITH WooCommerce Product…
- This topic has 31 replies, 3 voices, and was last updated 5 hours, 45 minutes ago by
Luke Nielsen.
-
AuthorPosts
-
April 23, 2025 at 5:14 pm #656140
BPPParticipantHi 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 HofstetterApril 24, 2025 at 9:11 am #656238
Artem TemosKeymasterHello,
Try to disable custom layouts for cart and checkout in WoodMart -> Layouts and test how it works.
Kind Regards
April 24, 2025 at 9:13 am #656240
BPPParticipantI’ve tried, it does not work with the standard Layouts.
kind regards
April 24, 2025 at 9:19 am #656246
Artem TemosKeymasterPlease 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.
April 24, 2025 at 9:55 am #656259
BPPParticipantI’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.April 24, 2025 at 11:53 am #656307
Artem TemosKeymasterWe just checked your website and see that this script is loaded on the cart page. Here is a screenshot https://gyazo.com/6c53293760bc4fbd76d6d5782278719d
April 24, 2025 at 12:06 pm #656315
BPPParticipantI’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.
April 25, 2025 at 9:57 am #656513
Artem TemosKeymasterHello,
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
April 30, 2025 at 12:45 pm #657500
BPPParticipantHi 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
ChrisAttachments:
You must be logged in to view attached files.April 30, 2025 at 12:48 pm #657502
Artem TemosKeymasterHello,
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
April 30, 2025 at 4:16 pm #657570
BPPParticipanti 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?
May 1, 2025 at 9:18 am #657692
Artem TemosKeymasterWe don’t see the alert added to the file at the moment. Could you please send us a screenshot where you added it?
May 1, 2025 at 11:41 am #657749
BPPParticipantwhere should i add that alert exactly?
May 1, 2025 at 1:35 pm #657779
Artem TemosKeymasterYou need to add it to the first line in this file. Then clear your browser cache and test how it works.
May 1, 2025 at 3:39 pm #657800
BPPParticipantI’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?May 1, 2025 at 4:42 pm #657816
Artem TemosKeymasterAs 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.
May 1, 2025 at 4:50 pm #657822
BPPParticipantTrue – 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…
May 2, 2025 at 9:00 am #657897
Artem TemosKeymasterIt’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.
May 2, 2025 at 11:24 am #657940
BPPParticipantThat would be great, looking forward to hear from you.
May 2, 2025 at 11:44 am #657945
Artem TemosKeymasterTo 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.May 2, 2025 at 1:03 pm #657976
BPPParticipanti ‘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=45May 2, 2025 at 2:05 pm #657990
BPPParticipantPlease also tell me when i can deactivate that alert again as it’s very annoying when working on the site.
May 2, 2025 at 2:20 pm #657999
BPPParticipantI 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.
May 2, 2025 at 3:03 pm #658027
Artem TemosKeymasterNow 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.May 2, 2025 at 3:08 pm #658031
BPPParticipanti 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.
May 2, 2025 at 3:15 pm #658036
Artem TemosKeymasterIt 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.
May 7, 2025 at 11:47 pm #659014
BPPParticipantIf 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.
May 8, 2025 at 9:18 am #659074
Artem TemosKeymasterHello,
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/546ad07cb9385d13f63e00bdef857aeaKind Regards
May 13, 2025 at 2:34 pm #660351
BPPParticipantNow 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
ChrisMay 13, 2025 at 3:02 pm #660359
Artem TemosKeymasterYou can disable zoom for single product page only using our custom presets. Read more here https://xtemos.com/docs-topic/theme-settings-presets/
-
AuthorPosts
Tagged: product options, Script not Loading, YITH
The topic ‘Necessary script for plugin not loading (YITH WooCommerce Product…’ is closed to new replies.
- You must be logged in to create new topics. Login / Register