Home Forums WoodMart support forum Add count quantati to shop pages

Add count quantati to shop pages

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #53076

    kooljohny
    Participant

    Hello everyone!
    How I can add qty counter for shop pages before “Add to cart” buttons?
    Like in “Quick view”.
    BR

    #53086

    Hello,

    Thank you very much for choosing our theme and contacting our support.

    Your question is not clear enough. Do you mean managing stocks as shown: http://prntscr.com/j6sagd

    If yes, enter the product and set this in Inventory tab like this: http://prntscr.com/j6sbkh

    If you mean something different, please provide more details links and screenshots.

    Best Regards

    #53110

    kooljohny
    Participant

    I need to add the ability to select the quantity of goods before “Add to cart” button on shop pages.
    Example see in attachment.

    Attachments:
    You must be logged in to view attached files.
    #53122

    Hello,

    No, there is no such option. You can customize WooCommerce to get such a functionality. Please find here more details how to do that: https://docs.woocommerce.com/document/override-loop-template-and-show-quantities-next-to-add-to-cart-buttons/

    If you have any questions feel free to contact us.

    Best Regards

    #53244

    kooljohny
    Participant

    after adding next code

    add_filter( 'woocommerce_loop_add_to_cart_link', 'quantity_inputs_for_woocommerce_loop_add_to_cart_link', 10, 2 );
    function quantity_inputs_for_woocommerce_loop_add_to_cart_link( $html, $product ) {
    	if ( $product && $product->is_type( 'simple' ) && $product->is_purchasable() && $product->is_in_stock() && ! $product->is_sold_individually() ) {
    		$html = '<form action="' . esc_url( $product->add_to_cart_url() ) . '" class="cart" method="post" enctype="multipart/form-data">';
    		$html .= woocommerce_quantity_input( array(), $product, false );
    		$html .= '<button type="submit" class="button alt">' . esc_html( $product->add_to_cart_text() ) . '</button>';
    		$html .= '</form>';
    	}
    	return $html;
    }

    code
    quantity option appear but button “add to cart” work wrong(does not add items to the shopping cart)
    I thik this issue connected with tag “$html .= ‘<button type=”submit” class=”button alt”>’ . esc_html( $product->add_to_cart_text() ) . ‘</button>’;”
    You can see how it work here

    #53257

    Artem Temos
    Keymaster
    #53263

    kooljohny
    Participant

    Sorry, now maintenance mode off. Check again please!

    #53267

    Artem Temos
    Keymaster

    You need to disable our theme’s AJAX add to cart option in Theme Settings -> Product page.

    #53326

    kooljohny
    Participant

    Thank you! Solved.

    #53342

    Artem Temos
    Keymaster

    You are welcome!

Viewing 10 posts - 1 through 10 (of 10 total)