I ask you help to change the price of the product taken the value from the data of the post and not from the the meata-data of woocommerce.
We cannot help with this.
We can help with how you take data from Toolset Content, in a Toolset Form, we can show how to update native Posts and other data with that data.
How to update complex WooCommerce data sets is something that the dedicated Support of WooCommerce should answer to you.
If you would ask WooCommerce Support to help you update a complex Post Data of Toolset (relationship for example) they'd ask you to ask us (and we could help).
Here, we cannot help.
https://toolset.com/toolset-support-policy/
Now I ask you help to change the price of the cart using the price value displayed in custom post (wpcf-quote-person-price) and not the price set in the woocommerce meta. (B) This doesn not works.
We can help you to get that data, and we can help to find the correct hook in the Toolset Form, where that data exists and can be used.
The data you plan to use seems stored in a Toolset Post Field.
wpcf-quote-person-price
You can get the value of that field with 2 methods:
- from the form input ($_POST['form_field_key'])
- from the post in the database (usually, get_post_meta() or types_render_meta())
https://toolset.com/documentation/customizing-sites-using-php/functions/
https://developer.wordpress.org/reference/functions/get_post_meta/
You do that already with get_post_meta($product_id, 'wpcf-quote-person-price', true);
You mentioned that the field was stored in a Post Type, not in Products, but you seem to get products in the previous code that actually populates $product_id. So it could be that you try to access the wrong post type, if you have that field stored in a Post type that the form edits or creates, then you need to get that field value from that post type, and then update the WooCommerce product with it (or price, or any other data of WooCommerce)
Try to var_dump() $product_id, see what you receive.
hidden link
If that post id you receive is the one with the field, then all good. If not, look earlier in the code what you get.
Next var_dump() $person_total_price and see if it's the right value (should be, if all above is correct)
Now you have the value and can utilize WooCommerce API to update their data set