Jump to content

[Webservice] get order's item list details


Recommended Posts

I this is prestashop webservice order code:

$opt5['resource'] = 'orders';
$xml = $webService->get($opt5);
$r5 = $xml->children()->children();
var_dump($r5);

this output

 public 'associations' => 
    object(SimpleXMLElement)[13]
      public 'order_rows' => 
        object(SimpleXMLElement)[24]
          public '@attributes' => 
            array (size=2)
              ...
          public 'order_row' => 
            object(SimpleXMLElement)[25]
              ...

this is xml direct 'api/orders/7'  out put from browser

...
<conversion_rate>1.000000</conversion_rate>
<reference>WLSFXXBJA</reference>
<associations>
	<order_rows nodeType="order_row" virtualEntity="true">
		<order_row>
			<id>17</id>
			<product_id>1</product_id>
			<product_attribute_id>1</product_attribute_id>
			<product_quantity>1</product_quantity>
			<product_name>Faded Short Sleeves T-shirt - Size : S, Color : Orange</product_name>
			<product_reference>demo_1</product_reference>
			<product_ean13/>
			<product_upc/>
			<product_price>16.510000</product_price>
			<unit_price_tax_incl>16.510000</unit_price_tax_incl>
			<unit_price_tax_excl>16.510000</unit_price_tax_excl>
		</order_row>
		<order_row>
			<id>18</id>
			<product_id>3</product_id>
			<product_attribute_id>13</product_attribute_id>
			<product_quantity>1</product_quantity>
			<product_name>Printed Dress - Size : S, Color : Orange</product_name>
			<product_reference>demo_3</product_reference>
			<product_ean13/>
			<product_upc/>
			<product_price>25.999852</product_price>
			<unit_price_tax_incl>25.999852</unit_price_tax_incl>
			<unit_price_tax_excl>25.999852</unit_price_tax_excl>
		</order_row>
	</order_rows>
</associations>
...

in var_dump didn't show the 'associations' data, i want to get 'associations' value out.

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...