Jump to content

ElPepito

Members
  • Posts

    8
  • Joined

  • Last visited

1 Follower

Profile Information

  • First Name
    Daniel
  • Last Name
    Tru

Recent Profile Visitors

88 profile views

ElPepito's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. Hi mdekker I did what you said and it didnt work. The program doesn't give me any errors, but it doesn't add the image. Thanks for answering.
  2. When I try to add an image to a product I don't get any errors, but the image doesn't get added. This is my code: function addImage($idProduct) { $key = 'XXXXXXXXXXXXXXXXXXX'; $url = "http://192.168.1.81/api/images/products/".$idProduct; $image_path = 'image2.jpg'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_USERPWD, $key); curl_setopt($ch, CURLOPT_POSTFIELDS, array('image' => '@'.$image_path.';type=image/jpg')); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $result = curl_exec($ch); curl_close($ch); echo '<h2>Image Added</h2>'; } I also made a change on PSWebServiceLibrary.php, because Prestashop Web Service API keeps asking for authentication. This is the link where I got the code Prestashop Web Service API keeps asking for authentication . This is the code I added: $url .= '&ws_key=' . $this->key; The problem is that the code to add an image was working before I made that change on PSWebServiceLibrary.php, and I don't know how to solve it. I am using prestashop 1.6.1.5 Any help will be appreciated. Greetings!
  3. Thanks for answering edgarrodsil. The product is created just fine. I did a var_dump($xml_response) and what I get is NULL, so the error is there. But I dont understand what this line is supposed to mean ($xml_response = $xml_request['response']). Any help would be appreciated.
  4. it doesnt tell me in which line I have the error, but I think that it is on lines 151,152 or 153. Thanks for answering.
  5. Hi, when I use this code it gives me the following error: String could not be parsed as XML any ideas?
×
×
  • Create New...