Add to Cart and quantity on Woocommerce [closed]

1

I have a site using woocommerce , and I need not only the add-to-cart option on the product detail page but also the quantity that appears in the product listings in the categories and etc.

Is there a plugin for this, even if it's paid?

Has anyone done this yet?

    
asked by anonymous 11.05.2015 / 20:24

1 answer

0

Add this code in the functions.php of your theme

add_action( 'init', 'erc_shop_archive_add_to_cart_button' );
function erc_shop_archive_add_to_cart_button() {
    add_action('woocommerce_after_shop_loop_item','woocommerce_template_loop_add_to_cart', 11);
}

What this function does is add an action called woocommerce_template_loop_add_to_cart in the woocommerce_after_shop_loop_item event when the hook init is started.

    
14.09.2016 / 11:18