Support » Plugin: C4D Woo Variation Images » Don’t Show Variation Option if Only One?

  • I have a function in Woocommerce that hides the old variation drop down if there is only one Variation. But that function gets overwritten by this plugin. Is there a setting to do no variation if a variation does not exist?

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

    (@coffee4dev)

    Thank you for reporting! I will check and update it soon!

    Plugin Author coffee4dev

    (@coffee4dev)

    But if you have only one variation why you do not change it to Simple Product ?

    casbboy

    (@casbboy)

    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.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Don’t Show Variation Option if Only One?’ is closed to new replies.