Title: Hide
Last modified: August 22, 2016

---

# Hide

 *  Resolved [wp](https://wordpress.org/support/users/ashraf-jibrael/)
 * (@ashraf-jibrael)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/hide-11/)
 * Please,
    I need your help. I installed the plugin: woo commerce for WordPress.
   And the cart icon now on my Menu Bar. I want hide the cart tab icon when the 
   cart is empty : [http://grab.by/AykC](http://grab.by/AykC) I did it also the 
   following : [http://grab.by/Ayuu](http://grab.by/Ayuu)
 * I think the plugin is not compatible with wordpress version 4.
    Regards A.J.
 * [https://wordpress.org/plugins/woocommerce-menu-bar-cart/](https://wordpress.org/plugins/woocommerce-menu-bar-cart/)

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

 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/hide-11/#post-5318533)
 * Hello A.J.
    Please post your issues in one thread! You have now opened three 
   threads after each other!
 * The plugin is definitely compatible with WP4.0, what you saw was probably just
   AJAX or browser cache! When you have changed these settings, you need to close&
   reopen the browser tab for the changes to take effect.
 * To redirect to a different page, you need to add a filter to your theme’s functions.
   php. Check out the instructions under “Change Empty Cart Redirection” on this
   page:
    [https://wpovernight.com/faqs/category/menu-cart-pro/](https://wpovernight.com/faqs/category/menu-cart-pro/)
   That FAQ is for the pro version, but that specific section also works for WP 
   Menu Cart Pro.
 * Good luck & let me know if you have any other questions.
 * Ewout
 *  Thread Starter [wp](https://wordpress.org/support/users/ashraf-jibrael/)
 * (@ashraf-jibrael)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/hide-11/#post-5318543)
 * Thanks sir for your feedback,
    I want to redirect to another page , WHEN I will
   click on Tab Menu Cart:,
 * I mean, it is empty(only when my item: 0, price: 0,).
    Please check: 1- I unchecked
   the : [http://grab.by/AyO8](http://grab.by/AyO8)
 * And , when i check my site i saw:
    [http://grab.by/AyO4](http://grab.by/AyO4)
 * 2- I added the following in my functions.php file
    add_filter(‘wpmenucart_emptyurl’,‘
   add_wpmenucart_emptyurl’, 1, 1); function add_wpmenucart_emptyurl ($empty_url){
   $empty_url = ‘[https://google.com/&#8217](https://google.com/&#8217);; return
   $empty_url; }
 * But i redirect to the shop page.
 * Please, how can i fix this issue ?
 * Regards
    A.J.
 *  Thread Starter [wp](https://wordpress.org/support/users/ashraf-jibrael/)
 * (@ashraf-jibrael)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/hide-11/#post-5318546)
 * Please,
    Can do give the if condition for my Cart when it is empty. I will use
   the css to hide this section?
 * Best regards
    A.J.
 *  Thread Starter [wp](https://wordpress.org/support/users/ashraf-jibrael/)
 * (@ashraf-jibrael)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/hide-11/#post-5318547)
 * I tried:
    ON my custom-admin.css: li#wpmenucartli.wpmenucart-display-standard
   menu-item menu-item-type-post_type.menu-item-object-page.ss-nav-menu-item-depth-
   0.ss-nav-menu-reg.um-flyout-align-center{ display: none !important; }
 * function add_wpmenucart_emptyurl ($empty_url) {
    wp_enqueue_style(‘my-admin-style’,
   get_template_directory_uri() . ‘/custom-admin.css’); $empty_url = ‘[http://www.google.com/&#8217](http://www.google.com/&#8217);;
   return $empty_url; } if ( sizeof( $woocommerce->cart->cart_contents ) == 0 ) {
   add_filter(‘wpmenucart_emptyurl’, ‘add_wpmenucart_emptyurl’, 1, 1); }
 * But it is not working also.
 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/hide-11/#post-5318558)
 * Without a link to your site I’m afraid I cannot help much. But I’ll repeat what
   I wrote in my first response:
 * > When you have changed these settings, you need to close & reopen the browser
   > tab for the changes to take effect.
 * This is also true for the filters!
 * With your code I have three remarks:
    - `$woocommerce` needs to be defined (try `global $woocommerce` first)
    - The filter is already limited to the empty cart (hence the filter name), so
      the if statement is not going to make a difference
    - It’s not necessary to load the complete admin css!
 *  Thread Starter [wp](https://wordpress.org/support/users/ashraf-jibrael/)
 * (@ashraf-jibrael)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/hide-11/#post-5318561)
 * wow , Fixed.
    Thank you so much sir.
 * Best regards
    A,J,
 *  Plugin Contributor [Ewout](https://wordpress.org/support/users/pomegranate/)
 * (@pomegranate)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/hide-11/#post-5318570)
 * That’s great! What fixed it, precisely?
 *  Thread Starter [wp](https://wordpress.org/support/users/ashraf-jibrael/)
 * (@ashraf-jibrael)
 * [11 years, 8 months ago](https://wordpress.org/support/topic/hide-11/#post-5318571)
 * I mean the tab Menu is hidden , when the Cart is empty.
    I did exact what you
   said above.
 * Thanks sir.

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

The topic ‘Hide’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-menu-bar-cart/assets/icon-256x256.png?rev=2190481)
 * [Menu Cart for WooCommerce](https://wordpress.org/plugins/woocommerce-menu-bar-cart/)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-menu-bar-cart/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-menu-bar-cart/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-menu-bar-cart/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-menu-bar-cart/reviews/)

 * 8 replies
 * 2 participants
 * Last reply from: [wp](https://wordpress.org/support/users/ashraf-jibrael/)
 * Last activity: [11 years, 8 months ago](https://wordpress.org/support/topic/hide-11/#post-5318571)
 * Status: resolved