php - Put quantity input and add to cart on every thumbnail in shop archive in Divi theme -
i trying build archive page have add cart , quantity input send amount of items in cart.
so tried several option using code snipped working on other site not working in divi wordpress theme eleganththemes.
add_action( 'woocommerce_after_shop_loop_item', 'my_custom_quantity_field', 9 ); function my_custom_quantity_field() { global $product; if ( ! $product->is_sold_individually() ) woocommerce_quantity_input( array( 'min_value' => apply_filters( 'woocommerce_quantity_input_min', 1, $product ), 'max_value' => apply_filters( 'woocommerce_quantity_input_max', $product->backorders_allowed() ? '' : $product->get_stock_quantity(), $product ) )); `
it shows me quantity input when using code.
i tried put function in below:
add_action( 'woocommerce_after_shop_loop_item_title', 'woocommerce_template_loop_add_to_cart' );
when add cart show on page on every item, doesn't pick quantity number when click on addtocart, have solution this, helpful.
Comments
Post a Comment