[Resolved] "QUICK VIEW" button text or translation

Tagged: 

  • Author
    Posts
  • #10183

    pe3ksve3k
    Participant

    Dear all, I am using the free theme Polestar, and would like to ask you, how can I change the “Quick View” text. I need to translate it into my language, because it is not translated. I am open to also change it in some .php files, does not matter.
    Thank you very much.

    #10184

    Andrew Misplon
    Keymaster

    Hi 🙂

    The easiest way would be to use the plugin Code Snippets. Once Code Snippets is installed, add a new snippet, name it as you’d like and insert as the contents:

    if ( ! function_exists( 'polestar_woocommerce_quick_view_button' ) ) :
    /**
     * Quick view button.
     */
    function polestar_woocommerce_quick_view_button() {
    	global $product;
    	echo '<a href="#" id="product-id-' . $product->get_id() . '" class="button product-quick-view-button" data-product-id="' . $product->get_id() . '">' . esc_html__( 'Quick View', 'polestar') . '</a>';
    	$gallery = $product->get_gallery_image_ids();
    	if ( ! empty( $gallery ) && ! has_action( 'wp_footer', 'polestar_enqueue_flexslider' ) ) {
    		add_action( 'wp_footer', 'polestar_enqueue_flexslider' );
    	}	
    }
    endif;

    Change only the Quick View string in this function: esc_html__( 'Quick View', 'polestar').

    Select the option to run the snippet on the front end. Save and activate. You can also do this in a child theme.

    #10185

    pe3ksve3k
    Participant

    Hi Andrew,

    works very well! Thank you very much!! ;-).

    #10191

    Andrew Misplon
    Keymaster

    Super 🙂 Glad to hear that helped.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

Scroll to top