peha_danbit Posted July 28, 2014 Share Posted July 28, 2014 (edited) I'm using the webservice for updating prices and it works fine when I'm creating a new specific price for a product, but I get an error when I try to update an existing one. This is the xml that is sent: <?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <specific_prices> <specific_price> <id><![CDATA[11083]]></id> <id_shop_group><![CDATA[0]]></id_shop_group> <id_shop><![CDATA[0]]></id_shop> <id_cart><![CDATA[0]]></id_cart> <id_product xlink:href="http://domain.com/api/products/8818"><![CDATA[8818]]></id_product> <id_product_attribute><![CDATA[0]]></id_product_attribute> <id_currency><![CDATA[0]]></id_currency> <id_country><![CDATA[0]]></id_country> <id_group><![CDATA[0]]></id_group> <id_customer><![CDATA[0]]></id_customer> <id_specific_price_rule><![CDATA[0]]></id_specific_price_rule> <price><![CDATA[115]]></price> <from_quantity><![CDATA[6]]></from_quantity> <reduction><![CDATA[0.000000]]></reduction> <reduction_type><![CDATA[amount]]></reduction_type> <from><![CDATA[0000-00-00 00:00:00]]></from> <to><![CDATA[0000-00-00 00:00:00]]></to> </specific_price> </specific_prices> </prestashop> Response: <?xml version="1.0" encoding="UTF-8"?> <prestashop xmlns:xlink="http://www.w3.org/1999/xlink"> <errors> <error> <code><![CDATA[90]]></code> <message><![CDATA[id is required when modifying a resource]]></message> </error> </errors> </prestashop> Which ID is the response referring to, since the price id is set? Edited July 28, 2014 by peha_danbit (see edit history) Link to comment Share on other sites More sharing options...
websku Posted November 1, 2014 Share Posted November 1, 2014 probably you're doing edit on updating the resource. First get the specific price rule for that product, and update it accordingly with existing id. 1 Link to comment Share on other sites More sharing options...
peha_danbit Posted November 3, 2014 Author Share Posted November 3, 2014 Why do you think I haven't gotten the price rule from the product? The problem is that there is a bug in the webservice api that doesn't allow you to update multiple elements in one request. 1 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