Set cart item price from a hidden input field custom price in Woocommerce 3
问题 In Woocommerce, I used jQuery to calculate a custom price on a single product pages, and now need to pass this value to the cart. The desired behavior is to pass the new price retrieved from the hidden field to the cart item price. Here is my actual code: // Hidden input field in single product page add_action( 'woocommerce_before_add_to_cart_button', 'custom_hidden_product_field', 11, 0 ); function custom_hidden_product_field() { echo '<input type="hidden" id="hidden_field" name="custom