<?php $out_of_stock = sprintf( '<a class="out-of-stock" title="%s">%s</a>', $label, $label ); ?> <?php } else { ?> <?php $add_to_cart = ''; $out_of_stock = ''; // plugin catalog mode fix if ( is_catalog_mode_installed() && ( !WC_Catalog_Restrictions_Filters::instance()->user_can_purchase( $product ) ) ) { global $wc_cvo; // add to cart alternative text $label = wptexturize($wc_cvo->setting('wc_cvo_atc_text')); if (!empty($label)) { $link = get_permalink($product->ID); $link_add=sprintf('<a href="%s" data-product_id="%s" class="button product_type_%s">%s</a>', $link, $product->id, $product->product_type, $label); $add_to_cart = $link_add; } }
} /* shop */ add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 10 ); remove_action( 'woocommerce_before_main_content', 'woocommerce_breadcrumb', 20, 0 ); remove_action( 'woocommerce_pagination', 'woocommerce_catalog_ordering', 20 ); remove_action( 'woocommerce_before_shop_loop', 'woocommerce_catalog_ordering', 30 ); remove_action( 'woocommerce_before_shop_loop', 'woocommerce_result_count', 20 ); add_filter( 'woocommerce_star_rating_size', 'yit_product_rate_size' ); add_filter( 'woocommerce_star_rating_size_shop_loop', 'yit_product_rate_size' ); add_filter( 'woocommerce_star_rating_size_sidebar', 'yit_product_rate_size' ); add_filter( 'woocommerce_star_rating_size_size_recent_reviews', 'yit_product_rate_size' ); remove_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_rating', 5 ); add_filter( 'yith-wcan-frontend-args', 'yit_wcan_change_pagination_class' ); if(is_catalog_mode_installed()){ // disable the remove action of the plugin add_action( 'woocommerce_after_shop_loop_item', 'woocommerce_template_loop_add_to_cart', 999 ); // delete add to cart button of the plugin add_filter("catalog_visibility_alternate_add_to_cart_link",create_function( '', '' ),999); } add_action( 'init', 'yit_plugins_support' ); /* quick view compatibility */ if ( function_exists( 'YITH_WCQV_Frontend' ) ) { $quick_view = YITH_WCQV_Frontend(); $position = isset($quick_view->position) ? $quick_view->position : 'add-cart';