• Resolved brasofilo

    (@brasofilo)


    Hi!
    I’ve tried to install Back in Stock Notifier but it’s not playing nice with my products…

    I sell cheese where each variation is one weight, i.e., 303g, 450g, 602g, etc

    As I understood BISN only shows the form for each variation but in my case I need the form to show up only when all variations are sold. The new batch of variations will probably have different weights, so it doesn’t make sense to subscribe to one variation.

    In sum, I need variations to behave as single products, it only shows the form if there’s nothing left, and people will subscribe to the product, not to the variation.

    Is that possible?
    Thanks!!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author CodeWooGeek

    (@codewoogeek)

    Hello there,

    Good Day !!!

    From your requirement you want to show a subscribe form only when all the variations associated to that variable product become out of stock? If so this can be easily achieved by the following settings of woocommerce.

    Go to Admin Dashboard -> WooCommerce -> Settings -> Products -> Inventory -> Out of stock visibility -> Enable this option

    In addition to that please do cross check in our settings page option as well Admin Dashboard -> Instock Notifier -> Settings -> Visibility Settings -> Ignore WooCommerce Out of Stock Visibility Settings for Variation -> Uncheck that option(if it is checked already)

    With the following option, out of stock variation will be hidden from variation dropdown of woocommerce(front-end), so based on your requirement if all variations become out of stock, there is no variation dropdown in front-end instead it displays “This product is currently out of stock and unavailable.” Next to that our subscribe form will appear where any subscription goes to a variable product.

    In our last version of back in stock notifier we added feature like if any subscribers subscribed to variable product, later if any of variations belongs to that variable product back in stock we send instock email
    “Tweak: Trigger Back In Stock Email to Variable Product Subscribers if any variation belongs to variable product become instock”

    Rest everything will work as you expect.

    Let us know.
    Thanks.

    Thread Starter brasofilo

    (@brasofilo)

    Hi there!, thanks a lot for getting back to me, really appreciated ??

    I couldn’t achieve my objetive fiddling with those 2 settings. On the category page I want the behavior “Show out of stock” and on the single product page I want “Hide out of stock” behavior.

    Maybe the problem lies with WC Blocks that are like a blackbox, kind of impossible to filter:
    https://github.com/woocommerce/woocommerce-gutenberg-products-block/issues/891

    I couldn’t make it work with wwwoocommerce_product_query_tax_query, wwwoocommerce_product_query, pre_get_posts. Maybe the filters posts_request or posts_clauses could have helped but I found an easier solution:

    My WC Product Inventory setting is “Hide out of stock” and on the pages I want the opposite I applied the pre_option filter:

    add_filter('pre_option_woocommerce_hide_out_of_stock_items', function($pre_option, $option, $default){
        if( is_page([2893,2895,5393])) $pre_option = 'no';
        return $pre_option;
    }, 10, 3);
    • This reply was modified 3 years ago by brasofilo.
    Plugin Support CodeWooGeek Support

    (@codewoogeeksupport)

    Hello there,

    We’ve just updated v2.4.3 in WordPress, please update it and check it out.

    Let us know.

    Thanks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Show only if no variation left in stock’ is closed to new replies.