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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T23:57:10+00:00 2026-06-10T23:57:10+00:00

ok so i got order09-05-12-1346847709.xml file in my webserver’s order folder through webhook from

  • 0

ok so i got order09-05-12-1346847709.xml file in my webserver’s order folder through webhook from shopify webhook test and the file looks like

…………………………………………….

<processing-method nil="true"></processing-method>
  <line-items type="array">
    <line-item>
      <requires-shipping type="boolean">true</requires-shipping>
      <fulfillment-service>manual</fulfillment-service>
      <grams type="integer">5000</grams>
      <price type="decimal">199.99</price>
      <quantity type="integer">1</quantity>
      <sku>SKU2006-001</sku>
      <title>Sledgehammer</title>
      <product-id type="integer" nil="true"></product-id>
      <variant-id type="integer" nil="true"></variant-id>
      <vendor nil="true"></vendor>
      <variant-title nil="true"></variant-title>
      <fulfillment-status nil="true"></fulfillment-status>
      <name>Sledgehammer</name>
      <variant-inventory-management nil="true"></variant-inventory-management>
      <properties type="array">
      </properties>
    </line-item>
    <line-item>
      <requires-shipping type="boolean">true</requires-shipping>
      <fulfillment-service>manual</fulfillment-service>
      <grams type="integer">500</grams>
      <price type="decimal">29.95</price>
      <quantity type="integer">1</quantity>
      <sku>SKU2006-020</sku>
      <title>Wire Cutter</title>
      <product-id type="integer" nil="true"></product-id>
      <variant-id type="integer" nil="true"></variant-id>
      <vendor nil="true"></vendor>
      <variant-title nil="true"></variant-title>
      <fulfillment-status nil="true"></fulfillment-status>
      <name>Wire Cutter</name>
      <variant-inventory-management nil="true"></variant-inventory-management>
      <properties type="array">
      </properties>
    </line-item>
  </line-items>

………………………………………………………………

and all i need is pick “sku and qty” value so i can update to my ms sql server’s data automatically how do i do that using php i mean i know how to connect to sql server using sqlsrv and but don’t know php code to pick specific field’s value and put values to sql server

plz guys i am desperate now ….

Thank you so much guys in advance

  • 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-10T23:57:11+00:00Added an answer on June 10, 2026 at 11:57 pm

    Here is some PHP code which fetches the sku and quantity value for each item in your XML document (it’s not the best/nicest/most powerful way to search for particular piece of information in an XML document, but it works). Since you don’t tell us how you want to insert them in your database, I cannot do much more.

    Here is the documentation about the PHP Document Object Model interface, which allows manipulation of XML documents. Please have a look at it.

    $dom = new DomDocument();
    $dom->load('order09-05-12-1346847709.xml');
    $itemList = $dom->getElementsByTagName('line-item');
    foreach($itemList as $item) {
      $sku='';
      $qty='';
      foreach($item->childNodes as $child) {
        if ($child->localName == 'sku') {
          $sku = $child->textContent;
        }
        if ($child->localName == 'quantity') {
          $qty = $child->textContent;
        }
      }
      echo 'Item SKU: ' . $sku . '<br />';
      echo 'Item quantity: ' . $qty . '<br />';
      // cast to integer: intval($qty)
      echo '<br />';
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Got a problem with jquery. I cant get a .xml file from the server,
Got this as an interview question from Amazon to test basic SQL skills and
Got an application wich read some infos in a specific XML file. I would
Got a seg fault from my memcpy that gdb can't give me anything else
Got my TextView in the xml: <TextView android:id=@+id/myTextView android:layout_width=wrap_content android:layout_height=wrap_content android:layout_gravity=center android:layout_weight=1 android:gravity=left android:text=TextView/>
Got a problem with selecting message from topic by message id. Here’s the boiled
Got this really stupid problem: Can find the proper name for the android folder
Got a class that serializes into xml with XMLEncoder nicely with all the variables
Got some strange problem, when i use $.post to a php file. The file
Got the warning from configure (last line): checking for getpagesize... yes checking for working

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.