WC_Email_Cancelled_Order::__construct
Constructor.
Метод класса: WC_Email_Cancelled_Order{}
Хуков нет.
Возвращает
null. Ничего (null).
Использование
$WC_Email_Cancelled_Order = new WC_Email_Cancelled_Order(); $WC_Email_Cancelled_Order->__construct();
Код WC_Email_Cancelled_Order::__construct() WC Email Cancelled Order:: construct WC 10.7.0
public function __construct() {
$this->id = 'cancelled_order';
$this->title = __( 'Cancelled order', 'woocommerce' );
$this->email_group = 'orders';
$this->template_html = 'emails/admin-cancelled-order.php';
$this->template_plain = 'emails/plain/admin-cancelled-order.php';
$this->placeholders = array(
'{order_date}' => '',
'{order_number}' => '',
'{order_billing_full_name}' => '',
);
// Triggers for this email.
add_action( 'woocommerce_order_status_processing_to_cancelled_notification', array( $this, 'trigger' ), 10, 2 );
add_action( 'woocommerce_order_status_on-hold_to_cancelled_notification', array( $this, 'trigger' ), 10, 2 );
// Call parent constructor.
parent::__construct();
// Must be after parent's constructor which sets `email_improvements_enabled` property.
$this->description = $this->email_improvements_enabled
? __( 'Receive an email notification when an order that was processing or on hold gets cancelled', 'woocommerce' )
: __( 'Cancelled order emails are sent to chosen recipient(s) when orders have been marked cancelled (if they were previously processing or on-hold).', 'woocommerce' );
if ( $this->block_email_editor_enabled ) {
$this->title = __( 'Canceled order', 'woocommerce' );
$this->description = __( 'Notifies admins when an order that was processing or on hold has been canceled.', 'woocommerce' );
}
// Other settings.
$this->recipient = $this->get_option( 'recipient', get_option( 'admin_email' ) );
}