Site icon Hip-Hop Website Design and Development

Woocommerce: how to create a custom add-to-cart link for a variation with attribute instead of variation ID? [closed]

So I have a product with ID 25529. And its two variation based on attribute "color": "black"(25530) and "white"(25531).

http://example.com/?add-to-cart=25529&variation_id=25530
http://example.com/?add-to-cart=25531

The above add to cart URLs both work. But I’d like to construct the URL by attribute, such as

http://example.com/?add-to-cart=25529&attribute_color=black

I read some articles but still am not very sure if that is possible or not.