【问题标题】:need to change wocommerce email subject. and want to show product short description需要更改 woocommerce 电子邮件主题。并想显示产品简短描述
【发布时间】:2021-11-17 09:53:27
【问题描述】:

1 我正在尝试使用 woocommerce 产品简短描述更改 woocommerce 电子邮件主题更改。

这是我的代码:

$this->subject          = __( 'Bid item on {site_title}', 'wc_simple_auctions');

我想展示关于该主题的 woocommerce 产品简短描述

想在此处显示此代码:

printf( __( " %s", 'wc_simple_auctions' ), $product_data->get_short_description()  );

【问题讨论】:

  • 更新您的问题,因为您不询问 woocommerce 默认电子邮件。

标签: php html wordpress email woocommerce


【解决方案1】:

在functions.php中添加以下内容并尝试

add_filter( 'woocommerce_email_subject_customer_processing_order', 'change_processing_email_subject', 10, 2 );
  
function change_processing_email_subject( $subject, $order ) {
   $subject = $product->get_short_description();
   return $subject;
}

参考:https://docs.woocommerce.com/document/change-email-subject-lines/

【讨论】:

  • 感谢重播。但我想改变其他事情,比如客户在拍卖时出价。我正在使用 woocommerce 简单拍卖。我应该使用 woocommerce_email_subject_customer_processing_order 的即时什么过滤器
  • @mdsobuz 你在这里有文档 - wpgenie.org/woocommerce-simple-auctions/documentation/#faq。由于它的高级插件,我建议您联系您的开发人员以获得最佳建议
  • @Martin Mircev 感谢重播。我从同上 wordpress 主题中获得了插件。所以我无法获得支持。我尝试了很多方法并注意到作品。如果你帮我看看我怎么能把 printf( __( " %s", 'wc_simple_auctions' ), $product_data->get_short_description() );关于主题 $this->subject = __( '{site_title} 上的投标项目', 'wc_simple_auctions');那么它会对我很友善。今天是送货单的最后一天,我是新人,准时送货很重要
猜你喜欢
  • 2021-07-22
  • 2021-02-28
  • 1970-01-01
  • 2021-06-22
  • 2020-10-21
  • 2022-11-30
  • 2019-06-11
  • 2021-06-25
  • 2016-04-14
相关资源
最近更新 更多