- This topic has 7 replies, 2 voices, and was last updated 3 years ago by
Tom.
-
AuthorPosts
-
January 22, 2020 at 7:15 am #1140412
Pedro
Hello! I recently updated WooCommerce to the latest version (3.9)
I had a code in the functions.php of the GP child theme.
That code hide the “product added” message on the cart page.
However, since I updated it shows an empty green field.
I would like that not to be shown.
Can you help me?
The code was:
/** Ocultar mensaje de producto añadido al carrito **/ function ocultar_wc_add_to_cart_message( $message, $product_id ) { return ''; }; add_filter( 'wc_add_to_cart_message', 'ocultar_wc_add_to_cart_message', 10, 2 );
January 22, 2020 at 4:10 pm #1140807Tom
Lead DeveloperLead DeveloperHi there,
You could try adding this CSS as well:
.type-product .woocommerce-message { display: none; }
Let me know 🙂
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJanuary 22, 2020 at 4:20 pm #1140815Pedro
Hello Tom!
I added the CSS code but the message is still showing (I no longer have the code in functions.php)
January 22, 2020 at 4:21 pm #1140817Tom
Lead DeveloperLead DeveloperCan you link me to a page where I can see it?
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJanuary 22, 2020 at 4:38 pm #1140829Pedro
Hello Tom! You can see an example in the following link: https://www.rebajaslocas.com/producto/corrector-de-juanetes-x2-uds/
Simply add the product to the cart, and you will see that it still shows the message of “Product added to the cart” on the cart page.
It is the message that appears on a green background.
January 22, 2020 at 4:39 pm #1140830Tom
Lead DeveloperLead DeveloperTry this:
.woocommerce-message { display: none; }
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-developmentJanuary 22, 2020 at 4:47 pm #1140833Pedro
Hello Tom! The code worked but also hides all messages related to the products.
Like messages when products are deleted or cart is updated.
January 22, 2020 at 4:51 pm #1140836Tom
Lead DeveloperLead DeveloperI wonder if one of these solutions might work better?: https://stackoverflow.com/questions/34645095/remove-hide-woocommerce-added-to-cart-message-but-keep-display-coupon-applied-me
Documentation: http://docs.generatepress.com/
Adding CSS: http://docs.generatepress.com/article/adding-css/
Ongoing Development: https://generatepress.com/ongoing-development -
AuthorPosts
- You must be logged in to reply to this topic.