Hello!
Your recent plugin update actually undid my fixes to hide variations with only one option.
We had old products with a particular color that we don’t carry any more, so we don’t want to delete the entire variation for book keeping (like COGS). We have one color that is disabled, no check mark for Enabled, but the plugin still has it show why Woocommerce knows not to show it.
How can the plugin know not to show any variation without stock, disabled or an attribute with only a single variation?
The last update removed your “outstock” and “.not-match” class, which was the perfect way to choose what to hide or not.
I have CSS hide all variations, and then jquery shows the variations that have more than one.
jQuery(".variations_form").on('DOMSubtreeModified', function() {
clearTimeout(timer1);
//jQuery(".variations_form").on('DOMNodeInserted', function() {
var parents = document.querySelectorAll('.c4d-woo-vs-single-list-box');
var timer1 = setTimeout(function () {
for(var i = 0; i < parents.length; i++) {
var children = parents[i].querySelectorAll('.attribute-item:not(.not-match)');
var childlength = children.length;
console.log('children: '+childlength);
/*if (children.length < 2) {
parents[i].style.display = 'none';
//jQuery(".variations_form").off('DOMSubtreeModified');
}*/
if (children.length > 1) {
parents[i].style.display = 'block';
//jQuery(".variations_form").off('DOMSubtreeModified');
}
}
}, 1500);
Cheers!
Ryan
*for now I’m trying to roll back to an older version of the plugin.