Change the text of the customization button when it comes from the cart
If you use the lightbox and the customer clicks on the product added to the cart to modify it, it should be written on the customization button (which opens the customizer in the lightbox): "Modify customization" to make it more intuitive that they are going to modify the customization already done
Hi V.I.,
I think a quick PHP snippet will do the job :)
I use the woocommerce_product_single_add_to_cart_text filter to modify the button text.
The custom_add_to_cart_text function checks if the URL parameter 'cart_item_key' is present. This parameter is typically added when a customer clicks on 'Edit product' in the cart.
If the parameter is present, the button text changes to 'Modify customization'. (You can modify this text according to your preferences.)
If the parameter is not present, we return the original button text
Here's the snippet to add to your functions.php file. Let me know if you need help implementing this !
Thanks a lot Olivia, I managed to implement using the cart_item_key parameter only that the code should modify the fpd-start-customizing-button. So thanks to your idea with the cart_item_key parameter and with the help of chatgpt I managed to create the code below which works perfectly:
Thank you again :)
1 person likes this
Hi V.I. !
It's a great news !
I'm not very comfortable with javascript and I always turn to the PHP version of the snippets which I arrange "to my own taste" ;)
Glad you solve it so fast !
Olivia