title: How to show total price of a product based on its variations in react?
body: <p>I am trying to show the total price of a product based on its selected variants. Like when the user's select the variants from a list, a price will be shown based on that. my variants object is,</p>
  <pre><code>choice_options: Array(4)
  0:
  name: &quot;choice_3&quot;
  options: (3) ['2', '54', '67']
  title: &quot;imrunvai&quot;
  [[Prototype]]: Object
  1:
  name: &quot;choice_2&quot;
  options: (5) ['3543', '3', '453', '45', '345']
  title: &quot;sakeefvai&quot;
  [[Prototype]]: Object
  2:
  name: &quot;choice_4&quot;
  options: (3) ['345', '45', '4']
  title: &quot;sharifvai&quot;
  [[Prototype]]: Object
  3:
  name: &quot;choice_1&quot;
  options: (3) ['128gb', '  256gb', '  476gb']
  title: &quot;Size&quot;
  [[Prototype]]: Object
  length: 4
  [[Prototype]]: Array(0)
  </code></pre>
  <p>This array is totally dynamic. Based on this data I designed frontend like so,</p>
  <p><a href="https://i.stack.imgur.com/MXc5Y.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MXc5Y.png" alt="enter image description here" /></a></p>
  <p>for showing the price based on variants I need to make a variable like,</p>
  <p>type: 'first_selected_value-second_selected_value-3rd_selected_value-4th_selected_value-5th_selected_value'</p>