Jump to content

ale93p

Members
  • Posts

    2
  • Joined

  • Last visited

Profile Information

  • Activity
    Developer

ale93p's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi, When I try to load the manufacturers xml via web services using http://www.mywebsite.com/api/manufacturers it returns to me: <error> <message> <![CDATA[ Internal error. To see this error please display the PHP errors. ]]> </message> </error> If I enable display PHP errors it works, the manufacturers are displayed correctly without erros. I got this problem only win Manufacturers. Do you have any idea how to solve this? Thanks
  2. Hi guys i'm trying to add a new product via web services using the PSWebServiceLibrary, i tried to read other posts in this forum but i have problems. That's my code: function AddProduct($root_path, $authentication_key, $id, $name, $desc, $cat, $qta, $price){ try{ $webService = CreateWebServer($root_path,$authentication_key); $xml = $webService->get(array('resource' => 'products?schema=synopsis')); }catch(PrestashopWebserviceException $ex){ echo $ex->getMessage(); return -1; } $resources = $xml->children()->children(); unset($resources->position_in_category); unset($resources->manufacturer_name); $resources->price = floatval($price); $resources->quantity = intval($qta); $resources->link_rewrite->language[0][0] = str_replace(' ','-',$name); $resources->name->language[0][0] = $name; $resources->description->language[0][0] = $desc; $node= dom_import_simplexml($resources->description->language[0][0]); $no = $node->ownerDocument; $node->appendChild($no->createCDATASection($desc)); $resources->associations = ''; //echo $xml->asXML(); try{ $opt = array('resource' => 'products'); $opt['postXml'] = $xml->asXML(); $xml = $webService->add($opt); } catch(PrestaShopWebserviceException $ex) { echo $ex->getMessage(); } return 0; } When I run this funcion it gives me error: I think there's a sort of problem with the "required=true" parameters, but i don't know what to do. Thanks.
×
×
  • Create New...