简体   繁体   English

如何删除 Woocommerce 购物车通知?

[英]How to remove Woocommerce cart notifications?

Question: How to remove the Woocommerce cart notifications as: "Product was removed from cart", "Product was added to your cart", "Show cart".问题:如何删除 Woocommerce 购物车通知为:“产品已从购物车中删除”、“产品已添加到您的购物车”、“显示购物车”。

Platform: Wordpress & Woocommerce平台: Wordpress & Woocommerce

Theme: Astra主题:阿斯特拉

Plugin: Elementor Pro插件: Elementor Pro

See photos for notifications I want to be removed.查看我想要删除的通知的照片。

Added to cart:添加到购物车:

添加到购物车

Removed from cart:从购物车中删除:

从购物车中删除

What I have already done is removing the coupon code from the checkout page through some code in the functions.php but I don't know if it's possible to remove these notifications through code or other options?我已经做的是通过functions.php中的一些代码从结帐页面中删除优惠券代码,但我不知道是否可以通过代码或其他选项删除这些通知?

Here is hook to remove "Add to cart notifications" use this in functions.php这是删除“添加到购物车通知”的钩子,在函数中使用它。php

add_filter( 'wc_add_to_cart_message_html', 'dont_show_message');
function dont_show_message( $message, $products ) { 
    return ''; 
}; 

Or simply yon can use CSS to hide the same.或者干脆你可以使用 CSS 来隐藏它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM