Two units of measure Units and Weight (Woocommerce)
-
I have a problem.
I have two units of measure in my store (unit and weight).
I tried to put the information right after the input according to the unit.
I would like to have both units as shown.
I tried to use the function below, but it didn’t work.
I need to put a background according to the category. Thanksadd_filter( 'woocommerce_quantity_input_args', 'min_qty_filter_callback', 20, 2 ); function min_qty_filter_callback( $args, $product ) { $category = 17; // The targeted product category $min_qty = 1; // The minimum product quantity $product_id = $product->is_type('variation') ? $product->get_parent_id() : $product->get_id(); if( has_term( $category, 'product_cat', $product_id ) ){ $args['min_value'] = $min_qty; $args['step'] = 1; $args['backgroud'] = 'FFFFFF'; } return $args;
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Two units of measure Units and Weight (Woocommerce)’ is closed to new replies.