Support » Plugin: WooCommerce Cart » Order Quantity from Archive Page

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author xootix

    (@xootix)

    Hello,

    Plugin follows the woocommerce guidelines , you cannot put the third party code & expect it to work.
    Here is the short & better snippet for showing quantity field on archive page.
    You need to enable “Ajax add to cart option” from the settings page , if you want to ajaxify.

    //Removes the cart button added by woocommerce
    remove_action('woocommerce_after_shop_loop_item','woocommerce_template_loop_add_to_cart',10);
    
    //Show quantity input on aarchive page
    function xoo_display_cart_form_on_archive(){
    	global $product;
    
    	if(!$product->is_type('simple'))
    		return;
    
    	woocommerce_template_single_add_to_cart();
    }
    add_action('woocommerce_after_shop_loop_item','xoo_display_cart_form_on_archive',10);

    Excellent. Works perfectly, thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Order Quantity from Archive Page’ is closed to new replies.