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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:45:37+00:00 2026-05-28T07:45:37+00:00

I’m using FoxyCart. I need to feed each order to a 3rd party service

  • 0

I’m using FoxyCart. I need to feed each order to a 3rd party service (3PL Central) via SOAP. I’m using the php SoapClient.

I need to make this order feed:

<foxydata>
<store_version>
    <![CDATA[0.7.2]]>
</store_version>
<transactions>
    <transaction>
        <id>
            <![CDATA[6122236]]>
        </id>
        <store_id>
            <![CDATA[12474]]>
        </store_id>
        <store_version>
            <![CDATA[0.7.2]]>
        </store_version>
        <is_test>
            <![CDATA[1]]>
        </is_test>
        <is_hidden>
            <![CDATA[0]]>
        </is_hidden>
        <data_is_fed>
            <![CDATA[1]]>
        </data_is_fed>
        <transaction_date>
            <![CDATA[2011-11-28 16:31:53]]>
        </transaction_date>
        <payment_type>
            <![CDATA[plastic]]>
        </payment_type>
        <payment_gateway_type>
            <![CDATA[authorize]]>
        </payment_gateway_type>
        <processor_response>
            <![CDATA[Authorize.net Transaction ID:2166733111]]>
        </processor_response>
        <processor_response_details>
        </processor_response_details>
        <purchase_order>
            <![CDATA[]]>
        </purchase_order>
        <cc_number_masked>
            <![CDATA[xxxxxxxxxxxx1111]]>
        </cc_number_masked>
        <cc_type>
            <![CDATA[Visa]]>
        </cc_type>
        <cc_exp_month>
            <![CDATA[09]]>
        </cc_exp_month>
        <cc_exp_year>
            <![CDATA[2013]]>
        </cc_exp_year>
        <cc_start_date_month>
            <![CDATA[]]>
        </cc_start_date_month>
        <cc_start_date_year>
            <![CDATA[]]>
        </cc_start_date_year>
        <cc_issue_number>
            <![CDATA[]]>
        </cc_issue_number>
        <minfraud_score>
            <![CDATA[0]]>
        </minfraud_score>
        <paypal_payer_id>
            <![CDATA[]]>
        </paypal_payer_id>
        <customer_id>
            <![CDATA[2107952]]>
        </customer_id>
        <is_anonymous>
            <![CDATA[0]]>
        </is_anonymous>
        <customer_first_name>
            <![CDATA[Jacob]]>
        </customer_first_name>
        <customer_last_name>
            <![CDATA[Dubail]]>
        </customer_last_name>
        <customer_company>
            <![CDATA[]]>
        </customer_company>
        <customer_address1>
            <![CDATA[2123 4th Ave N]]>
        </customer_address1>
        <customer_address2>
            <![CDATA[]]>
        </customer_address2>
        <customer_city>
            <![CDATA[Seattle]]>
        </customer_city>
        <customer_state>
            <![CDATA[WA]]>
        </customer_state>
        <customer_postal_code>
            <![CDATA[98109]]>
        </customer_postal_code>
        <customer_country>
            <![CDATA[US]]>
        </customer_country>
        <customer_phone>
            <![CDATA[]]>
        </customer_phone>
        <customer_email>
            <![CDATA[jacob@rno1.com]]>
        </customer_email>
        <customer_ip>
            <![CDATA[24.16.147.150]]>
        </customer_ip>
        <shipping_first_name>
            <![CDATA[Jacob]]>
        </shipping_first_name>
        <shipping_last_name>
            <![CDATA[Dubail]]>
        </shipping_last_name>
        <shipping_company>
            <![CDATA[]]>
        </shipping_company>
        <shipping_address1>
            <![CDATA[2123 4th Ave N]]>
        </shipping_address1>
        <shipping_address2>
            <![CDATA[]]>
        </shipping_address2>
        <shipping_city>
            <![CDATA[Seattle]]>
        </shipping_city>
        <shipping_state>
            <![CDATA[WA]]>
        </shipping_state>
        <shipping_postal_code>
            <![CDATA[98109]]>
        </shipping_postal_code>
        <shipping_country>
            <![CDATA[US]]>
        </shipping_country>
        <shipping_phone>
            <![CDATA[]]>
        </shipping_phone>
        <shipto_shipping_service_description>
            <![CDATA[]]>
        </shipto_shipping_service_description>
        <product_total>
            <![CDATA[69.95]]>
        </product_total>
        <tax_total>
            <![CDATA[0]]>
        </tax_total>
        <shipping_total>
            <![CDATA[0]]>
        </shipping_total>
        <order_total>
            <![CDATA[69.95]]>
        </order_total>
        <receipt_url>
            <![CDATA[http://g-form.foxycart.com/receipt?id=a300bc60401cff62b15efe0cb74446d9]]>
        </receipt_url>
        <taxes>
        </taxes>
        <discounts>
        </discounts>
        <customer_password>
            <![CDATA[$P$BpyID37aTSEicSweMlC7ppaIo4E8ex0]]>
        </customer_password>
        <customer_password_salt>
            <![CDATA[]]>
        </customer_password_salt>
        <customer_password_hash_type>
            <![CDATA[phpass]]>
        </customer_password_hash_type>
        <customer_password_hash_config>
            <![CDATA[8]]>
        </customer_password_hash_config>
        <custom_fields>
        </custom_fields>
        <transaction_details>
            <transaction_detail>
                <product_name>
                    <![CDATA[11&quot; Extreme Sleeve™ for Laptops]]>
                </product_name>
                <product_price>
                    <![CDATA[69.95]]>
                </product_price>
                <product_quantity>
                    <![CDATA[1]]>
                </product_quantity>
                <product_weight>
                    <![CDATA[1.000]]>
                </product_weight>
                <product_code>
                    <![CDATA[0033]]>
                </product_code>
                <image>
                    <![CDATA[http://g-form.net/wp-content/uploads/2011/10/PRO-2285-18_large-150x150.jpg]]>
                </image>
                <url>
                    <![CDATA[http://g-form.net/products/11-extreme-sleeve%e2%84%a2-for-laptops/]]>
                </url>
                <length>
                    <![CDATA[0]]>
                </length>
                <width>
                    <![CDATA[0]]>
                </width>
                <height>
                    <![CDATA[0]]>
                </height>
                <downloadable_url>
                    <![CDATA[]]>
                </downloadable_url>
                <sub_token_url>
                    <![CDATA[]]>
                </sub_token_url>
                <subscription_frequency>
                    <![CDATA[]]>
                </subscription_frequency>
                <subscription_startdate>
                    <![CDATA[0000-00-00]]>
                </subscription_startdate>
                <subscription_nextdate>
                    <![CDATA[0000-00-00]]>
                </subscription_nextdate>
                <subscription_enddate>
                    <![CDATA[0000-00-00]]>
                </subscription_enddate>
                <is_future_line_item>
                    <![CDATA[0]]>
                </is_future_line_item>
                <shipto>
                    <![CDATA[]]>
                </shipto>
                <category_description>
                    <![CDATA[Default for all products]]>
                </category_description>
                <category_code>
                    <![CDATA[DEFAULT]]>
                </category_code>
                <product_delivery_type>
                    <![CDATA[notshipped]]>
                </product_delivery_type>
                <transaction_detail_options>
                    <transaction_detail_option>
                        <product_option_name>
                            <![CDATA[Color]]>
                        </product_option_name>
                        <product_option_value>
                            <![CDATA[Black]]>
                        </product_option_value>
                        <price_mod>
                            <![CDATA[0]]>
                        </price_mod>
                        <weight_mod>
                            <![CDATA[0.000]]>
                        </weight_mod>
                    </transaction_detail_option>
                </transaction_detail_options>
            </transaction_detail>
        </transaction_details>
        <shipto_addresses>
        </shipto_addresses>
        <attributes>
        </attributes>
    </transaction>
</transactions>
</foxydata>

Look like this. This is formatted for the SOAP call:

<Order>
    <TransInfo>
        <ReferenceNum>AS7738</ReferenceNum>
        <EarliestShipDate>2008-02-11T00:00:00</EarliestShipDate>
        <ShipCancelDate>0001-01-01T00:00:00</ShipCancelDate>
    </TransInfo>
    <ShipTo>
        <CompanyName>BB &amp; B</CompanyName>
        <Address><Address1/><City/><State/><Zip/><Country/></Address>
    </ShipTo>
    <ShippingInstructions><Carrier>LVLA</Carrier></ShippingInstructions>
    <OrderLineItems>
        <OrderLineItem><SKU>12345</SKU><Qty>8.00000</Qty><Packed>2</Packed<CuFtPerCarton>1.400000</CuFtPerCarton></OrderLineItem>
        <OrderLineItem><SKU>98572</SKU><Qty>116.00000</Qty><Packed>4</Packed>CuFtPerCarton>2.100000</CuFtPerCarton></OrderLineItem>
        <OrderLineItem><SKU>98873</SKU><Qty>20.00000</Qty><Packed>4</Packed>CuFtPerCarton>2.100000</CuFtPerCarton></OrderLineItem>
        <OrderLineItem><SKU>36774</SKU><Qty>40.00000</Qty><Packed>4</Packed>CuFtPerCarton>2.100000</CuFtPerCarton></OrderLineItem>
    </OrderLineItems>
</Order>

What’s the best way to go about doing this?

The ideas I’ve come up with include:

  1. Extracting the necessary nodes from the foxycart feed and insert them into the SOAP array.

  2. Somehow filter through the foxycart feed, strip out the unnecessary data and modify the nodes as needed. (no idea how i’d actually achieve this).

Any ideas?

Thanks,
Jacob

  • 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-05-28T07:45:38+00:00Added an answer on May 28, 2026 at 7:45 am
    $data    = file_get_contents($xml);
    $data    = new SimpleXMLElement($data);
    $date    = date(DATE_ATOM);
    $result  = $data->xpath('/foxydata/transactions/transaction');
    $country = ( trim($result[0]->customer_country) == "US" ) ? "USA" : trim($result[0]->customer_country);
    $i       = 0;
    
    foreach ( $result[0]->transaction_details->transaction_detail as $transaction ) {
    
        $OrderLineItem['OrderLineItem'][$i] = array (
            'SKU'            => trim((string)$transaction->product_code),
            'Qty'            => trim((int)$transaction->product_quantity),
            'Packed'         => trim((string)$transaction->product_weight),
            'CuFtPerCarton'  => '0.0006'
        );
        $i++;
    
    }
    
    
    
    $ArrayOfOrder  = array ( 
        'Order' => array(
        'TransInfo'            => array(
            'ReferenceNum'      => trim((string)$result[0]->customer_id) . trim((string)$result[0]->id),
            'EarliestShipDate'  => $date,
            'ShipCancelDate'    => strtotime(date(DATE_ATOM, strtotime($date)) . "+1 month"),
            'PONum'             => trim((string)$result[0]->customer_last_name) . '_' . trim((string)$result[0]->id)
        ),
        'ShipTo'               => array(
            'Name'          => trim((string)$result[0]->customer_first_name) . ' ' . trim((string)$result[0]->customer_last_name),
            'CompanyName'   => trim((string)$result[0]->customer_company),
            'Address'       => array(
                'Address1' => trim((string)$result[0]->customer_address1),
                'Address2' => trim((string)$result[0]->customer_address2),
                'City'     => trim((string)$result[0]->customer_city),
                'State'    => trim((string)$result[0]->customer_state),
                'Zip'      => trim((string)$result[0]->customer_postal_code),
                'Country'  => $country
            ),
        'EmailAddress1' => trim((string)$result[0]->customer_email),
        'CustomerName'  => 'DEMO'
    
    ),
        'ShippingInstructions' => 'DEFAULT',
        'Notes'                => trim((string)$result[0]->processor_response),
        'PalletCount'          => 1,
        'OrderLineItems'       => $OrderLineItem
    ));
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have thousands of HTML files to process using Groovy/Java and I need to
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
That's pretty much it. I'm using Nokogiri to scrape a web page what has
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I would like to count the length of a string with PHP. The string

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.