2016-10-10 10:00
浏览 74


i want to hide/remove specific messages from woo commerce without modifying basic woocommerce plugin. There are several types of messages related to coupon like

  1. Coupon code already applied!
  2. Sorry! Coupon 12345 already applied to your cart. (here i essentially want to hide coupon code)

and several others similar to these coupon codes.

i just want to hide these type of coupon/cart messages, others are fine like "Product successfully added!" or any other error messages.

Basically the aim is to show all other messages (Error and success messages) but dont wanna show coupon messages and a coupon code in to these messages.

So, is there any way to do this by doing any hook etc, like one i've found to eliminate all message strings (if i am not wrong).

add_filter( 'woocommerce_coupon_message', '__return_empty_string' );
  1. One more thing is, one message is repeating on cart page several times when i add product in to the car. "Coupon code already applied!" 2,3, to 4 times.

图片转代码服务由CSDN问答提供 功能建议

我想隐藏/删除woo commerce中的特定消息而不修改基本的woocommerce插件。 有几种类型的消息 与优惠券相关

  1. 优惠券代码已经应用!
  2. 抱歉! 优惠券12345已经应用于您的购物车。 (这里我基本上想要隐藏优惠券代码)


    我只是想要 隐藏这些类型的优惠券/购物车消息,其他人就像“产品成功添加!” 或其他任何错误消息。



      add_filter('woocommerce_coupon_message','__ again_empty_string'); 
    1. 还有一个是,一个 当我将产品添加到汽车时,消息在购物车页面上重复几次。 “已申请优惠券代码!” 2,3到4次。
  • 写回答
  • 好问题 提建议
  • 追加酬金
  • 关注问题
  • 邀请回答

3条回答 默认 最新

相关推荐 更多相似问题