What I am trying to achieve is to have one add-to-cart button that will add the selected quantity of multiple products, featured on the catalog page, into the basket.
Here is an image of what I aim to have:
I've found the code that outputs the existing button has the following code:
echo apply_filters( 'woocommerce_loop_add_to_cart_link', sprintf('<a href="%s" rel="nofollow" data-product_id="%s" data-product_sku="%s" class="%s button product_type_%s">%s</a>', esc_url( $link['url'] ), esc_attr( $product->id ), esc_attr( $product->get_sku() ), esc_attr( $link['class'] ), esc_attr( $product->product_type ), esc_html( $link['label'] ) ), $product, $link );
I'm aware that there could be a way to use jQuery to submit each individual form, via a loop, at once but due to my limited knowledge, I don't think I could implement it.
Alternatively, if there is a way to have a custom button that can submit multiple forms for each product and its corresponding quantity that may make things easier in the long run.