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.
"QUICK VIEW" button text or translation
pe3ksve3k Jul 29, 2018 · 10:16 am #10183
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.
pe3ksve3k Jul 30, 2018 · 3:23 pm #10185
Hi Andrew,
works very well! Thank you very much!! ;-).
Super 🙂 Glad to hear that helped.
4 posts