• Resolved jaredkc

    (@jaredkc)


    In WooCommerce I have some variable products with the options to select color and size. I need to set the default option for color based on a variable from the url. For example the url:

    example.com/product/product-name/?color=blue

    Would then result in the color attribute default value being set to “blue”. Any guidance to get this complete would be greatly appreciated.

    https://www.ads-software.com/plugins/woocommerce/

Viewing 4 replies - 1 through 4 (of 4 total)
  • To do this, select the variation combination that you want and add the product to cart. Then navigate to your cart page and copy the link on the product title.

    It should be something like:
    https://www.example.com/product/product-name/?attribute_pa_color=blue

    Thread Starter jaredkc

    (@jaredkc)

    Well that was easy! The functionality it built in and I was trying to recreate it. Thanks.

    Don’t mention it ??

    Cools. I had to remove the _pa to make it work for me: ?attribute_color=black

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Set product color from URL variable’ is closed to new replies.