Title: Update variable product total amount by javascript
Last modified: March 10, 2022

---

# Update variable product total amount by javascript

 *  Resolved [mdk22](https://wordpress.org/support/users/mdk22/)
 * (@mdk22)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/update-variable-product-total-amount-by-javascript/)
 * I have a plugin that update the product price depended on selected variation.
   My problem is that there are two prices that my plugin change just one of them.
   I want to change the code to update the total amount too. I want to know how 
   can I change this amount by javascript.
 * > [View post on imgur.com](https://imgur.com/9o7QB)
 * I checked the page’s template in single-product/add-to-cart/variation.php and
   find this line that generate the secound/total price:
 * <div class=”woocommerce-variation-price”>`data.variation.price_html`</div>
    Is
   there any way to update this price that can show total amount by javascript?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  [Juan G. (woo-hc)](https://wordpress.org/support/users/judagutor/)
 * (@judagutor)
 * [4 years, 3 months ago](https://wordpress.org/support/topic/update-variable-product-total-amount-by-javascript/#post-15447287)
 * Hi [@mdk22](https://wordpress.org/support/users/mdk22/)!
 * Since this requires custom coding, which is outside our scope of support, I am
   leaving this thread open for a bit to see if anyone can chime in to help you 
   out.
 * For additional assistance on this topic, we recommend getting in touch with one
   of the customization experts listed on the [WooCommerce Customizations Page](https://woocommerce.com/customizations/);
   they can help you with the code you need.
 * Also, you can visit the [WooCommerce Facebook group](https://www.facebook.com/groups/advanced.woocommerce/)
   or the #developers channel of the [WooCommerce Community Slack](https://woocommerce.com/community-slack/),
   you could find help from the community of open-source developers for WooCommerce
   that hangs in there.
 * Cheers!
 *  [Juan G. (woo-hc)](https://wordpress.org/support/users/judagutor/)
 * (@judagutor)
 * [4 years, 2 months ago](https://wordpress.org/support/topic/update-variable-product-total-amount-by-javascript/#post-15470151)
 * Hi there,
 * We haven’t heard back from you in a while, so I’m marking this thread as resolved.
 * Hopefully, the provided information was helpful, and you solved the issue. If
   you have any further questions, we recommend [creating a new thread](https://wordpress.org/support/plugin/woocommerce/#new-topic-0).
 * Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Update variable product total amount by javascript’ is closed to new 
replies.

 * ![](https://ps.w.org/woocommerce/assets/icon.svg?rev=3234504)
 * [WooCommerce](https://wordpress.org/plugins/woocommerce/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce/reviews/)

## Tags

 * [variable product](https://wordpress.org/support/topic-tag/variable-product/)

 * 2 replies
 * 2 participants
 * Last reply from: [Juan G. (woo-hc)](https://wordpress.org/support/users/judagutor/)
 * Last activity: [4 years, 2 months ago](https://wordpress.org/support/topic/update-variable-product-total-amount-by-javascript/#post-15470151)
 * Status: resolved