• Как парсить цены в выдаче авиабилетов?

    @Ofelion Автор вопроса
    Я отследил, это файл airports
    Ответ написан
    Комментировать
  • Как выбрать конкретный шаблон письма WooCommerce для отправки клиенту?

    @Ofelion Автор вопроса
    Ответ намного проще, чем может показаться, всего несколько строчек в файле class-wc-email-cancelled-order.php

    public function trigger( $order_id, $order = false ) {
                $this->setup_locale();
                $data = $order->get_data(); // инициализируем заказ
                $userEmail = $data['billing']['email']; // получаем email клиента
                if ( $order_id && ! is_a( $order, 'WC_Order' ) ) {
                    $order = wc_get_order( $order_id );
                }
     
                if ( is_a( $order, 'WC_Order' ) ) {
                    $this->object                                    = $order;
                    $this->placeholders['{order_date}']              = wc_format_datetime( $this->object->get_date_created() );
                    $this->placeholders['{order_number}']            = $this->object->get_order_number();
                    $this->placeholders['{order_billing_full_name}'] = $this->object->get_formatted_billing_full_name();
                }
     
                if ( $this->is_enabled() && $this->get_recipient() ) {
                    $this->send( $this->get_recipient().','.$userEmail, $this->get_subject(), $this->get_content(), $this->get_headers(), $this->get_attachments() );  //подставляем его get_recipient().','.$userEmail
                }
     
                $this->restore_locale();
            }
    Ответ написан
    Комментировать