Support » Plugin: YITH WooCommerce Request A Quote » Remove Add to quote for Variable Products

  • Can the add to quote be removed on products that are variable? We have some products that can be purchased straight from the site which are all variable, and then the simple products need a quote. Can it be removed for variable products?

Viewing 1 replies (of 1 total)
  • Plugin Author YITHEMES

    (@yithemes)

    Hi,
    Try to add this custom code in your functions.php

    if( !function_exists( 'ywraq_hide_quote_for_variable_products' ) ){
    	add_filter( 'yith_ywraq_before_print_button', 'ywraq_hide_quote_for_variable_products', 10, 2 );
    	/**
    	 * @param bool $show
    	 * @param WC_Product $product
    	 * @reutrn bool
    	 */
    	function ywraq_hide_quote_for_variable_products( $show, $product ){
    
    		if( 'variation' == $product->get_type() || 'variable' == $product->get_type() ){
    			$show = false;
    		}
    
    		return $show;
    	}
    }
Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.