• Resolved ezoranne

    (@ezoranne)


    Good evening,
    I would like to know if there is a solution or a plug-in that will allow me to automatically select an attribute.
    Let me explain: I have variable products, they each have 3 attributes. Once the customer has chosen the first 2 attributes, he has no more choice for the 3rd (there is only one possible choice left). So I would like the 3rd attribute to be selected automatically and the customer to be able to put the product directly in his basket after choosing the 2nd attribute.
    And therefore that I can hide the 3rd attribute since its selection will be automatic

    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • That sounds like a coding job, but there is another approach, you can set the variations threshold to more than the number of variations. Use this snippet:
    https://gist.github.com/mohsinoffline/f06c66259e667d6b16bb

    If the threshold is more than the number of variations, then all the variations data are loaded at page-load time, and unavailable variations don’t appear in the drop-down. This avoids the frustrating “Option not available” message.

    Thread Starter ezoranne

    (@ezoranne)

    Thank you, but I don’t really understand your answer. I am not sure that it corresponds to my concern which is to force the choice of an attribute and to be able to hide it.
    And, unfortunately, I don’t have enough code skills to risk modifying my site’s code.

    Please post a link to the page which you described in your opening post.

    Plugin Support Missy a11n

    (@m155y5)

    Automattic Happiness Engineer

    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 feel free to start a new thread.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Automatic selection’ is closed to new replies.