Home Forums WoodMart support forum Show if product is in stock

Show if product is in stock

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #541562

    raz.sofer
    Participant

    Hi. We have an elementor widget on our product pages which states if a product is not in stock, but we want it to show if the product is in stock as well.
    I have attached photos in private

    #541565

    raz.sofer
    Participant

    Worth to mention that the stock status is ok on product archive, just missing on product pages

    #541929

    Hung Pham
    Keymaster

    Hi raz.sofer,

    Thanks for reaching to us.

    You can check Track stock quantity for this product box https://prnt.sc/_B-E6ssqg8Gj

    Regards,

    #542310

    raz.sofer
    Participant

    Thank you very much Hung!
    I think our stock management system integration wont allow this as they only do 1 or 0 on stock status. Is that the only way?

    #542601

    Hung Pham
    Keymaster

    Hi raz.sofer,

    Sorry, but your reply is a bit unclear to me. Please describe in more details, this will allow me to thoroughly investigate and address your concerns in a more efficient.

    Regards,

    #543584

    raz.sofer
    Participant

    Thank you Hung.
    We have a stock sync plugin with our warehouse management system.
    The problem is that the sync only sends to wordpress “In Stock” or “Not in Stock” (without the exact amount that is present)
    It is an old warehouse system and it would be very time consuming to fix this issue
    Is there another way to bypass the requirement of the stock amount and do it as “1 or 0” method?

    • This reply was modified 2 months, 1 week ago by raz.sofer.
    #543671

    Hung Pham
    Keymaster

    Hi raz.sofer,

    Sorry to say there are no options to achieve this.

    For specialized assistance and potential solutions, I kindly suggest that you reach out directly to the WooCommerce plugin’s support team https://wordpress.org/support/plugin/woocommerce/, who are better equipped to provide you with the guidance you require or You need to find a third party plugin to achieve more functionality that best suits you.

    Regards,

    #561182

    raz.sofer
    Participant

    Hi Hung
    I did a code myself. Maybe you could add it to theme options in later updates:

    
    // Force front end display of stock status based on product setting and not quantity 
    add_filter('woocommerce_get_availability', function($availability, $product) {
        // Ignore quantity and use only stock status
        if ($product->is_in_stock()) {
            $availability['availability'] = __('In Stock', 'woocommerce');
        } else {
            $availability['availability'] = __('Out of Stock', 'woocommerce');
        }
        return $availability;
    }, 10, 2);
    #561421

    Hung Pham
    Keymaster

    Hi raz.sofer,

    Glad to hear your issue has been resolved and thanks for sharing the code. Keep us in mind for future questions and concerns, we’re always here to help!

    Regards,

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