php - Prestashop Webservice Add product -


I work with Prestashop 1.5 and I try to put a product with Prestashop's Webservice API PHP, but It never works ...

For example, I found a category entry script, but it does not work:

ex> & Lt ;? Php require_once ('./PWWebServiceLibrary.php'); Define ('DEBUG', true); Define ('PS_SHOP_PATH', 'http: //dev.************************************); Define ('PS_WS_AUTH_KEY', '*****************************); $ WebService = New PrestaShopWebservice (PS_SHOP_PATH, PS_WS_AUTH_KEY, DEBUG); $ Xml = $ web service - & gt; Obtain (array ('url' = & gt; PS_SHOP_PATH. '/ Api / categories? Schema = summary')); $ Resource = $ xml - & gt; Children () - & gt; children(); Unset ($ resource -> ID); Unset ($ resource - & gt; position); Unset ($ resource - & gt; date_add); Unset ($ resource - & gt; date_upd); // Unset ($ resource -> id_parent); // If the unset category will be root. If set, then it should have an existing parent class ID! Unset ($ resource - & gt; level_depth); Unset ($ resource - & gt; nb_products_recursive); $ Resource - & gt; Id_parent = '6'; $ Resource - & gt; Name - & gt; Language [0] [0] = 'test'; $ Resource - & gt; Link_rewrite-> Language [0] [0] = 'test'; $ Resource - & gt; Active = 1; $ Resource - & gt; Id_shop_default = 1; $ Resource - & gt; Is_root_category = 0; $ Opt = array ('resource' => 'categories'); $ Opt ['postXml'] = $ xml - & gt; AsXML (); $ Xml = $ web service - & gt; ($ Opt);

I have an error 500.

Is anyone's solution?

Thank you in advance!


Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -