woocommerce sold individually not working in variation product
-
I need to sell a product , for that product user can purchase only one quantity at a time . For that i write the following code
function remove_qty_field( $return, $product ) { $my_product_id= $product -> post->ID ; if( $my_product_id==222){ return true; } } add_filter( 'woocommerce_is_sold_individually', 'remove_qty_field', 10, 2 );
The code is working properly and user can only order one item at a time .
But there is a problem , that product have variation like red, black color . But user can add one black and one red in a order . I want to restrict this .
Please help .
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘woocommerce sold individually not working in variation product’ is closed to new replies.