• Resolved adamdk

    (@adamdk)


    In shop page i add for exp 5 pcs shows only one in cart any help please

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Hi I checked it was ok to explain more

    Plugin Author taisho

    (@taisho)

    Hello,

    I’m sorry for the inconvenience, I had a lot on my mind lately and couldn’t test the plugins with WooCommerce 4.0 in a timely manner.

    This said I’ll be releasing 2.7.0 update this weekend which among a few things fixes this problem.

    For a fast fix – in 2.6.1 version of the plugin, file: qty-increment-buttons-for-woocommerce.php, change line 469 from:

    add_to_cart_button.data( "quantity", jQuery( this ).val() );

    to:

    add_to_cart_button.attr( "data-quantity", jQuery( this ).val() );

    Best Regards,

    Ryszard

    That helped me!

    Thanks for the quick fix!

    I have the same problem. I does not work with the changes on line 469. You can see here: finemarket.gr/shop/

    Plugin Author taisho

    (@taisho)

    @elated Actually your case while resulting in the same is much different. I see that the correction is indeed applied on your page and normally it would work, but the quantity buttons are not placed in the correct position and the plugin is unable to find the Add to cart button corresponding to the quantity increment buttons. Add to cart and quantity buttons should be in the same DIV.

    Your theme does not use the standard WooCommerce way to manage elements on the archive pages. Unfortunately, it’s not a free theme so I can’t just download it and try to look for the hooks I could use to position the buttons. So far for 2 themes, I made exceptions in the code (the version coming today, it wasn’t present in the current version yet) like this:

    		// Add quantity field on the archive page before or after Add to cart button that has 10 priority, depending on 'qib_archive_after' setting.
    		// For some themes that change archive pages significantly, their own hooks are used instead of standard one.
    		// Product must be purchasable, not sold individually, in stock and not variable.		
    		if ( $args['qib_archive_after'] = 'Before Add to cart' ) {
    			if ( $theme == 'OceanWP' || $parent_theme == 'OceanWP' ) {		
    				add_action( 'ocean_before_archive_product_add_to_cart_inner', 'qib_quantity_field_archive' );			
    			} elseif ( $theme == 'WooVina' || $parent_theme == 'WooVina' ) {			
    				add_action( 'woovina_before_archive_product_add_to_cart_inner', 'qib_quantity_field_archive' );			
    			} else {
    				add_action( 'woocommerce_after_shop_loop_item', 'qib_quantity_field_archive', 9 );			
    			}		
    		} else {
    			if ( $theme == 'OceanWP' || $parent_theme == 'OceanWP' ) {				
    				add_action( 'ocean_after_archive_product_add_to_cart_inner', 'qib_quantity_field_archive' );
    			} elseif ( $theme == 'WooVina' || $parent_theme == 'WooVina' ) {			
    				add_action( 'woovina_after_archive_product_add_to_cart_inner', 'qib_quantity_field_archive' );		
    			} else {
    				add_action( 'woocommerce_after_shop_loop_item', 'qib_quantity_field_archive', 11 );						
    			}			
    		}
    		// Add script that allows adding custom quantity on Add to cart button click for archive pages.
    		add_action( 'template_redirect', 'qib_add_to_cart_quantity_handler' );
    	}	

    You could contact theme support and ask for the “before” and “after” Add to cart button hooks on archive pages (shop/category). If I have these, I can add them to these exceptions.

    Best regards,

    Ryszard

    • This reply was modified 4 years, 11 months ago by taisho.

    Thanks

    • This reply was modified 4 years, 11 months ago by elated.

    I narrowed down to the file: wp-content/themes/groci/woocommerce/content-product.php
    what should I look for in there?

    
    // Ensure visibility.
    if ( empty( $product ) || ! $product->is_visible() ) {
    	return;
    }
    ?>
    <?php if(wc_get_loop_prop( 'columns' ) == '4'){ ?>
       <?php $column = '3'; ?>
    <?php } else { ?>
       <?php $column = '4'; ?>
    <?php } ?>
     
    <div class="col-md-<?php echo esc_attr($column); ?> pmb-3">
    	<?php
    	/**
    	 * Hook: woocommerce_before_shop_loop_item.
    	 *
    	 * @hooked woocommerce_template_loop_product_link_open - 10
    	 */
    	do_action( 'woocommerce_before_shop_loop_item' );
    
    	/**
    	 * Hook: woocommerce_before_shop_loop_item_title.
    	 *
    	 * @hooked woocommerce_show_product_loop_sale_flash - 10
    	 * @hooked woocommerce_template_loop_product_thumbnail - 10
    	 */
    	do_action( 'woocommerce_before_shop_loop_item_title' );
    
    	/**
    	 * Hook: woocommerce_shop_loop_item_title.
    	 *
    	 * @hooked woocommerce_template_loop_product_title - 10
    	 */
    	do_action( 'woocommerce_shop_loop_item_title' );
    
    	/**
    	 * Hook: woocommerce_after_shop_loop_item_title.
    	 *
    	 * @hooked woocommerce_template_loop_rating - 5
    	 * @hooked woocommerce_template_loop_price - 10
    	 */
    	do_action( 'woocommerce_after_shop_loop_item_title' );
    
    	/**
    	 * Hook: woocommerce_after_shop_loop_item.
    	 *
    	 * @hooked woocommerce_template_loop_product_link_close - 5
    	 * @hooked woocommerce_template_loop_add_to_cart - 10
    	 */
    	do_action( 'woocommerce_after_shop_loop_item' );
    	?>
    </div>
    
    Plugin Author taisho

    (@taisho)

    Hello,

    unfortunately, the code above shows standard WooCommerce hooks. You can try looking in your plugin folder with Windows Explorer for “add_to_cart”. So far all 3 themes I have as exceptions, OceanWP, Astra and WooVina have this text as part of their Add to cart button hooks for archive pages.

    Best regards,

    Ryszard

    Plugin Author taisho

    (@taisho)

    The problem for the original poster has been resolved. For the follow-up issue, there was no reply, so I’m marking this as resolved. @elated feel free to reopen this thread once you find or theme support provides you with the before and after Add to cart button hooks.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘only 1 pcs added to cart even i choose 5 pcs’ is closed to new replies.