How to Link to a Product, with Auto-Select Variation

Solved4 replies3 participantsUpdated by Tony Rodriguez

  • Avatar: enduratex@gmail.com
    Enduratex
    Participant

    We have a number of pages in our client site that need to link to a product, and have that product page automatically show and load the image for a specific variation.

    For example – on this product:
    https://enduratex.site/product/independence-iii/

    We need to load the page with single variations loaded, like this:
    * https://enduratex.site/product/independence-iii/?attribute_swatch=Cosmos
    * https://enduratex.site/product/independence-iii/?attribute_swatch=Flirty+Fox
    * https://enduratex.site/product/independence-iii/?attribute_swatch=Hope%27s+Pink

    Unfortunately, this doesn’t work, and the variation swatch does not load.
    Is there any other, better way to do this?

    Thank You in Advance!

    4 Answers

    Avatar: Andrew Mitchell
    Andrew Mitchell
    Support staff

    Hello, Enduratex,

    In WooCommerce, a “deep link” to a specific variation works only through standard attribute parameters, namely:
    – The key should be in the format attribute_{taxonomy}
    – For a global attribute, the taxonomy usually starts with pa_
    – The value should be the term slug, not the label

    In your case:
    – Attribute slug (taxonomy) = pa_swatch
    – Attribute value (term slug) = bronzed-peach

    Therefore, the correct URL should be:
    https://enduratex.site/product/independence-iii/?attribute_pa_swatch=bronzed-peach

    Best regards,
    8Theme Team

    Avatar: enduratex@gmail.com
    Enduratex
    Participant

    Hello,
    That worked perfectly.
    Thank You – closing ticket

    Avatar: enduratex@gmail.com
    Enduratex
    Participant

    Thanks for the support! My topic “How to Link to a Product, with Auto-Select Variation” has been successfully resolved.

    Avatar: Tony Rodriguez
    Tony Rodriguez
    Support staff

    Dear Enduratex,

    It’s great having you in our WordPress & WooCommerce community!

    Every insight you share helps us refine XStore and build tools that empower thousands of online store owners worldwide.

    Together, we grow stronger with every release.

    Topic closed.
    The 8Theme Team

The issue related to '‘How to Link to a Product, with Auto-Select Variation’' has been successfully resolved, and the topic is now closed for further responses