WooCommerce - Adding a custom price to each product in cart
<p>I would like to update the price of products adding a custom price in cart using this simple piece of code <code>update_post_meta( $product-&gt;id, '_regular_price', $frame_price_added);</code>.</p>

<p><strong>Note:</strong> what I'm trying to achieve is to add this custom price to each product in cart.<br></p>

<p>I have try to get <code>$frame_price_added</code> this way: </p>

<pre><code>$frame_price = $res['_number_field'][0];
$frame_price_added = $product-&gt;price + $frame_price;
</code></pre>

<p>Here <code>$product-&gt;price</code> is price coming from woocomerce product and <code>$frame_price</code> is coming from my newly added price. </p>

<p>I was wondering how do I associate this new price to cart, because it doesn't work.</p>

<p>I have tried using <code>update_post_meta( $product-&gt;id, '_price', $frame_price_added);</code> and when page is refreshed it adds and stores the custom price to the product, and saved it.</p>

<p>Any idea on how I can achieve this properly?</p>

<p>Thanks.</p>

<hr>

<blockquote>
  <p><strong>Edit:</strong> One more thing… I have searched a function that can being called on add to cart and i didn't find any thing, and also an action hook being called on <code>woocommerce_template_single_add_to_cart</code> which had <code>woocommerce_single_product_summary</code> but it didn't find any function.</p>
</blockquote>