• Home
  • Cloud
    • General
    • SaaS
    • BPaaS
    • PaaS
    • IaaS
    • Other Internet Hosted Applications
      • WordPress
        • WooThemes Canvas
          • WooThemes Canvas CSS
  • About me
  • Why Badly Wired?
  • Contact

Badly Wired

WordPress Security, Plugins, Hosting, Performance, APIs

You are here: Home / Code snippets / How to remove WP Bakery from WooCommerce shop page

How to remove WP Bakery from WooCommerce shop page

7th November 2019 by Alan Leave a Comment

Problem with jQuery date picker and The7 theme

The issue

The problem was a date picker ( jquery ui datepicker ) provided by a small add on plugin was not operating correctly on a WooCommerce shop page withing a theme that has baked in WP Bakery ( The7 theme ).

The investigation

The obvious place to look was the date picker plugin, but serious debugging and complete review of the code, although not well written with a few issues, nothing that could resolve the issue.

The next step was simplification, and the creation of the most minimal version of a date picker.

After a variety of tests it became clear that there was something corrupting the functionality of jQuery / date-picker. With strange situation that is could works when the selector was a class but not an ID.

Further process of elimination indicated this corruption occurred only when 4 planets aligned

  1. The theme The7 ( or its child) was active
  2. WP Bakery plugin was active
  3. WooCommerce was active
  4. The page was the Woo Shop page

Despite clearly a theme responsibility ( as it did not occur when a default WP theme was active ) the theme support was not willing to accept this and simply deflected to the other components and would not take on further investigation.

Unfortunately, all of the 3 components are very large complex pieces of code and despite some attempts to eliminate, it became clear without the resources of the theme author, resolution was becoming uneconomic and solution that avoided the problem, rather than solved the conflicts was required.

The options

  1. Change theme
  2. Don’t use WP bakery
  3. Use a different date picker UI than jQuery

All of these seemed expensive options, however after some thought, it was noted that WP Bakery did not add any value to the shop page, as this was formatted totally by the theme and WooCommerce.

So the approach was taken to disable WP Bakery just on the Shop page.

Implementation

Remove WP Bakery Shortcodes

The Shop page contained an empty section of WP Bakery short codes. The solution here is simple, go to the shop page, switch to classic editor and delete the shortcodes.

Remove WP Bakery code from the Shop page

This is achieved by an mu-plugin ( must use plugin ). Create a file e.g. dont-load-bakery.php in the folder wp-content/mu-plugins and add the following code

Summary

Sometimes the only economic solution is to avoid a problem rather than try and resolve the root cause. It hurts me to do this as I still feel the problem ‘won’ but the client has a working solution again.

Filed Under: Code snippets, Wordpress, WordPress Plugins  Tagged: jQuery, plugins, WooCommerce, WP Bakery

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • Applications
  • Cloud
    • General
    • Google Cloud
    • IaaS
    • Other Internet Hosted Applications
      • Wordpress
        • WooThemes Canvas
        • WooThemes Canvas CSS
    • SaaS
  • Code snippets
  • Discounts
  • Genesis
  • Google Apps for Works
  • Linux
  • News
  • SEO
  • Server setup
  • Services
  • Tech Tips
  • Uncategorised
  • Useful Images
  • Useful Stuff
  • WordPress Plugins

Tags

background jobs beadcrumbs bind brandings Cache canvas Centos chrome css fail2ban Find firefox Flash fraud genesis gocardless godaddy Google google maps hackers internet explorer javascript KashFlow Linus linux Magento mapquest maps microsoft mysql news nohup php plugin plugins queens diamond jubilee replace SED SEO skype Varnish Virtualmin Webmin woothemes Wordpress

 

Affiliate and Privacy Notices

This site is free to use, but hopes to cover some costs through affiliate income, some products and links are affiliates and may earn the site advertising income.

Some affiliates use Cookies to track if you purchase from them, this allows them to apportion revenue to us you will need to refer to their specific privacy notices as to how you are tracked.

This site is a participant in the Amazon EU Associates Programme, an affiliate advertising programme designed to provide a means for sites to earn advertising fees by advertising and linking to Amazon.co.uk.

  • Privacy Policy

Copyright © 2019 · Badly Wired