title: Trying to show the total price of a grouped product in view page simultaneously on selection of qty in Magento
body: <p>I'm try to display the total price of a grouped product on selection of the quantities, which simultaneously updates the price in total as shown in the picture. The issue I'm currently facing is, I'm able to see the updated the total price. But the price value is not appropriate. And It is considering only one item price i.e; the price remains the same and and calculating the total price. Please help me, How can I do this. Thanks in Advance:)</p>
  
  <p>And the code is below;</p>
  
  <pre><code> &lt;table class="data-table grouped-items-table" id="super-product-table"&gt;
  &lt;col /&gt;
  &lt;col /&gt;
  &lt;col width="1" /&gt;
  &lt;thead&gt;
      &lt;tr&gt;
          &lt;th&gt;&lt;?php echo $this-&gt;__('Product Name') ?&gt;&lt;/th&gt;
          &lt;?php if ($this-&gt;getCanShowProductPrice($_product)): ?&gt;
          &lt;th class="a-right"&gt;&lt;?php echo $this-&gt;__('Price') ?&gt;&lt;/th&gt;
          &lt;?php endif; ?&gt;
          &lt;?php if ($_product-&gt;isSaleable()): ?&gt;
          &lt;th class="a-center"&gt;&lt;?php echo $this-&gt;__('Qty') ?&gt;&lt;/th&gt;
          &lt;?php endif; ?&gt;
      &lt;/tr&gt;
  &lt;/thead&gt;
  &lt;tbody&gt;
  &lt;?php if ($_hasAssociatedProducts): ?&gt;
  &lt;?php foreach ($_associatedProducts as $_item): ?&gt;
      &lt;?php $_finalPriceInclTax = $this-&gt;helper('tax')-&gt;getPrice($_item, $_item-&gt;getFinalPrice(), true) ?&gt;
      &lt;tr&gt;
          &lt;td&gt;&lt;?php echo $this-&gt;escapeHtml($_item-&gt;getName()) ?&gt;&lt;/td&gt;
          &lt;?php if ($this-&gt;getCanShowProductPrice($_product)): ?&gt;
          &lt;td class="a-right"&gt;
              &lt;?php if ($this-&gt;getCanShowProductPrice($_item)): ?&gt;
              &lt;?php echo $this-&gt;getPriceHtml($_item, true) ?&gt;
              &lt;?php echo $this-&gt;getTierPriceHtml($_item) ?&gt;
              &lt;?php endif; ?&gt;
          &lt;/td&gt;
          &lt;?php endif; ?&gt;
          &lt;?php if ($_product-&gt;isSaleable()): ?&gt;
          &lt;td class="a-center"&gt;
          &lt;?php if ($_item-&gt;isSaleable()) : ?&gt;
              &lt;input type="text" name="super_group[&lt;?php echo $_item-&gt;getId() ?&gt;]" maxlength="12" value="&lt;?php echo $_item-&gt;getQty()*1 ?&gt;" title="&lt;?php echo $this-&gt;__('Qty') ?&gt;" class="txt" /&gt;
              &lt;input type="hidden" name="myprice" maxlength="12" id="myprice" value="&lt;?php echo $_item-&gt;getPrice() ?&gt;" title="&lt;?php echo $this-&gt;__('') ?&gt;" class="myprice" /&gt;
          &lt;?php else: ?&gt;
              &lt;p class="availability out-of-stock"&gt;&lt;span&gt;&lt;?php echo $this-&gt;__('Out of stock') ?&gt;&lt;/span&gt;&lt;/p&gt;
          &lt;?php endif; ?&gt;
          &lt;/td&gt;
          &lt;?php endif; ?&gt;
          &lt;tr&gt;&lt;div class="myprice" style="display:none;"&gt;&lt;?php echo $_item-&gt;getPrice() ?&gt;&lt;/div&gt;&lt;/tr&gt;
      &lt;/tr&gt;
  &lt;?php endforeach; ?&gt;
  &lt;?php else: ?&gt;
     &lt;tr&gt;
         &lt;td colspan="&lt;?php if ($_product-&gt;isSaleable()): ?&gt;4&lt;?php else : ?&gt;3&lt;?php endif; ?&gt;"&gt;&lt;?php echo $this-&gt;__('No options of this product are available.') ?&gt;&lt;/td&gt;
     &lt;/tr&gt;
  &lt;?php endif; ?&gt;
  
  &lt;tr id="summation"&gt;
      &lt;td&gt;&amp;nbsp;&lt;/td&gt;
      &lt;td align="right"&gt;&lt;strong style=""&gt; Total Price: &lt;/strong&gt;&lt;/td&gt;
      &lt;td align="center"&gt;&lt;strong&gt;&lt;span id="sum"&gt;0&lt;/span&gt;&lt;/strong&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;/tbody&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>$(document).ready(function(){
  
      $(".txt").each(function() {
  
          $(this).keyup(function(){
              var price = $('.myprice').html();
              calculateSum(price);
          });
      });
  
  });
  
  function calculateSum(price) {
      var sum = 0;
  
      $(".txt").each(function() {
          if(!isNaN(this.value) &amp;&amp; this.value.length!=0) {
              sum = sum + price * parseFloat(this.value);
          }
      });
  
      $("#sum").html(sum.toFixed(2));
  }
  </code></pre>
  
  <p></p>