仅在已完成订单状态的电子邮件中显示优惠券消息

时间:2016-08-16 13:03:11

标签: php wordpress woocommerce orders email-notifications

如果客户未按此顺序使用任何邮件订单,我会that code显示优惠券消息。

我想仅在已完成订单上显示优惠券消息,而不是在所有邮件中显示。

add_action( 'woocommerce_email_before_order_table', 'processing_order_mail_message', 20 );
function processing_order_mail_message( $order ) {
    if ( empty( $order->get_used_coupons() ) && ( $order->post_status == 'wc-on-hold' || $order->post_status == 'wc-processing' ) )
        echo '<h2 id="h2thanks">Get 20% off</h2><p id="pthanks">Thank you for making this purchase! Come back and use the code "<strong>Back4More</strong>" to receive a 20% discount on your next purchase! Click here to continue shopping.</p>';
}

我怎样才能做到这一点?

由于

0 个答案:

没有答案