Hi there,
use following code to apply quick view on all products and deny to access to product page.
Replace in the code my url of example with url of the products you want exclude from this function.
I tried with Twenty Sixteen it works.
if ( !function_exists( 'yith_wcqv_customization_quick_view_on_product_click' ) ) {
add_action( 'wp_enqueue_scripts', 'yith_wcqv_customization_quick_view_on_product_click', 99 );
function yith_wcqv_customization_quick_view_on_product_click() {
$js = "jQuery( document ).on( 'click', '.woocommerce-loop-product__link', function (e) {
var productUrl = jQuery(this).attr('href');
var productUrlToExclude = ['https://support.test/product/belt/','https://support.test/product/beanie-with-logo/'];
if( productUrlToExclude.includes(productUrl) == true ){
return;
}
e.preventDefault();
jQuery( this ).closest( '.product' ).find( '.yith-wcqv-button' ).trigger( 'click' );
});";
wp_add_inline_script( 'yith-wcqv-frontend', $js );
}
}
Regarding the possibility to hide the quick view button for three specific products, we’ll release next week an update that include a filter which allow to do it.
After you’ll have update the plugin, please add following code inthe file functions.php of your theme, replacing my ID of example with the ID of the products for which you want hide quick view button.
add_filter('yith_wcqv_show_quick_view_button','yith_hide_quick_view_button', 10, 2);
function yith_hide_quick_view_button( $show,$product_id ){
$products_to_exclude = array( 15,31 );
if( in_array( $product_id, $products_to_exclude ) )
$show = false;
return $show;
}
Hope to be helpful for you.