Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there @mjstudio,

    Thanks for reaching out!

    If there are 30 or less product variations, the variation selection form is dynamic and will only show available variation options.

    Now if there are more than 30 variations, this no longer happens. Every available attribute will be displayed in the form. Once a selection is made, the form then sends an ajax request to check the database to see if the chosen variation is available and gets all of its information if it is.

    The limit of 30 is able to be raised with the woocommerce_ajax_variation_threshold filter, if you wish to do so. Increasing this to a high number may affect store performance, though.

    An example of the filter can be found here: https://gist.github.com/jessepearson/ae21721f4d75ea8d2c72c138a3aa25d7

    You can use Code Snippets (https://www.ads-software.com/plugins/code-snippets/) plugin to add it to your site or add it to your child theme’s functions.php file.

    Cheers!

    Hi there @mjstudio,

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – if you have any further questions, you can start a new thread.

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Show only available variations’ is closed to new replies.