Enabling WordPress toolbar with Woocommerce installed

I have developed a site which has worked perfectly until now – I’ve installed Woocommerce, along with Simple Auctions plugin to allow reverse auctions, however by default Woocommerce disables the standard toolbar in wordpress.

As I have buddypress installed alongside this, I want to keep the toolbar, and allow users to edit their profiles and see notifications, but it seems by default, woocommerce doesn’t allow this.

Read More

Does any know where to find the code in the Woocommerce plugin, to be able to disable this function and allow Woocommerce and the tool bar to work alongside either other without issue. It seems there are plenty of existing plugins and code snippets to disable the bar, but not to re-enable it, or how to re-enable after woocommerce removes it.

As the admin, I know I have access to the tool bar – but I want subscribers etc to have access to the default bar as well.

Many thanks in advance as to pointing me in the right direction.

Related posts

Leave a Reply

1 comment

  1. I found the filter hook woocommerce_disable_admin_bar inside the file /plugins/woocommerce/includes/wp-customer-functions.php.

    Adding the following plugin in your site should do it:
    (untested)

    <?php
     /**
      * Plugin Name: (WooCommerce) Admin Bar for All
      * Plugin URI:  http://stackoverflow.com/a/22725557/1287812
      * Author:      brasofilo
      */
    
    add_action( 'plugins_loaded', function() 
    {
        add_filter( 'woocommerce_disable_admin_bar', '__return_false' );
    });
    
    /* Alternative (maybe add it inside 'plugins_loaded' hook) */
    // remove_filter( 'show_admin_bar', 'wc_disable_admin_bar', 10 );