wordpress - Woocommerce How to add "add to cart" button to the each of grouped products -
on page have table of grouped products , want make individual "add cart" button each product instead of 1 button @ bottom of table. i've made changing template file quantity field doesn't work.
and code woocommerce/single-product/add-to-cart/grouped.php
<td class="group_table_quantity"> <?php /** * @since 2.1.0. */ do_action( 'woocommerce_before_add_to_cart_button' ); /** * @since 3.0.0. */ do_action( 'woocommerce_before_add_to_cart_quantity' ); woocommerce_quantity_input( array( 'min_value' => apply_filters( 'woocommerce_quantity_input_min', $grouped_product->get_min_purchase_quantity(), $grouped_product ), 'max_value' => apply_filters( 'woocommerce_quantity_input_max', $grouped_product->get_max_purchase_quantity(), $grouped_product ), 'input_value' => isset( $_post['quantity'] ) ? wc_stock_amount( $_post['quantity'] ) : $grouped_product->get_min_purchase_quantity(), ) ); /** * @since 3.0.0. */ do_action( 'woocommerce_after_add_to_cart_quantity' ); ?> </td> <td class="group_table_button"> <button type="submit" name="add-to-cart" value="<?php echo esc_attr( $grouped_product->get_id() ); ?>" class="single_add_to_cart_button button alt"><?php echo esc_html( $grouped_product->single_add_to_cart_text() ); ?></button> <?php do_action( 'woocommerce_after_add_to_cart_button' );?> </td>
Comments
Post a Comment