Automattic\WooCommerce\Internal\Admin\EmailPreview
EmailPreview::get_dummy_downloadable_product
Get a dummy downloadable/virtual product.
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_downloadable_product();
EmailPreview::get_dummy_downloadable_product() EmailPreview::get dummy downloadable product code WC 10.7.0
private function get_dummy_downloadable_product() {
$product = new WC_Product();
$product->set_name( __( 'Dummy Downloadable Product', 'woocommerce' ) );
$product->set_price( 15 );
$product->set_virtual( true );
$product->set_downloadable( true );
/**
* A dummy downloadable WC_Product used in email preview.
*
* @param WC_Product $product The dummy downloadable product object.
* @param string $email_type The email type to preview.
*
* @since 10.3.0
*/
return apply_filters( 'woocommerce_email_preview_dummy_downloadable_product', $product, $this->email_type );
}