Viewing 6 replies - 1 through 6 (of 6 total)
  • “No value” or “Not applicable” would need to be one of your attributes.

    Thread Starter muneebkiani

    (@muneebkiani)

    is there any filter available where i can check the value for combination is selected as Any…
    I guess then I can remove all options from the dropdown?

    If you want to do it on-page, you’ll need some Javascript or JQuery. Add event listeners to the attribute dropdowns and react accordingly. That should keep you busy…

    If you want to react after add-to-cart, this filter will tell you what options the user has selected.
    https://hookr.io/plugins/woocommerce/3.0.6/actions/woocommerce_add_to_cart/

    Thread Starter muneebkiani

    (@muneebkiani)

    Thanks for your reply, N/A was the most suitable way to deal with it.

    Also, is it possible greyout unavailable variation combinations. I like to show all possible values in variation dropdown but grey unavailable ones.

    The variations “threshold” is usually 30, though that can vary by theme. This is the maximum number of variations data that is loaded with the page. If you have more variations than the threshold, the data is not available to any Javascript working in the page, so there is no way of greying out or removing unavailable variations depending on other selections.

    If you have less variations than the threshold, all the variations data are loaded with the page, and unavailable variations cannot be selected. WooCommerce does this already. To confirm, setup a test product with less than 30 variations where some combinations are not avaiable, and observe the behaviour on page.

    You can increase the variations threshold using this snippet in functions.php for your child theme:
    https://gist.github.com/mohsinoffline/f06c66259e667d6b16bb

    As you make the threshold bigger, the page size gets bigger so page load time will increase. You’ll need to make a judgement.

    Someone said this doesn’t work if the WooCommerce Stripe plugin is active but I don’t know if that’s still the case.

    Plugin Support abwaita a11n

    (@abwaita)

    Hi @muneebkiani,

    We’ve not heard back from you in a while, so I’m marking this thread as resolved. Hopefully, the above info was useful!

    If you have further questions, please feel free to open a new topic.

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Variation Combination’ is closed to new replies.