cart->cart_contents_count > 0 ) { // Enqueue WooCommerce cart script. wp_enqueue_script( 'woocommerce-cart' ); } ?>
cart->get_cart_contents_count() > 0 ) { // Update the cart icon fragment with the current cart contents count. $fragments['.menu-icons-wrapper .cart a'] = '' . esc_html( WC()->cart->get_cart_contents_count() ) . ''; } return $fragments; } } // Disable WooCommerce sidebar. if ( ! function_exists( 'buddyx_disable_woo_commerce_sidebar' ) ) { /** * Removes the default WooCommerce sidebar. * This function is hooked to the 'init' action to ensure it runs after WooCommerce is fully loaded. * It removes the 'woocommerce_get_sidebar' function from the 'woocommerce_sidebar' action hook. */ function buddyx_disable_woo_commerce_sidebar() { // Remove the default WooCommerce sidebar. remove_action( 'woocommerce_sidebar', 'woocommerce_get_sidebar', 10 ); } } // Hook the function to the 'init' action. add_action( 'init', 'buddyx_disable_woo_commerce_sidebar' );