Skip to content
Advertisement

WooCommerce customizing product availability text with icons

In Woocommerce I want to edit the “in-stock text”, I found multiple answers on the internet, but for some reason, it doesn’t work for products that are in stock. It does work for products that are out of stock or are on backorder. I cannot understand what is different and why the in-stock is rendering differently than the other two.

Code:

JavaScript

screenshots of the output: https://imgur.com/a/7PWiz62

All help and tips are appreciated!

Advertisement

Answer

To solve this issue related to your theme, try the following:

JavaScript

Code goes in functions.php file of the active child theme (or active theme). It should works


For other themes that doesn’t have customizations on product availability, to change the icon for example for “In stock” products use the following CSS rule:

JavaScript

Where f058 is the font code for “check-circle” FontAwesome font Icon.

enter image description here

The css selector to be used for:

  • “Out of Stock” product is .stock.out-of-stock:before,
  • “Available on backorder” product is .stock.available-on-backorder:before.

All Available FontAwesome font Icons

User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement