Search code examples
wordpresswoocommerceattributesproductdropdownbox

WordPress WooCommerce when selecting Brand attribute does not filter Model attribute


I have mobile phone case in my products. Although there is 77 conditional prices depend on brand and models of mobile phones but when I select a brand, it shows all mobile models in dropdown list.

enter image description here

This problem is not appearing when model items is less than 10. How can I fix this problem?


Solution

  • So basically I came across the same problem while I was developing a website for my client.

    Actually it due to Ajax limit set by woocommerce. You can override this limit

    Read here if you want -> https://woocommerce.wordpress.com/2015/07/13/improving-the-variations-interface-in-2-4/

    Solution:

    Go to Plugin folder-> woocommerce/includes/wc-template-functions.php

    and edit this file wc-template-functions.php

    and change woocommerce_ajax_variation_threshold 30 -> to something you want

    I changed it to 1000.

    But if you will update your woocommerce the limit will again change, this can cause problems.

    So you can override this limit using your themes function.php

    Hope this solves your problem.