• Hi,
    This is really very helpful plugin, it really helps decluttering and speeding up the website, next to that it increases SEO score on pagespeed as well.

    Unfortunately in my case to have full benefits of the optimisation the plugin is offering (Disable WooCommerce scripts and styles) would be handy to be able to specify which pages to include so that scripts and styles work on there as well.

    In instance when one is using calls or builder elements to display products on homepage or elsewhere, layout breaks.

    Currently I have (Disable WooCommerce scripts and styles) option switched off, which is a pity as it is actually one of the biggest benefits of the plugin imo.

    If there is some workaround advice to this,
    I’d be very happy to hear any suggestions.

    Big ups

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Contributor ospiotr

    (@ospiotr)

    Hi @daddo

    By default, the option Disable WooCommerce scripts and styles will disable scripts on the all pages, except:
    – cart page
    – checkout page
    – My Account page
    – product pages
    – product category pages
    – shop pages
    – other pages using WooCommerce templates (if detected).

    If you want to add new exception, please uncheck the option Disable WooCommerce scripts and styles in plugin settings and add this custom code to your functions.php file: https://pastebin.com/TQiRbVn0

    Replace 'about-us', 'contact', 'management on the line 6 with your own page IDs or slugs. Cheers!

    Thread Starter Davor Dedic

    (@daddo)

    Thank you for your reply and the code!

    I’m using OxygenBuilder and CodeSnippets plugin to insert functions.
    When adding a new snippet with the code you provided getting an error on line 5.

    Don’t know how familiar are you with Oxygen, but if I am reading you right, there is a chance that it would be possible for your plugin to recognise another Woo Page template made by Oxygen, then just Woo Default pages.

    Kind regards and once again thank you!

    Plugin Contributor ospiotr

    (@ospiotr)

    Dear @daddo

    It seems that Oxygen-built pages are not correctly detected, so you would need to exclude them manually.

    Here’s the fixed code, which should be working now:
    https://pastebin.com/hUJsthFR

    Please remember to replace 'about-us', 'contact', 'management with your own page IDs or slugs https://athemes.com/tutorials/wordpress-page-id-and-post-id/

    Thread Starter Davor Dedic

    (@daddo)

    Sorry to bother you again,
    unfortunately the code still comes with an error in CodeSnippets,

    I’m getting this now:

    The snippet has been deactivated due to an error on line 4:
    Cannot redeclare function wcbloat_disable_woocommerce_scripts.

    WooCommerce scripts and styles option in the plugin settings is disabled from the start, as it was conflicting with my layout on specific pages.

    • This reply was modified 4 years, 3 months ago by Davor Dedic.
    Plugin Contributor ospiotr

    (@ospiotr)

    @daddo
    Oh, sorry about that. You are right – there was an error in the code.

    I have fixed it and pasted it here: https://pastebin.com/raw/bmD9H5RD

    Please copy, modify to your needs and use it in your site.

    WooCommerce scripts and styles option should stay disabled.

    Thread Starter Davor Dedic

    (@daddo)

    @ospiotr Thank you! Works like a charm!

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

The topic ‘Feature Request: Select Pages’ is closed to new replies.