Display Discount Percentage of a Product
October 30, 2020
WooCommerce's default setting shows a discount price instead of a discount percentage on your products. Oxy Ultimate Woo is providing the smart PHP function to display the offer value as percentage type.
PHP Function
ou_get_sales_off_value( string $type = 'percentage', string $prefix = '', integer $id = '' )
Description
Displaying the discount value in percentage or fixed rate.
Parameters
$type:
(string) Display type. You can show the offer value in percentage or fixed rate type. Default is "percentage". For fixed value you will use "fixed" or "fixed_rate".
$prefix:
(string) Text. It adds some text before the discount value.
$id:
(integer) Product ID. Default value is current product ID.