change variable products add to cart text
Fri Dec 06 2024 03:03:33 GMT+0000 (Coordinated Universal Time)
Saved by
@webisko
#javascript
add_filter( 'woocommerce_loop_add_to_cart_link', 'custom_add_to_cart_button_text_archives', 10, 2 );
function custom_add_to_cart_button_text_archives( $link, $product ) {
if ( $product->is_type( 'variable' ) ) {
// Zmiana tekstu przycisku dla produktów zmiennych
$link = str_replace( 'ADD TO CART', 'SELECT', $link );
}
return $link;
}
content_copyCOPY
Comments