title: Get the minimum variation price in WooCommerce
body: <p>I am a beginner trying to learn Wordpress and have a variable product with prices:</p>
  
  <ul>
  <li>cod Rs 250</li>
  <li>online Rs 200</li>
  </ul>
  
  <p>I want to use the minimum price in my themes <code>functions.php</code>.</p>
  
  <p>How will I be able to fetch or get the minimum value?</p>
  
  <p>I want to use in the below code :</p>
  
  <pre><code>function filter_gateways($gateways){
  
      $payment_NAME = 'cod'; // 
      $min_variation_price = ''; &lt;--------------- minimum variation price
  
      global $woocommerce;
  
      foreach ($woocommerce-&gt;cart-&gt;cart_contents as $key =&gt; $values ) {
          // Get the terms, i.e. category list using the ID of the product
          $terms = get_the_terms( $values['product_id'], 'product_cat' );
          // Because a product can have multiple categories, we need to iterate through the list of the products category for a match
          foreach ($terms as $term) {
              // 20 is the ID of the category for which we want to remove the payment gateway
              if($term-&gt;term_id == $min_variation_price){
                  unset($gateways[$payment_NAME]);
                  // If you want to remove another payment gateway, add it here i.e. unset($gateways['cod']);
                  break;
              }
              break;
          }
      }
      return $gateways;
  }
  </code></pre>