Automattic\WooCommerce\Internal\Admin\EmailPreview
EmailPreview::get_dummy_product()
Get a dummy product. Also used with woocommerce_order_item_product when email templates tries to get the product from the database.
Метод класса: EmailPreview{}
Хуки из метода
Возвращает
WC_Product
.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_dummy_product();
Код EmailPreview::get_dummy_product() EmailPreview::get dummy product WC 9.6.1
private function get_dummy_product() { $product = new WC_Product(); $product->set_name( 'Dummy Product' ); $product->set_price( 25 ); /** * A dummy WC_Product used in email preview. * * @param WC_Product $product The dummy product object. * @param string $email_type The email type to preview. * * @since 9.6.0 */ return apply_filters( 'woocommerce_email_preview_dummy_product', $product, $this->email_type ); }