By default variable products will show a “Select options” button in the products in the catalog.
This feature will show a small popup with the product variation options that can be selected and added to the cart without leaving the catalog page.
To enable please visit Settings › WooCommerce › Catalog › Product Card › Add to Cart Button › Ajax Variations Form Pop-up eg: screenshot . Simply enable and it should work.
A quick demo can be seen here recording .
