Mohamed Haidar Mohamed Haidar - 3 months ago 36
Javascript Question

WooCommerce Shop page: Quantity input on add to cart button

I'm using the Divi theme with WooCommerce plugin. In shop page, I would like to have the quantities adjustments directly on add to cart button .

My web site

Presently you have to click on the product to go in to single product page and only then is it possible to add to cart.

I have tried to figure out what produces the list of products so that I can modify it, but as you probably guessed I'm very new to this.

How can I add that functionality the to shop page products?

Answer

So what I ended up doing was adding the single page add to cart action to a hook for the shop page loop as follows:

add_action('woocommerce_after_shop_loop_item',
           'woocommerce_template_single_add_to_cart', 30);

Thanks.