I’m trying to move the product variations from woocommerce_single_variation (single-product/add-to-cart/variable.php) to Genesis Sidebar, but i want to keep the Add to Cart button in woocommerce_single_product_summary. I tried at first to move only variations like this:

remove_action( 'woocommerce_single_variation', 'woocommerce_single_variation', 10 );
add_action('genesis_sidebar','woocommerce_single_variation', 5 );

but didn’t work. So i moved the entire variations block to sidebar:

/* Remove variations and add to cart button */
remove_action( 'woocommerce_single_product_summary', 'woocommerce_template_single_add_to_cart', 30 );
add_action('genesis_sidebar','woocommerce_template_single_add_to_cart', 5 );

and added back the add to cart button to the product summary:

remove_action( 'woocommerce_single_variation', 'woocommerce_single_variation_add_to_cart_button', 20 );
add_action('woocommerce_single_product_summary','woocommerce_single_variation_add_to_cart_button', 5 );

My problem now is that the add to cart button is not working anymore, so I need to simulate the add to cart action. I tried this answer but is not working: Woocommerce – Move add to cart button variable product

Any idea? Thank you!

Read more here: Move product variations without Add to Cart button to sidebar


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: