Display Label "onbackorder" status
-
Hello guys, i need help. What i have to do to display label stock status “onbackorder” in my shop, such as label out of stock for example? I tryed to add this code:
add_action( ‘woocommerce_before_shop_loop_item_title’, ‘my_onbackorder_loop’ );
function my_onbackorder_loop() {
global $product;
if ($product->stock_status == ‘onbackorder’) {
echo ‘<span class=”onbackorder”>Под заказ</span>’;
}
}
to functions.php, but it does not display correctly. Before or after main image of product. Could you be able to explain how to do this correctly?
Attachments:
You must be
logged in to view attached files.
Hello,
Thank you very much for choosing our theme and for contacting us.
You would better to create an attribute with this item “onbackorder”. You will add /delete this attribute when necessary.
Our theme provide the option to show the attribute label on the product grid or product page. Navigate to Products > Attributes > enter the attribute and enable “Show attribute label on products”
Best Regards
You are welcome! If you have any questions please feel free to contact us.
Best Regards
The topic ‘Display Label "onbackorder" status’ is closed to new replies.