• I love this plugin, it’s exactly what I need, and works really well.
    I have a site with many variations on each product, but usually only 1 stock for each variation.
    To explain, the site sells frisbees, each model comes in different weights, colours and plastics. The shop will only carry one red 175g disc in neutron plastic.
    When that sells, I want it to stop appearing in the table.
    At the moment, the stock column displays how many are in stock, but if ‘sold out’ it’s just blank. I had a look at the code and can see that there’s an if statement to display a ‘sold out’ message if there’s no stock, but it isn’t working.
    A message would be good, but just hiding the entire row would be better.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter jack@malago.co.uk

    (@jackmalagocouk)

    I have found a solution, it’s probably very hacky, but it works…

    In the plugin file
    Line 284
    I added
    v-if=”entry[‘availability_html’]”

    to this tag

    <tr v-for=”(entry, index) in filteredData” :class=”‘variation-‘+entry.variation_id+ ‘ image-‘+ imageClass(entry[‘image_link’])” v-if=”entry[‘availability_html’]” >

    It now just skips the entire row if there’s no stock in that particular variation combination, exactly what I wanted!

    Davinder

    (@davinderschiedel)

    Hi. Unfortunately this didn’t work. It just blanked out the entire box.

    Thread Starter jack@malago.co.uk

    (@jackmalagocouk)

    It’s working for me.
    I have these versions (up to date)
    WordPress 4.9.4
    WooCommerce Version 3.3.3
    Woo Variations table Version 1.3.10
    If you copied and pasted the above code snippet, be carful that it hasn’t switched the inverted commas into speech marks (if you know what I mean!).

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Hide variations with no stock’ is closed to new replies.