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
Returns
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 10.7.0
private function get_dummy_product() {
$product = new WC_Product();
$product->set_name( __( 'Dummy Product', 'woocommerce' ) );
$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 );
}