Automattic\WooCommerce\StoreApi\Schemas\V1
ProductSchema::get_tax_display_mode()
WooCommerce can return prices including or excluding tax; choose the correct method based on tax display mode.
Method of the class: ProductSchema{}
No Hooks.
Return
String
. Valid tax display mode.
Usage
// protected - for code of main (parent) or child class $result = $this->get_tax_display_mode( $tax_display_mode );
- $tax_display_mode(string)
- Provided tax display mode.
Default: ''
ProductSchema::get_tax_display_mode() ProductSchema::get tax display mode code WC 8.7.0
protected function get_tax_display_mode( $tax_display_mode = '' ) { return in_array( $tax_display_mode, [ 'incl', 'excl' ], true ) ? $tax_display_mode : get_option( 'woocommerce_tax_display_shop' ); }