• Resolved Pablostevens71

    (@pablostevens71)


    Is there a way to only show available variations? For example I’m selling cabinet doors. Variations are “wood type” and “color”

    Cherry Wood is ONLY available in color A,B,C

    Walnut Wood I Only available in D, E, F

    When I do wood an color variations though, Woocommerce shows ABCDEF for Cherry Wood. I would like to limit that to just A, B, C. and limit to just D,E,F if Walnut is chosen.

    Any way to make an attribute dependent upon a previous one?

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • I believe if you create 6 variations, 3 for each type of wood you will get the desired outcome.

    Thread Starter Pablostevens71

    (@pablostevens71)

    Hey @bigmoxy, yes I created the variations. A total of 6 in this case. The problem is, after “wood type” is selected, the available options are all colors and not just the 3 that apply to the wood type.

    So if I choose “cherry wood” I don’t want colors D, E, F to show as they are only available for Walnut Wood.

    Hi @pablostevens71, I setup a test product and got the desired results!

    Define your variations as follows:

    Cherry wood, color A
    cherry wood, color B
    cherry wood, color C
    walnut wood, color D
    walnut wood, color E
    walnut wood, color F

    Also, do not have a default selection. Each dropdown choice should say choose an option when the product initially displays.

    Hopefully this will work for you too!

    @pablostevens71, it looks like you’ve got this sorted out already on your page, good job.

    @bigmoxy, I’m interested in a similar problem, but would like all options available for selection in any order.

    Example
    case 1

    1. user chooses color A
    2. cherry wood is available for selection or selected automatically

    case 2 – in your description above

    1. user chooses cherry wood
    2. color A, B , C are available for selection

    I’m also curious if there is a better way to define variations. I’m totally new to WooCommerce but the variation definition seems like it should be completed with a one to many relationship in the product database instead. Is this an option in WooCommerce?

    Currently I’m evaluating if Woocommerce is a good tool for me. I’d like to have a store for electronics. Products may have 10s – 100s of attribute which are searchable by a user (think data sheet specifications) but I’m not sure how to handle this with WooCommerce. I see an advantage with the payments, cart and seo benefits of an established tool but the product database is confusing to me at this point.

    Actually I’ve answered my own question. This looks like the default behavior for case 1 and case 2 assuming variations are defined as you’ve indicated.

    I’m also guessing the variations are handled in typical RDBMS fashion in the actual tables.

    Now my question is how to create variations programmatically from some preexisting databases I have… ??

    Thread Starter Pablostevens71

    (@pablostevens71)

    Yes thank you. When I simplified it down to just a couple of woods and a couple of colours it worked. My initial product had hundreds of variations. Must have been a mistake in one of the variation combinations.

    As an update I used “product add ons” plugin to deal with the colour. I can set the add on globally based on the wood color and save hours of data entry.

    Thread Starter Pablostevens71

    (@pablostevens71)

    Hmmm this is still a problem. It worked with just a few wood types and related variations, but when I added all 48 variations of wood and color, it no longer worked!!! I’ve double checked all my variations and they are all set up correctly. Can’t figure this one out.

    After I entered all the woods/color combos, it lets me pick combinations that are not available and gives me the message “Sorry, no products matched your selection. Please choose a different combination.”

    Must be a bug.

    Thread Starter Pablostevens71

    (@pablostevens71)

    SOLVED!!!!

    Found the solution in another forum. Appearantly, WC has a default max variation for Ajax that is set at 30 variations. After that, I guess i just doesn’t function like it does when you have less than 30.

    Here’a snippet that increases the number of ajax variations allowed to 1111. It works great!

     /* Increase Woocommerce Variation Threshold */
     function wc_ajax_variation_threshold_modify( $threshold, $product ){
      $threshold = '1111';
      return  $threshold;
     }
    add_filter( 'woocommerce_ajax_variation_threshold','wc_ajax_variation_threshold_modify', 10, 2 );
    cakbcb

    (@cakbcb)

    I think there may be another way to solve your issue. You have “Cabinet Doors” as a grouped product which now offers your two wood types with their variants. I found this thread trying to solve the same problem. I’m selling a product with the same issue, so sticking with your example, here’s what I tried.

    Add three products. The first product you could call “Wood Types,” making it a grouped product that is hidden. The second product call “Cherry,” and the third name “Walnut.” With the second and third make them variable products, and assign the associated colors as attributes with each. In the grouped product you already have called “Cabinet Doors,” link the “Wood Types” grouped product, and in the “Wood Types” grouped product link the “Walnut,” and “Cherry” variable products.

    In my horrid attempt to try to explain this, let me try another way. Starting with a grouped product called “Cabinet Doors” you have two choices which are “Cherry,” and “Walnut,” which are both in a hidden group product named “Wood Type.” Both “Cherry,” and “Walnut” are variable products which have three unique color choices.

    Cabinet Doors (grouped) -> Wood Type (grouped) -> Walnut (variable) or Cherry (variable)

    Nesting group products, this seems to work; please let me know if there are issues with this method.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Dependent Variations’ is closed to new replies.