2015-12-15 5 views
0

Я пытаюсь создать заказы благодаря Prestashop WebServices. Я успешно создал Клиенты, Адреса и Тележки, но создание заказов сбой. Здесь ошибка я получаю, используя следующий завиток запрос:Prestashop Webservices - Property OrderDetail-> product_price пуст при создании заказа

curl -i -X POST -d @tmpOrder.text http://[email protected]:8888/api/orders 

Недвижимость OrderDetail-> PRODUCT_PRICE пусто

Вот файлы XML, которые я использую, чтобы создать свою тележку (и пытается создать мой заказ.

tmpCart.text

<?xml version="1.0" encoding="UTF-8"?> 
<prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> 
<cart> 
     <id></id> 
    <id_address_delivery>6</id_address_delivery> 
    <id_address_invoice>6</id_address_invoice> 
    <id_currency>1</id_currency> 
    <id_customer>2</id_customer> 
    <id_guest></id_guest> 
    <id_lang>1</id_lang> 
    <id_shop_group>1</id_shop_group> 
    <id_shop>1</id_shop> 
    <id_carrier>2</id_carrier> 
    <recyclable></recyclable> 
    <gift></gift> 
    <gift_message></gift_message> 
    <mobile_theme></mobile_theme> 
    <delivery_option></delivery_option> 
    <secure_key></secure_key> 
    <allow_seperated_package></allow_seperated_package> 
    <date_add></date_add> 
    <date_upd></date_upd> 
<associations> 
<cart_rows> 
    <cart_row> 
    <id_product>2</id_product> 
    <product_price>26.999852</product_price> 
    <id_product_attribute>1</id_product_attribute> 
    <id_address_delivery>6</id_address_delivery> 
    <quantity>2</quantity> 
    </cart_row> 
</cart_rows> 
</associations> 
</cart> 
</prestashop> 

tmpOrd er.txt

<prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> 
<order> 
     <id></id> 
     <id_address_delivery>6</id_address_delivery> 
     <id_address_invoice>6</id_address_invoice> 
     <id_cart>42</id_cart> 
     <id_currency>1</id_currency> 
     <id_lang>1</id_lang> 
     <id_customer>2</id_customer> 
     <id_carrier>2</id_carrier> 
     <current_state>1</current_state> 
     <module>cheque</module> 
     <payment>Chèque</payment> 
     <total_paid>1</total_paid> 
     <total_paid_real>54</total_paid_real> 
     <total_products>2</total_products> 
     <total_products_wt>54</total_products_wt> 
     <conversion_rate>1</conversion_rate> 
     <reference></reference> 
<associations> 
<order_rows> 
     <order_row> 
     <id></id> 
     <product_id>2</product_id> 
     <product_attribute_id>1</product_attribute_id> 
     <product_quantity>2</product_quantity> 
     <product_name>TEST</product_name> 
     <product_reference></product_reference> 
     <product_ean13></product_ean13> 
     <product_upc></product_upc> 
     <product_price>26.999852</product_price> 
     <unit_price_tax_incl>26.999852</unit_price_tax_incl> 
     <unit_price_tax_excl>26.999852</unit_price_tax_excl> 
</order_row> 
</order_rows> 
</associations> 
</order> 
</prestashop> 

ответ

1

Я наконец узнал, что не так. Похоже, что product_attribute_id моего продукта был неправильным. Поэтому он искал несущественную цену в массиве цен.