WooCommerce:将不同的电子邮件通知消息发送到不同的国家

我正在尝试创建一个脚本,在该脚本中,一个国家/地区的客户在收到确认后会收到与其他客户不同的消息。试图弄清楚if else语句是否起作用,这是我目前停留的地方:

<?php if ( $order->has_status( 'pending' ) && ($this->object->shipping_country === 'US')) { ?>
<p>
<?php
printf(
    wp_kses(
        /* translators: %1$s Site title,%2$s Order pay link */
        __( 'An order has been created for you on %1$s. Your invoice is below,with a link to make payment when you’re ready: %2$s','woocommerce' ),array(
            'a' => array(
                'href' => array(),),)
    ),esc_html( get_bloginfo( 'name','display' ) ),'<a href="' . esc_url( $order->get_checkout_payment_url() ) . '">' . esc_html__( 'Pay for this order','woocommerce' ) . '</a>'
);
?>
</p>

<?php else if ( $order->has_status( 'pending' ) && ($this->object->shipping_country != 'US')) { ?>
<p>
<?php
printf(
    wp_kses(
        /* translators: %1$s Site title,'woocommerce' ) . '</a>'
);
?>
</p>

<?php } else { ?>
<p>
<?php
    /* translators: %s Order date */
    printf( esc_html__( 'Here are the details of your order placed on %s:',esc_html( wc_format_datetime( $order->get_date_created() ) ) );
?>
</p>
ding1988ding 回答:WooCommerce:将不同的电子邮件通知消息发送到不同的国家

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/3163161.html

大家都在问