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' ); // Check if the Infinite Loader class exists. function buddyx_add_body_class_for_infinite_loade( $classes ) { if ( class_exists( 'Infinite_Loader_For_Woocommerce' ) ) { if (is_post_type_archive('product') || is_product_category() || is_product_tag()) { $classes[] = 'infinite-loader-active'; } } return $classes; } add_filter( 'body_class', 'buddyx_add_body_class_for_infinite_loade' );