Я пытаюсь настроить уведомления по электронной почте на основе пользовательского «отправленного» * 1002 * статуса заказа…
Это обычный шаблон отображения:
![enter image description here](https://i.stack.imgur.com/wIQ3h.png)
Вот мой код:
<?php if( ! $order->has_status('shipped') ) { ?>
<p><?php printf( esc_html__( 'Your %s order has been delivered to your provided shipping address and we marked its status to <b>completed</b>. Let us know if you have any questions.', 'woocommerce' ), esc_html( wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ) ); ?></p>
<?php } ?>
Но теперь у меня есть повторение:
![enter image description here](https://i.stack.imgur.com/8HOtV.png)
Что я делаю не так?Как избежать этого повторения?
Структура кода моего emails/customer-completed-order.php
шаблона (выдержка) :
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
/*
* @hooked WC_Emails::email_header() Output the email header
*/
do_action( 'woocommerce_email_header', $email_heading, $email ); ?>
<?php /* translators: %s: Customer first name */ ?>
<p><?php printf( esc_html__( 'Hi %s,', 'woocommerce' ), esc_html( $order->get_billing_first_name() ) ); ?></p>
<?php /* translators: %s: Site title */ ?>
<?php if( ! $order->has_status('shipped') ) { ?>
<p><?php printf( esc_html__( 'Your %s order has been delivered to your provided shipping address and we marked its status to <b>completed</b>. Let us know if you have any questions.', 'woocommerce' ), esc_html( wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ) ); ?></p>
<?php } ?>
<p><?php printf( esc_html__( 'Your %s order has been marked complete on our side.', 'woocommerce' ), esc_html( wp_specialchars_decode( get_option( 'blogname' ), ENT_QUOTES ) ) ); ?></p>
<?php