• Resolved bugno82

    (@bugno82)


    I would like to make the quantity buttons respond to the add to cart button and minicart of my webshop. (+ Validation check without reloading page)

    I’m using the following plugins elementor, woocommerce, Snippet, woolentor pro & Quantity Plus Minus Button for WooCommerce.

    https://paste.pics/05e756a9a389be3234b385e6eaeaad1f

    this is some code that I already have in Snippet
    add_filter( ‘woocommerce_loop_add_to_cart_link’, ‘quantity_inputs_for_woocommerce_loop_add_to_cart_link’, 10, 2 );
    /**
    * Override loop template and show quantities next to add to cart buttons
    * @link https://gist.github.com/mikejolley/2793710
    */
    function quantity_inputs_for_woocommerce_loop_add_to_cart_link( $html, $product ) {
    if ( is_user_logged_in() && is_shop() && $product && $product->is_type( ‘simple’ ) && $product->is_purchasable() && $product->is_in_stock() && ! $product->is_sold_individually() ) {

    $html .= woocommerce_quantity_input( array(), $product, false );

    $html .= ‘</form>’;
    }
    return $html;
    }

    This is the code of a single product on my archive page
    https://paste.pics/91fe31e1af8cc226c2c2771667d15271

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Make quantity button respond with add to cart button archivepage WOOCOMMERCE’ is closed to new replies.