Automattic\WooCommerce\Internal\Admin\EmailPreview
EmailPreview::set_up_filters()
Set up filters for email preview.
Method of the class: EmailPreview{}
No Hooks.
Return
null
. Nothing (null).
Usage
// private - for code of main (parent) class only $result = $this->set_up_filters();
EmailPreview::set_up_filters() EmailPreview::set up filters code WC 9.7.1
private function set_up_filters() { // Always show shipping address in the preview email. add_filter( 'woocommerce_order_needs_shipping_address', array( $this, 'enable_shipping_address' ) ); // Email templates fetch product from the database to show additional information, which are not // saved in WC_Order_Item_Product. This filter enables fetching that data also in email preview. add_filter( 'woocommerce_order_item_product', array( $this, 'get_dummy_product_when_not_set' ), 10, 1 ); // Enable email preview mode - this way transient values are fetched for live preview. add_filter( 'woocommerce_is_email_preview', array( $this, 'enable_preview_mode' ) ); // Get shipping method without needing to save it in the order. add_filter( 'woocommerce_order_shipping_method', array( $this, 'get_shipping_method' ) ); }