Title: Conditional attributes on variable products
Last modified: February 10, 2022

---

# Conditional attributes on variable products

 *  Resolved [erictalv](https://wordpress.org/support/users/erictalv/)
 * (@erictalv)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/conditional-attributes-on-variable-products/)
 * Hello,
 * I am trying to make a product with 2 attributes:
 *  – length
    – splitting
 * Basically when a certain length option is chosen, the splitting option should
   not be available.
 * So from 10-12m length, if either is chosen the user should not be able to
    choose
   any splitting option, it shouldnt even be there.
 * But when a length is chosen above 12m, then the splitting option should be there.
 * Its a super simple idea, but I can’t seem to find any info on this.
 * -Thanks a bunch!

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

 *  [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/conditional-attributes-on-variable-products/#post-15351590)
 * If you have just the WooCommerce core plugin, then you can’t do exactly that.
   I don’t know of a plugin that would do it. It should be possible with some custom
   code if you have a developer.
 * I would do it by having “Not available” as an attribute for “splitting”. When
   you make your variations, either make them individually or “make from all attributes”
   then delete the combinations that you don’t offer.
 * The variations threshold is usually 30. If you have less than that, then unavailable
   combinations of attributes will not be selectable.
 * If necessary, you can increase the variations threshold with this snippet:
    [https://gist.github.com/mohsinoffline/f06c66259e667d6b16bb](https://gist.github.com/mohsinoffline/f06c66259e667d6b16bb)
 *  [niranjan9431](https://wordpress.org/support/users/niranjan9431/)
 * (@niranjan9431)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/conditional-attributes-on-variable-products/#post-15353906)
 * [@erictalv](https://wordpress.org/support/users/erictalv/) i’m also going through
   with same issue bro if you got any solution just let me know bro
 *  [MayKato](https://wordpress.org/support/users/maykato/)
 * (@maykato)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/conditional-attributes-on-variable-products/#post-15355438)
 * Hello,
 * If you are up for using another plugin, you might want to check out the following
   plugins. They can show/hide different fields based on information they fill out
 * [https://woocommerce.com/products/extra-custom-product-options-for-woocommerce/](https://woocommerce.com/products/extra-custom-product-options-for-woocommerce/)
   
   [https://wordpress.org/plugins/flexible-product-fields/](https://wordpress.org/plugins/flexible-product-fields/)
 *  [niranjan9431](https://wordpress.org/support/users/niranjan9431/)
 * (@niranjan9431)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/conditional-attributes-on-variable-products/#post-15360038)
 * [@lorro](https://wordpress.org/support/users/lorro/) bro can you help me with
   little help i manage to do hide variation but i need help little help in javascript
   i want to add javascript if someone select wooden or canvas option color itself
   change to “None”
 *  [Peter Lawrenson](https://wordpress.org/support/users/lorro/)
 * (@lorro)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/conditional-attributes-on-variable-products/#post-15360086)
 * [@niranjan9431](https://wordpress.org/support/users/niranjan9431/)
    This isn’t
   necessary. Just have “None” as an option for your colour attribute. Ensure all
   your wooden and canvas variations are only available with the “None” colour. 
   Ensure your number of variations is less than the variations threshold of 30,
   or increase the threshold until it is. Ordinary WooCommerce will do the rest.
 *  [niranjan9431](https://wordpress.org/support/users/niranjan9431/)
 * (@niranjan9431)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/conditional-attributes-on-variable-products/#post-15361578)
 * [@lorro](https://wordpress.org/support/users/lorro/) Thanks bro yea it’s works
   now very well mann And yes bro number of variables are less then 20.
 *  [Margaret S. woo-hc](https://wordpress.org/support/users/margaretwporg/)
 * (@margaretwporg)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/conditional-attributes-on-variable-products/#post-15362323)
 * Hi [@niranjan9431](https://wordpress.org/support/users/niranjan9431/)
 * Glad to know [@lorro](https://wordpress.org/support/users/lorro/)’s suggestion
   helped solved the problem. Cheers!
 * If you have any further questions the please create a new thread here so that
   your issue can be looked at separately – [https://wordpress.org/support/plugin/woocommerce/#new-topic-0](https://wordpress.org/support/plugin/woocommerce/#new-topic-0)
 * Thanks
 *  [niranjan9431](https://wordpress.org/support/users/niranjan9431/)
 * (@niranjan9431)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/conditional-attributes-on-variable-products/#post-15362420)
 * [@margaretwporg](https://wordpress.org/support/users/margaretwporg/) yes mam 
   [@lorro](https://wordpress.org/support/users/lorro/) Thank you so much both of
   you.

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

The topic ‘Conditional attributes on variable products’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [attributes](https://wordpress.org/support/topic-tag/attributes/)
 * [conditional](https://wordpress.org/support/topic-tag/conditional/)
 * [if](https://wordpress.org/support/topic-tag/if/)

 * 8 replies
 * 5 participants
 * Last reply from: [niranjan9431](https://wordpress.org/support/users/niranjan9431/)
 * Last activity: [4 years, 3 months ago](https://wordpress.org/support/topic/conditional-attributes-on-variable-products/#post-15362420)
 * Status: resolved