Jump to content

How to fix "response: Fatal error" after add an order webservice


Recommended Posts

I try to send order via webservice and I get a Fatal error when add all data

$opt = array( 'resource' => 'orders' );
$opt['postXml'] = $xml->asXML();            
$xml = $webService->add( $opt );

When I debug $xml variable as

SimpleXMLElement Object
(
    [order] => SimpleXMLElement Object
        (
            [id] => SimpleXMLElement Object
                (
                )

            [id_address_delivery] => 6
            [id_address_invoice] => 6
            [id_cart] => 8
            [id_currency] => 1
            [id_lang] => 1
            [id_customer] => 3
            [id_carrier] => 1
            [current_state] => 3
            [module] => cheque
            [invoice_number] => 4
            [invoice_date] => 2018-02-27 10:49:26
            [delivery_number] => 4
            [delivery_date] => 2018-02-27 11:01:16
            [valid] => 1
            [date_add] => 2018-03-01 13:29:15
            [date_upd] => 2018-03-01 13:29:15
            [shipping_number] => SimpleXMLElement Object
                (
                )

            [id_shop_group] => 1
            [id_shop] => 1
            [secure_key] => e11cbc9fd3ac6043858a1d5f926c099a
            [payment] => Chèque
            [recyclable] => 0
            [gift] => 0
            [gift_message] => SimpleXMLElement Object
                (
                )

            [mobile_theme] => 0
            [total_discounts] => 0.000000
            [total_discounts_tax_incl] => 0.000000
            [total_discounts_tax_excl] => 0.000000
            [total_paid] => 3654.800000
            [total_paid_tax_incl] => 3654.800000
            [total_paid_tax_excl] => 3654.800000
            [total_paid_real] => 3654.800000
            [total_products] => 3654.800000
            [total_products_wt] => 3654.800000
            [total_shipping] => 0.000000
            [total_shipping_tax_incl] => 0.000000
            [total_shipping_tax_excl] => 0.000000
            [carrier_tax_rate] => 20.000
            [total_wrapping] => 0.000000
            [total_wrapping_tax_incl] => 0.000000
            [total_wrapping_tax_excl] => 0.000000
            [round_mode] => 2
            [round_type] => 2
            [conversion_rate] => 1.000000
            [reference] => EDNLTAXBL
            [associations] => SimpleXMLElement Object
                (
                    [order_rows] => SimpleXMLElement Object
                        (
                            [order_row] => SimpleXMLElement Object
                                (
                                    [id] => SimpleXMLElement Object
                                        (
                                        )

                                    [product_id] => 16
                                    [product_attribute_id] => 64
                                    [product_quantity] => 1
                                    [product_name] => Produit test - Couleur : Noir
                                    [product_reference] => pt_1
                                    [product_ean13] => SimpleXMLElement Object
                                        (
                                        )

                                    [product_upc] => SimpleXMLElement Object
                                        (
                                        )

                                    [product_price] => 874.800000
                                    [unit_price_tax_incl] => 874.800000
                                    [unit_price_tax_excl] => 874.800000
                                )

                        )

                )

        )

)

What data information I missed ?

This is the response:

Array
(
    [status_code] => 200
    [response] => Fatal error
    [header] => HTTP/1.1 200 OK
Date: Thu, 01 Mar 2018 13:41:18 GMT
Server: Apache/2.4.18 (Ubuntu)
Vary: Authorization
Set-Cookie: PrestaShop-b267ffa9605e030ec50b20af216fa697=ciElybz98Km%2FtR2q2OICwMd65RLz5TqNjj8T%2B950M42XVxt4seNRdUFtEDxFeuLivgc0YPTCAWshjQXmTM27TQttU7Q2hgk2VMLfOMExCWw%3D000079; expires=Wed, 21-Mar-2018 13:41:18 GMT; Max-Age=1728000; path=/projet/ps_1.6.1.17/c1/; domain=site.com; HttpOnly
Content-Length: 11
Content-Type: text/html; charset=utf-8
)
Edited by MICJAO
var dumping the response (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...