Home Forums WoodMart support forum Filter Attributes – Don't Show Out of Stock Variations Reply To: Filter Attributes – Don't Show Out of Stock Variations

#83483

newsprince
Participant

@dunies i made a better version of the script

I forked it from the original developer and edit it to match our need and it is working flawlesly

Go here

https://github.com/Moultrex/Woocommerce-out-of-stock-variations-loop/blob/master/wc-out-of-stock-variation.php

copy the snippet and change the following 3 things

Line 10 – 12 change the

filter_megethos

with the string your URL has when you apply the filter

and change at lines

7 – 19 – 28

the string

attribute_pa_megethos

with the attribute name you have on your products

attribute_pa_your-attribute-name

Last change the query type to your filter widget from AND to OR

Add the above code to functions.php file from your child theme.

Now in our shop when you filter a size that is out of stock the results don’t show that product

P.S.: Xtemos Team we have renewed our support period. You guys deserve it. Keep up the good work!

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