Comments 14mariateresa started the conversationOctober 27, 2023 at 4:04pmI would like that when i login--> the butto is "aggiungi al carrello"I not login in--> the button is "leggi tutto" 2,218WebWizards repliedOctober 27, 2023 at 4:14pmHi there,To do this, please try to add this PHP code snippet to your site: add_filter('woocommerce_product_single_add_to_cart_text', 'b2bking_replace_add_to_cart_text'); add_filter('woocommerce_product_add_to_cart_text', 'b2bking_replace_add_to_cart_text'); function b2bking_replace_add_to_cart_text() { if (is_user_logged_in()){ return '🛒 Aggiungi al carrello'; } else { return 'Leggi tutto'; } } A PHP snippet can be added to functions.php, or by following our guide here: https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/I am not 100% sure if this will work - it depends on your theme and site. If it does not work, I can try to find a solution - I will need a backend login to the site, or a staging site.Kind regards,Stefan Sign in to reply ...
I would like that when
i login--> the butto is "aggiungi al carrello"
I not login in--> the button is "leggi tutto"
Hi there,
To do this, please try to add this PHP code snippet to your site:
A PHP snippet can be added to functions.php, or by following our guide here: https://woocommerce-b2b-plugin.com/docs/how-to-add-a-snippet-php-or-js/
I am not 100% sure if this will work - it depends on your theme and site. If it does not work, I can try to find a solution - I will need a backend login to the site, or a staging site.
Kind regards,
Stefan