WC_Product_Variable::get_price_suffix
Get the suffix to display after prices > 0.
This is skipped if the suffix has dynamic values such as {price_excluding_tax} for variable products.
Method of the class: WC_Product_Variable{}
Hooks from the method
Returns
String.
Usage
$WC_Product_Variable = new WC_Product_Variable(); $WC_Product_Variable->get_price_suffix( $price, $qty );
- $price(string)
- Price to calculate, left blank to just use get_price().
Default:'' - $qty(int)
- Quantity passed on to get_price_including_tax() or get_price_excluding_tax().
Default:1
Notes
- See: get_price_html for an explanation as to why.
WC_Product_Variable::get_price_suffix() WC Product Variable::get price suffix code WC 10.5.0
public function get_price_suffix( $price = '', $qty = 1 ) {
$suffix = get_option( 'woocommerce_price_display_suffix' );
if ( strstr( $suffix, '{' ) ) {
return apply_filters( 'woocommerce_get_price_suffix', '', $this, $price, $qty );
} else {
return parent::get_price_suffix( $price, $qty );
}
}