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 8334175
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:15:35+00:00 2026-06-09T03:15:35+00:00

From this order object, I want to extract a particular property from each of

  • 0

From this order object, I want to extract a particular property from each of the objects in the products array.

var order = {
  "products": [
    {
      "product_name":"Name",
      "product_sku":"000000075266",
      "pricesUnformatted":5130,
      "prices":"5.130 EUR",
      "subtotal":5130,
      "subtotal_tax_amount":0,
      "subtotal_discount":0,
      "subtotal_with_tax":5130,
      "quantity":18
    },
    {
      "product_name":"Name2",
      "product_sku":"000000072312",
      "pricesUnformatted":369,
      "prices":"369 EUR",
      "subtotal":369,
      "subtotal_tax_amount":0,
      "subtotal_discount":0,
      "subtotal_with_tax":369,
      "quantity":1
    }
  ],
  "totalProduct":19,
  "billTotal":"<div class='cart_left'>TotalPrice<\/div> : <strong>6.826 EUR<\/strong>",
  "dataValidated":false,
  "totalProductTxt":"<div class='cart_left'>Quantity<\/div> <div class='cart_right'><strong>19<\/strong><\/div>"
}

So from this object I want to get the “subtotal_with_tax” items and than SUM them and of course print the result because the “billTotal” contains the shipping price which I don’t need and I can’t modify the code before I get this object.

I tryed to make it work but I’m stuck at This point because I don’t know how to target a specific item’s value like in this case “subtotal_with_tax” :

$.each(order.products, function(key, val) {
  $.each(val, function(key, val) {});
});
  • 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-09T03:15:38+00:00Added an answer on June 9, 2026 at 3:15 am
    var subtotals_with_tax = 0;
    
    $.each( order.products, function( index, product ) {
    
      subtotals_with_tax += product.subtotal_with_tax;
    
    } );
    

    As @eicto said, if you only care about browsers that support it, or are using a “polyfill” for map(), or ES5 methods in general, in other browsers, by all means use map():

    var subtotals_with_tax = 0;
    
    order.products.map( function( product ) {
    
      subtotals_with_tax += product.subtotal_with_tax;
    
    } );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I use this statement: $query = select * from Products where category_description='.$search_dept.' ORDER
hie all, my query is this select * from [order] where createdon<getdate()-7 and orderid
I written a query in my sql like this: select * from table_name order
Given this SQL: SELECT * FROM mytable ORDER BY mycolumn, RAND() Assuming that mycolumn
Take this query: SELECT * FROM MyTable WHERE MyColumn = 'SomeValue' ORDER BY SomeFakeQualifier.MyColumn
I use this $query = SELECT * FROM info ORDER BY id DESC limit
This is my code: $query = mysql_query(SELECT * FROM books ORDER BY id) or
My current method is this: SELECT TOP 1 ID FROM DATAENTRY ORDER BY ID
i want something like this : public class Order { public Guid OrderID {
So i have this json I got from a previous query: {HUID:1,UIDS:1,2,3,name:home,type:page,cat_id:home} I print

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.