tobiaseriksson Posted March 31, 2015 Share Posted March 31, 2015 Hi I am trying to add products using the Webservice API BUT I am lost, I am unable to properly set the category and the supplier I did a GET to see how the XML looked like, then I took some of the important TAGs and filled them with information. What I am posting looks like this, see below, and it works fine to add the product, it is just that it does not have a category nor a supplier. The category ID and supplier ID exists, and are correct, and should I do the reverse and assign it inside the UI/Website it looks just like this. So what am I doing wrong here ? -Tobias <prestashop xmlns:ns0="http://www.w3.org/1999/xlink"> <product> <new /> <id>0</id> <id_supplier ns0:href="http://www.site.se/api/suppliers/6">6</id_supplier> <id_category_default ns0:href="http://www.site.se/api/categories/1660">1660</id_category_default> <id_shop_default>1</id_shop_default> <reference>NotSet</reference> <price>0.0</price> <wholesale_price>0.0</wholesale_price> <name><language id="6" ns0:href="http://www.site.se/api/languages/6">Ej Namngiven</language></name> <description_short><language id="6" ns0:href="http://www.site.se/api/languages/6" />some short description</description_short> <description><language id="6" ns0:href="http://www.site.se/api/languages/6" />little bit more detail</description> <condition>new</condition> <show_price>1</show_price> <indexed>0</indexed> </product> </prestashop> Link to comment Share on other sites More sharing options...
tobiaseriksson Posted April 15, 2015 Author Share Posted April 15, 2015 I figured out how to set the category basically set the category IDs inside of the associations/categories like this <associations> <categories node_type="category"> <category> <id><![CDATA[1660]]></id> </category> </categories> .... 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