From Dev.to
Accurate "Save 20%" and "Only 3 left" badges on WooCommerce product images
Disclosure: this article was written with the help of AI. The snippets use WooCommerce's documented hooks but are illustrative: test them on your own WooCommerce version before using them in productio...
