• Resolved patliya123

    (@patliya123)


    Hello!
    I created a WooCommerce Commerce Website for my client who is selling mobile cover of more than 21 models, and if we calculate the number of variation should build is 575 , i used a custom code to increase the variation limit
    Code-:
    //Increase in the number of variations to 1000
    define( ‘WC_MAX_LINKED_VARIATIONS’, 1000 );

    After adding this code to function.php it worked the number of variation actually increased.
    But now the problem is with variations in product page.
    I had created two attributes
    1. Select your mobile brand
    2. Select your phone model

    And started creating variation in product
    So i made variation with the Samsung and vivo , in Samsung there are 95 models and vivo has 50 (with select attributes)

    Preview ( published product)
    But the problem is when i selecting the Samsung in “select your mobile brand” it is showing me all variations of “select your phone model”

    Means when i am selecting the Samsung it is showing me the models of vivo which is not in variation.

    Please fix this problem
    I have asked this question for two times but no. One is helping me please help me please.

    Check the link

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Hi @patliya123!

    There is a cut off at pre-loading 30 variations.

    In the front-end, if a variable product has more than 30 variations, the data will be loaded via AJAX rather than handled inline. It is possible to change this quantity using the woocommerce_ajax_variation_threshold filter.

    The default variation threshold in the following code is 100

    add_filter( 'woocommerce_ajax_variation_threshold', 'wc_ninja_ajax_threshold' );
    function wc_ninja_ajax_threshold() {
        return 100;
    }

    You can increase that value if you’d like.

    The code can be added to your site by following the instructions here:

    https://rynaldo.com/how-to-add-custom-code-to-your-woocommerce-wordpress-site-the-right-way/

    Please let us know if that helps.

    Cheers!

    Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Howdy.

    We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please start a new thread.

    Cheers!

    Hey,
    I have the same issue I tried your solution but it doesn’t work.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Problem in WooCommerce variations. More than 50+ variation problem’ is closed to new replies.