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.
Method of the class: EmailPreview{}
Hooks from the method
Return
WC_Product
.
Usage
// private - for code of main (parent) class only $result = $this->get_dummy_product();
EmailPreview::get_dummy_product() EmailPreview::get dummy product code WC 9.7.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 ); }