Tagged: x
-
AuthorPosts
-
November 25, 2016 at 1:48 pm #1270834
Sara H.ParticipantHello!
I was trying to hide woocommerce cart when is empty, I found this: https://community.theme.co/forums/topic/hide-woocommerce-cart-when-empty/
I am having this fatal error now: Fatal error: Cannot redeclare x_woocommerce_navbar_menu_item() (previously declared in /home/rpparadise/www/www/rpparadise/wp-content/themes/x-child/functions.php:29) in /home/rpparadise/www/www/rpparadise/wp-content/themes/x-child/functions.php on line 112
Can you help me?
November 25, 2016 at 1:50 pm #1270835
Sara H.ParticipantThis reply has been marked as private.November 25, 2016 at 1:54 pm #1270838
Sara H.ParticipantI guess its a conflict between:
// Outputs a navigation item with the cart.
and
// Custom Cart menu when uberMenu is active
Can you please advise? thanks!
November 25, 2016 at 5:23 pm #1270950
FriechModeratorHi There,
Thanks for writing in! Would you mind providing us with login credentials so we can take a closer look? To do this, you can make a post with the following info:
– Link to your site
– WordPress Admin username / password
– FTP credentialsDon’t forget to select Set as private reply. This ensures your information is only visible to our staff.
Cheers!
November 27, 2016 at 10:11 am #1272177
Sara H.ParticipantThis reply has been marked as private.November 27, 2016 at 10:33 am #1272208
ThaiModeratorHi There,
I’ve just fixed that issue, there are 2 functions with the same name in your functions.php file.
Cheers!
November 27, 2016 at 1:06 pm #1272325
Sara H.ParticipantHello! thanks a lot!
but… sorry about this but I have my cart empty and I still can see the Woocommerce Cart in my NavBar.
I have this code in my functions.php to hide the cart when is empty, but maybe I am wrong?
// Outputs a navigation item with the cart. // function x_woocommerce_navbar_menu_item( $items, $args ) { if ( X_WOOCOMMERCE_IS_ACTIVE && x_get_option( 'x_woocommerce_header_menu_enable', '' ) == '1' ) { if ( $args->theme_location == 'primary' && WC()->cart->cart_contents_count > 0 ) { $items .= '<li class="menu-item current-menu-parent x-menu-item x-menu-item-woocommerce">' . '<a href="' . x_get_cart_link() . '" class="x-btn-navbar-woocommerce">' . x_woocommerce_navbar_cart() . '</a>' . '</li>'; } } return $items; } add_filter( 'wp_nav_menu_items', 'x_woocommerce_navbar_menu_item', 9999, 2 );I got this code from here: https://community.theme.co/forums/topic/hide-woocommerce-cart-when-empty/
November 27, 2016 at 5:17 pm #1272487
RadModeratorHi there,
Maybe it needs reloading? That can hide it, but not when added through Ajax. And if you will hide the card, how it will then be updated since it’s not there anymore. Or do you wish to remove them permanently?
Thanks!
November 28, 2016 at 11:41 am #1273460
Sara H.ParticipantThe idea is to be hidden when is empty, not permanently is this possible?
November 28, 2016 at 8:05 pm #1274012
FriechModeratorHey There,
It could be possible with custom development, but this would be outside the scope of support we can offer. You may wish to consult a developer to assist you with this. X is quite extensible with child themes, so there are plenty of possibilities.
Thanks for understanding.
-
AuthorPosts
- <script> jQuery(function($){ $("#no-reply-1270834 .bbp-template-notice, .bbp-no-topic .bbp-template-notice").removeClass('bbp-template-notice'); }); </script>
