Archived topic
hoch to change the button ADD TO CART into SEE MORE DETAILS?
1 reply · Started by Robert on October 25, 2022
Hi
I addes into my shop, via: Code Snippets, this code:
add_filter( 'woocommerce_product_add_to_cart_text', function( $text ) {
if ( 'Wybierz opcje' == $text ) {
$text = __( 'Zobacz szczegóły', 'woocommerce' );
}
return $text;
} );
Now, if a product have few different variants, if I click on the button "Zobacz szczegóły" whats meens: "See more details," under the image
i go to a new page with more details.
But if I have a simple product without any variants, I see under the image the button: "Dodaj do koszyka", what meens "Add to cart".
It's passibe to add any new PHP code what would be passible to change the funktion of the button under a simple product, that he would works like the
button under products which have few different variants?
Kr
RObert
Hi Robert,
The woocommerce_product_add_to_cart_text is a core filter from WooCommerce itself so I'd recommend checking with their support team.
I did a little Google search and perhaps this would help:
https://gist.github.com/deckerweb/cf466e017fd01d503469
There are lots of examples of using this filter as well if you google woocommerce_product_add_to_cart_text.
Hope this helps :)