Home Forums WoodMart support forum In stock status is not displayed Single product layout

In stock status is not displayed Single product layout

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #443636

    kazenaka
    Participant

    For some reason, the status of the product is not displayed.
    If there is no product, then everything is displayed (img-2).
    I use Single product layout, Product stock status added to the template (img-3).

    Attachments:
    You must be logged in to view attached files.
    #443676

    Luke Nielsen
    Keymaster

    Hello,

    Is there any chance that you could give me access to the dashboard area so I can have a look at the settings on your website, please?

    Kind Regards

    #443682

    kazenaka
    Participant

    Yes, sure. Granted access.

    #443842

    Luke Nielsen
    Keymaster

    Hello,

    If you want to show the “In stock” label, you need to define some stock quantity in the settings of the product.

    https://monosnap.com/file/Jr0LLTF4WiiQcAC0PFHTu9F2NOUUWG

    As a result, you will have something like this: https://monosnap.com/file/RMfjp01dBfaFkMy1nKcQLWo43IrAVe

    Kind Regards

    #443879

    kazenaka
    Participant

    Thank you, I see.
    This is strange logic, since the “out of stock” status is displayed without any additional settings.
    The settings for calculating availability on the site side don’t work for me, since the site is running in catalog mode and there is no way to place an order. All data is calculated in a third-party application and then imported into the site (availability status, price, attributes, etc.)

    Is it possible to display availability status without calculating residuals on the site?
    For example, as the status is displayed in the goods archive (availability and lack of goods are displayed there without any additional settings) – screenshot 2023-02-17_121450.jpg

    Attachments:
    You must be logged in to view attached files.
    #443984

    Luke Nielsen
    Keymaster

    Hello,

    In general, this functionality comes from WooCommerce so we cannot influent it, unfortunately. Also, you can check the below topic which can help you to resolve it.

    https://stackoverflow.com/questions/48355379/display-always-stock-status-without-quantity-in-woocommerce

    Kind Regards

    #444129

    kazenaka
    Participant

    Thank you)) I used the code below, it works:

    add_filter( ‘woocommerce_get_availability’, ‘custom_override_get_availability’, 10, 2);

    // The hook in function $availability is passed via the filter!
    function custom_override_get_availability( $availability, $_product ) {
    if ( $_product->is_in_stock() ) $availability[‘availability’] = __(‘In stock’, ‘woodmart’);
    return $availability;
    }

    #444574

    Luke Nielsen
    Keymaster

    Hello,

    Great! Glad that it works.

    If you have any more questions or come across any other issues, let me know, I’ll be happy to help.

    Have a good day!

    Kind Regards

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

The topic ‘In stock status is not displayed Single product layout’ is closed to new replies.