Reply 327128 to: How to make Buy Now button for products instead of select option

Avatar: Saira
Saira
Participant
June 27, 2022 at 13:02

As given in this link, I have given the following code in the Snippets

add_filter( ‘woocommerce_product_add_to_cart_text’, ‘bbloomer_change_select_options_button_text’, 9999, 2 );

function bbloomer_change_select_options_button_text( $label, $product ) {
if ( $product->is_type( ‘variable’ ) ) {
return ‘View Product’;
}
return $label;
}

But there is no change for the select option button of variable products in the shop page, now also it is displaying as select option button

screenshot : https://snipboard.io/XCEeK0.jpg

Thank You

Go To The Whole Conversation In Topic
We're using our own and third-party cookies to improve your experience and our website. Keep on browsing to accept our cookie policy.