• Hello,

    I try to replace the text QuickView for the link with an eye icon in my functions.php file :

    add_filter('woosq_button_text','custom_quick_view');
    function custom_quick_view($output)
    {
     global $product;
    
     $output = '<a href="#" class="woosq-btn woosq-btn-' . esc_attr( $atts['id'] ) . ' ' . get_option( 'woosq_button_class' ) . '" data-id="' . esc_attr( $atts['id'] ) . '" data-effect="' . esc_attr( $atts['effect'] ) . '"><i class="far fa-eye"></i><span>' . esc_html( $button_text ) . '</span></a>'; 
     return $output;
    }

    but it doesn’t work. Any help please ?
    Thanks.

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

    (@wpclever)

    Hi @chancelienne

    Please use below snippet:

    add_filter( 'woosq_button_html', 'woosq_custom_quick_view_btn', 99, 2 );
    function woosq_custom_quick_view_btn( $output, $product_id ) {
    	$button_text = get_option( 'woosq_button_text' );
    
    	if ( empty( $button_text ) ) {
    		$button_text = esc_html__( 'Quick view', 'woosq' );
    	}
    
    	$output = '<a href="' . get_permalink( $product_id ) . '" class="woosq-btn woosq-btn-' . esc_attr( $product_id ) . ' ' . get_option( 'woosq_button_class' ) . '" data-id="' . esc_attr( $product_id ) . '" data-effect="' . esc_attr( get_option( 'woosq_effect', 'mfp-3d-unfold' ) ) . '"><i class="far fa-eye"></i><span>' . esc_html( $button_text ) . '</span></a>';
    
    	return $output;
    }
Viewing 1 replies (of 1 total)
  • The topic ‘Quick View icon’ is closed to new replies.