How can we Include Multiple Product IDs in a PHP Action [closed]

Question

How can we include multiple product id in the if ($product->get_id()=="15757"){

add_filter( 'woocommerce_quantity_input_args', 'ts_woocommerce_quantity_selected_number', 10, 2 );
  
function ts_woocommerce_quantity_selected_number( $args, $product ) {
 // global $product;
   if ( ! is_cart() ) {
 if ($product->get_id()=="15757"){
      $args['input_value'] = 5; // Start from this value (default = 1) 
      $args['max_value'] = 15; // Maximum quantity (default = -1)
      $args['min_value'] = 5; // Minimum quantity (default = 0)
      $args['step'] = 5; // Increment or decrement by this value (default = 1)
 }
   } else {
 if ($product->get_id()=="15757"){
      // Cart's 'min_value' is 0
      $args['max_value'] = 15; 
      $args['step'] = 5; 
      $args['min_value'] = 5;
 }
   }
  
   return $args; 
}

We tried this but it doesn’t work if ($product->get_id()=="15757,15758,15759"){

0
Maged Mohamed 4 days 0 Answers 5 views 0

Leave an answer