Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8825097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T06:47:51+00:00 2026-06-14T06:47:51+00:00

I running a similar script to this script from fiddle http://jsfiddle.net/QmTNZ/2/ I tried to

  • 0

I running a similar script to this script from fiddle
http://jsfiddle.net/QmTNZ/2/

I tried to modify it to work with my table.

Here is the link to the table on the product page

http://styleso1.nextmp.net/dev/shop/safari-pu-sleeve-jacket.html

I need it to calculate the Qty ( input box, Column 4) X the unit price ( Column 5 ) and show the sum in column 6

How would i modify the JS to do this?

Here is what i have for the JS

$(function(){
function ca(){
    var $overall = 0;

    $("tr.sum").each(function() {

        var $qnt = $(this).find(".qty");
        var $price = $(this).find("td").eq(1);

        console.log($qnt + " | " + $price);

        var sum = parseFloat($price.text()) * parseFloat($qnt.val());

        $(this).find(".a-center1").text(sum);

        $overall += sum;

    });

    $("#total").text($overall);
}

$(function() {

    ca();
    $('input.qty').bind('change keyup',function(){ca();});

});

Any Help would be very appreciated

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T06:47:53+00:00Added an answer on June 14, 2026 at 6:47 am

    Try this

      $("tr.sum").each(function() {
    
            var $qnt = $(this).find(".qty");
            var $price = $(this).find("td:eq(4)").find('.price');
    
            console.log($qnt + " | " + $price);
            var pri = $price.text();
                pri = pri.replace('$', '');
            var sum = parseFloat(pri) * parseFloat($qnt.val());
    
            $(this).find("td").eq(5).text('$' + sum);
    
            $overall += sum;
    
        });
        $("#total").text('$' +$overall);
    

    Check Fiddle

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've read numerous similar questions, but the answers simply didn't work. Running this function
I have a script running a batch of very similar queries. All of them,
I am running into an issue similar to the one described here: NSFetchedResultsControllerDelegate not
I'm running a MapReduce task on Gzipped .arc files. Similar to this question ,
This function is giving me trouble running something similar to the example provided at:
Ok, so I'm currently running this script to remove all the excess spaces, linebreaks,
Similar to this question I have a small groovy test script that basically uses
This is a snippet from the middle of a bash script we use for
I have an HTML table of similar structure to this, however: rowspans are not
I want to make a function that is always running in xcode similar to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.