title: Change Place order Button text only if there is a certain product in cart from a specific category
body: <p>I am trying to change the place order button text in the checkout page based on condition that if and only if there is a product in cart from the "donation" category. Else want to change the text from "Place Order" to "Submit Order". To do so I have applied below code</p>
  
  <pre><code>add_filter('woocommerce_order_button_text', 'subscriptions_custom_checkout_submit_button_text' );
  function subscriptions_custom_checkout_submit_button_text( $order_button_text ) {
  
  // set our flag to be false until we find a product in that category
  $cat_check = false;
  
  // check each cart item for our category
  foreach ( WC()-&gt;cart-&gt;get_cart() as $cart_item_key =&gt; $cart_item ) {
  
      $product = $cart_item['data'];
  
      // replace 'donations' with your category's slug
      if ( has_term( 'donations', 'product_cat', $product-&gt;id ) &amp;&amp; !has_term( 'dvds', 'product_cat', $product-&gt;id ) ){
          $cat_check = true;
          // break because we only need one "true" to matter here
          break;
      }
  }
  
  
  
  // if a product in the cart is in our category, do something
  if ( $cat_check ) {
  
  
          $order_button_text =  __( 'Submit Donation', 'woocommerce-subscriptions'  );
      } else {
          // You can change it here for other products types in cart
          # $order_button_text =  __( 'Something here', 'woocommerce-subscriptions'  );
          $order_button_text =  __( 'Submit Order', 'woocommerce-subscriptions'  );
      }
  
  
      return $order_button_text;
  }
  </code></pre>
  
  <p>It works. But there is a different problem.. If there is a product from other category and from Donation Category. Then it still change the place order button to "Submit Donation" because one condition is meet there that is one product is present from the donation category.</p>
  
  <p>Now what I want that if there is a product from Donation category and from another category then I just want to change the Place order button text to "Submit Order" Text.</p>
  
  <p>I think there needs to apply a AND condition in if loop. But I am not getting it how can I apply AND condtion there in the if loop..</p>