I need to custom the output of Woocommerce Products Categories Widget showing the percentage discount for that category (Discount_Price*100/Standard_Price).
I can easily create a function that takes from the first product of that category:
and calculate the percentage discount, but I don't know how to show it in the output of the widget like this:
Can you help me?
Thanks
Looks like the only entry point is the filter woocommerce_product_categories_widget_args
. The output is done via wp_list_categories
and I guess you'll have to do a custom walker to achieve what you want. Or duplicate the widget code and make your custom one.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.