Conselio Posted May 8, 2018 Share Posted May 8, 2018 (edited) Bonjour à tous Quand j'appelle le webservice comme ceci : <?php $webService = new PrestaShopWebservice(PS_SHOP_PATH, PS_WS_AUTH_KEY, DEBUG); $opt['resource'] = 'carts'; $opt['id'] = (int)8; // cast string => int for security measures // Call $xml = $webService->get($opt); // Here we get the elements from children of customer markup which is children of prestashop root markup $resources = $xml->children()->children(); I get : <CART_ROWS nodeType="cart_row" virtualEntity="true"> <CART_ROW> <ID_PRODUCT xlink:href="https://myshop.com/api/products/1"><![CDATA[1]]></ID_PRODUCT> <ID_PRODUCT_ATTRIBUTE xlink:href="https://myshop.com/api/combinations/0"><![CDATA[0]]></ID_PRODUCT_ATTRIBUTE> <ID_ADDRESS_DELIVERY xlink:href="https://myshop.com/api/addresses/0"><![CDATA[0]]></ID_ADDRESS_DELIVERY> <QUANTITY><![CDATA[2]]></QUANTITY> </CART_ROW> <CART_ROW> <ID_PRODUCT xlink:href="https://myshop.com/api/products/3"><![CDATA[3]]></ID_PRODUCT> <ID_PRODUCT_ATTRIBUTE xlink:href="https://myshop.com/api/combinations/0"><![CDATA[0]]></ID_PRODUCT_ATTRIBUTE> <ID_ADDRESS_DELIVERY xlink:href="https://myshop.com/api/addresses/0"><![CDATA[0]]></ID_ADDRESS_DELIVERY> <QUANTITY><![CDATA[1]]></QUANTITY> </CART_ROW> <CART_ROW> <ID_PRODUCT xlink:href="https://myshop.com/api/products/968"><![CDATA[968]]></ID_PRODUCT> <ID_PRODUCT_ATTRIBUTE xlink:href="https://myshop.com/api/combinations/0"><![CDATA[0]]></ID_PRODUCT_ATTRIBUTE> <ID_ADDRESS_DELIVERY xlink:href="https://myshop.com/api/addresses/0"><![CDATA[0]]></ID_ADDRESS_DELIVERY> <QUANTITY><![CDATA[3]]></QUANTITY> </CART_ROW> <CART_ROW> <ID_PRODUCT xlink:href="https://myshop.com/api/products/2949"><![CDATA[2949]]></ID_PRODUCT> <ID_PRODUCT_ATTRIBUTE xlink:href="https://myshop.com/api/combinations/0"><![CDATA[0]]></ID_PRODUCT_ATTRIBUTE> <ID_ADDRESS_DELIVERY xlink:href="https://myshop.com/api/addresses/0"><![CDATA[0]]></ID_ADDRESS_DELIVERY> <QUANTITY><![CDATA[7]]></QUANTITY> </CART_ROW> <CART_ROW> <ID_PRODUCT xlink:href="https://myshop.com/api/products/2978"><![CDATA[2978]]></ID_PRODUCT> <ID_PRODUCT_ATTRIBUTE xlink:href="https://myshop.com/api/combinations/0"><![CDATA[0]]></ID_PRODUCT_ATTRIBUTE> <ID_ADDRESS_DELIVERY xlink:href="https://myshop.com/api/addresses/0"><![CDATA[0]]></ID_ADDRESS_DELIVERY> <QUANTITY><![CDATA[15]]></QUANTITY> </CART_ROW> </CART_ROWS> Mais, CART_ROW est trié par id_product. Comment puis je avoir le même résultat trié par date_add (le dernier produit ajouté par le client à la fin de la collecion cart_rows) Merci pour votre aide Edited May 8, 2018 by Conselio (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now