I have created a step by step variable product selection in WooCommerce 3.3.1 and I have a custom add to cart url, made this way:
$url=wc_get_checkout_url()."/?add-to-cart=".$loop->post->ID."&variation_id=".$variation['variation_id']."&attribute_pa_starter-box=".$variation['attributes']['attribute_pa_starter-box'];
Then I have added the url to a custom checkout button, but the problem is that when I click on checkout button it adds the product twice to the cart.
I can not understand where I'm wrong… Any help is appreciated.