Home Forums WoodMart support forum Display Label "onbackorder" status

Display Label "onbackorder" status

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #194631

    novogrodsky
    Participant

    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.
    #194655

    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

    #194662

    novogrodsky
    Participant

    Thank you very much

    #194688

    You are welcome! If you have any questions please feel free to contact us.

    Best Regards

Viewing 4 posts - 1 through 4 (of 4 total)

The topic ‘Display Label "onbackorder" status’ is closed to new replies.