No results found. Try again with different words?

Search must be at least 3 characters.

How to Modify/Change the Quick View text?

Sidebar Image

Did not find a solution? We are here to help you succeed.

As a shop owner, you might want to change the Quick View text. In this article, we will be seeing how to change the Quick View text using a filter.

In our WooCommerce Addon, as you can see we have the option to display the Quick View text based on the position which you have selected from the Astra settings.

So below are the filter based on the position to change the Quick View text –

1] For “On Image” position, you can use the following filter –

/**
 * Change Quick View text from the shop page (for on image button option)
 *
 */

add_filter( 'astra_woo_add_quick_view_text_html', 'astra_woo_add_quick_view_text_html_func', 10, 3 );

function astra_woo_add_quick_view_text_html_func( $button, $label, $product_id ) {

    global $product;
    $product_id = $product->get_id();

    $label = __( 'Buy Now', 'astra-addon' );
    $button = '<a href="#" class="ast-quick-view-text" data-product_id="' . esc_attr( $product_id ) . '">' . $label . '</a>';
    
    return $button;
}

Here’s how it would display Before and After using the above filter –

Before –

Astra Pro - WooCommerce, On Image Quick View text - Before, Astra 3.0+

After –

Astra Pro - WooCommerce, On Image Quick View text - After, Astra 3.0+

2] For After Summary position, you can use the following filter –

/**
 * Change Quick View text from the shop page (for after summary option)
 *
 */

add_filter( 'astra_woo_add_quick_view_button_html', 'astra_woo_add_quick_view_button_html_func', 10, 3 );

function astra_woo_add_quick_view_button_html_func( $button, $label, $product_id ) {

    global $product;
    $product_id = $product->get_id();

    $label = __( 'Buy Now', 'astra-addon' );
    $button = '<div class="ast-qv-button-wrap">';
    $button .= '<a href="#" class="button ast-quick-view-button" data-product_id="' . esc_attr( $product_id ) . '">' . $label . '</a>';
    $button .= '</div>';
    
    return $button;
}

Here’s how it would display Before and After using the above filter.

Before 

Astra Pro - WooCommerce, After Summary Quick View text - Before, Astra 3.0+

After –

Astra Pro - WooCommerce, After Summary Quick View text - After, Astra 3.0+

Note:

1. The above filter will change the “Quick View” text to the “Buy Now” text. You can update it as per your requirement.

2. Paste the above code in the child theme’s functions.php file.

Was this article helpful?
Sidebar Image

Did not find a solution? We are here to help you succeed.

Related Docs

Join 1,653,898+ Happy Site Owners Using Astra

Whether you are a beginner, small business owner, or professional web developer, Astra provides all the tools you need to easily build your beautiful WordPress website.

Download is Just A Click Away!

Membership Retention Checklist Download

REWIND

YEAR IN REVIEW

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Download Free Astra Theme - Modal Popup Form
Scroll to Top
Now choose your preferred
page builder addon
Choose your preferred page builder addon

Download is Just A Click Away!

Enter your email address and be the first to learn about updates and new features.

Download Free Astra Theme - Modal Popup Form