• Hello, I have a problem that I do not know how to solve. I would appreciate it if someone help me. I have 1 product with 45 variations and 4 attributes, in the 30 variations the 4 attributes apply, the others only comply with 3, I want the other 15 variations to not show the 4 attribute, any ideas?

Viewing 2 replies - 1 through 2 (of 2 total)
  • linux4me2

    (@linux4me2)

    By default, the variations threshold is 30. If the number of variations is less than the threshold, WooCommerce uses AJAX to check the available variations and the customer is only able to select available variations. If the number of variations is greater than the threshold, AJAX isn’t used, and variations that aren’t available will be displayed.

    If you have more than 30 variations for a product, you can increase the threshold by adding the following code to your child theme’s functions.php, replacing the “150” with whatever you need, but keeping in mind the higher the number, the more resource-intensive the AJAX call:

    
    add_filter( 'woocommerce_ajax_variation_threshold', 'wc_ajax_variation_threshold' );
    function wc_ajax_variation_threshold() {
        return 150;
    }
    
    Thread Starter debora rojas

    (@debora30)

    hello, actually I don’t mean the options available for each variation, I mean the attributes front-end example
    product1
    pa_attribute 1 (op1, op2)
    pa_attribute 2 (op1, op2)
    pa_attribute 3 (op1, op2)
    what I want is that when pa_attribute 1 (op1) is chosen, pa_attribute 3 is not displayed

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘conditional in attribute’ is closed to new replies.