הצגת תגית "אזל מהמלאי" בלופ המוצרים

PHOTO EMBED

Tue May 18 2021 20:42:19 GMT+0000 (Coordinated Universal Time)

Saved by @Shesek

/**
 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>';
    }
} 
content_copyCOPY