Magento – Load configurable product with preselected options of any one of simple product

configurable-productmagento-2.1magento2productswatches

How to load configurable product with preselected options of any one of simple product?

For example

I have a configurable product http://host/product/1.

It have 2 associated simple products http://host/product/2 and http://host/product/3.

Whenever configurable product page load, I need to display the preselected options of http://host/product/2.

Can anyone share hints to achieve this?

Best Answer

Following this article by Daan van den Bergh you can do exactly what you need: https://daan.dev/magento/2/redirect-simple-products-configurable-parent-attributes-pre-selected/