/** Display "Sold Out" on Loop Pages - WooCommerce */ add_action( 'woocommerce_before_shop_loop_item_title', 'bbloomer_display_sold_out_loop_woocommerce' ); function bbloomer_display_sold_out_loop_woocommerce() { global $product; if ( !$product->is_in_stock() ) { echo '<span class="soldout">' . __( 'אזל מהמלאי', 'woocommerce' ) . '</span>'; } }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter