@galbaras
Please try the filter. The first filter allows you to load files on the product and the second filter loads CSS on the product page and category pages.
add_filter( 'disable_wvs_enqueue_scripts', function(){
// Load only product page. Return true to disable.
return ! is_product();
} );
//Or
add_filter( 'disable_wvs_enqueue_scripts', function(){
// Load only shop or product page. Return true to disable.
return ! (is_product() || is_shop());
} );
Previously, we try to load the swatches elements where the WooCommerce Variation script loads. But page builder does the difference to show the swatches anywhere on the site. So, we have to take this decision.
Thank You
-
This reply was modified 5 years, 3 months ago by
pluginswoo.
-
This reply was modified 5 years, 3 months ago by
pluginswoo.
@pluginswoo Thank you for the filters, but I think the default should be only to load on product pages, and changing this global loading should be a setting, not a filter.
Also, you can add detection of shortcodes, blocks, etc that require resources and load them then.
Performance is very important these days, and reducing performance for many sites that don’t use page builders takes them back a step.