title: Woocommerce - Get the regular price before any calculation/update is made
body: <p>The code below is modified as per my needs from this 2 questions on stack overflow:</p>
  <p>a) <a href="https://stackoverflow.com/questions/45806249/change-product-prices-via-a-hook-in-woocommerce-3">Change product prices via a hook in WooCommerce 3+</a>.</p>
  <p>b) <a href="https://stackoverflow.com/questions/52718312/product-regular-price-calculation-based-on-2-custom-fields-in-woocommerce-3">Product regular price calculation based on 2 custom fields in Woocommerce 3</a></p>
  <p>I am using the code below inside my theme's child functions.php file:</p>
  <pre><code>// Adding and displaying deposit custom field in woo-backend
      add_action( 'woocommerce_product_options_pricing', 'add_deposit_field_in_woo_admin', 50 );
  
  function add_deposit_field_in_woo_admin() {
      $domain = &quot;woocommerce&quot;;
      global $post;
      echo '&lt;/div&gt;&lt;div class=&quot;options_group pricing show_if_simple show_if_external show_if_composite&quot;&gt;';
      
      woocommerce_wp_text_input( array(
          'id'            =&gt; '_deposit_rate',
          'label'         =&gt; __(&quot;Deposit&quot;, $domain ),
          'placeholder'   =&gt; '',
          'description'   =&gt; __(&quot;Please state your deposit Rate in plain number. ex:20&quot;, $domain ),
          'desc_tip'      =&gt; true,
      ) );
      
      echo '&lt;input type=&quot;hidden&quot; name=&quot;_deposit_rate_nonce&quot; value=&quot;' . wp_create_nonce() . '&quot;&gt;';
  
  }
  
  // Function that saves the deposit rate in the custom field value
  function saving_deposit_rate( $product ) {
      // Security check
      if ( isset($_POST['_deposit_rate_nonce']) &amp;&amp; ! wp_verify_nonce($_POST['_deposit_rate_nonce']) ) {
          return;
      }
  
      // Save &quot;Deposit rate&quot; custom field values
      if( isset($_POST['_deposit_rate'])) {
          $product-&gt;update_meta_data('_deposit_rate', sanitize_text_field( (float) $_POST['_deposit_rate'] ) );
      }
  }
  
  // Calculate and save product price from the deposit custom fields
  function calculate_and_save_new_product_price( $product ) {
      // Disable when product is on sale
      if( isset($_POST['_sale_price']) &amp;&amp; $_POST['_sale_price'] &gt; 0 ){
          return;
      }
  
      // Calculate and save the new price
      if( isset($_POST['_deposit_rate']) &amp;&amp; $_POST['_deposit_rate'] &gt; 0 ) {
  
          // Catch the pricing data
          $deposit_rate   = (float) $_POST['_deposit_rate'];
          $active_price   = (float) $product-&gt;get_price();
          
  
          // Calculating new price
          $new_price = $active_price * ($deposit_rate / 100) ;
  
          // If the active price is different from the calculated new price
          if( $new_price !== $active_price ) {
              // Update active price with new calculated price
              $product-&gt;set_price( $new_price );
          }
      }
      
  }
  
  // Saving and calculating price
  add_action( 'woocommerce_admin_process_product_object', 'update_product_meta_data', 100, 1 );
  function update_product_meta_data( $product ) {
  
      // Saving deposit custom field value
      saving_deposit_rate( $product ); 
  
      // Calculate and save product price from the deposit price
      calculate_and_save_new_product_price( $product );
  }
  </code></pre>
  <p>I am trying also to display the product price before the calculation that is happening inside the function <code>calculate_and_save_new_product_price</code> but with no results.</p>
  <p>An example: Product &quot;A&quot; has a regular price of 350$ and the deposit rate is 20%. Right now the price of the deposit (70$) is been displayed as the product price and that is what I want. But I also want to display the regular price of the product on the front end (350$) so that the users can be informed.</p>