WooCommerce sold out badge on products listing

10 thoughts on “WooCommerce sold out badge on products listing”

    1. separate the function and use its callback in the add_action.

      Code should be this:

      add_action( ‘woocommerce_before_shop_loop_item_title’, ‘sold_out_badge’ );

      function sold_out_badge() {
      global $product;

      if ( !$product->is_in_stock() ) {
      echo ‘Sold!’;

  1. Woocommerce Products Badge Management is not so useful and not really meet user’s need from my experience.

    Is there a way to add a badge for each product. Like adding a snippet in function.php, then there is additional badge field in the product detail backend to fill and that badge can showed up in the frontend! The position and the design of the badge should match up with current “Sale” badge.

    Anyone know how to make this happen?

    EMAIL: tradecross@outlook.com


Leave a Reply