Jump to content

PrestaShop Web Service (PSWebServiceLibrary)


Recommended Posts

Всем привет!

 

Преста 1.5.5.0 поднял на виртуалке для тестов, на рабочем сайте пока не экспериментировал.

Пытаюсь настроить импорт товаров посредством PSWebServiceLibrary.php но не получается...

Создал файл xxx.php:

<html>
 <head>
  <title>prod import</title>
 </head>
 <body>

<?php
// http://FCVW45NDHP5AGJZF3XACURP5F4JMJR81@localhost/prestasshop1550/api/

require_once( './PSWebServiceLibrary.php' );

// Here's how you create a webservice call:
$shop_url = 'http://192.168.20.200/prestashop1550/api/';
$secret_key = 'FCVW45NDHP5AGJZF3XACURP5F4JMJR81';
$debug = false;
//$webService = new PrestaShopWebservice($shop_url, $secret_key, $debug);

try {
   // creating webservice access
    $webService = new PrestaShopWebservice($shop_url, $secret_key, $debug);

   // call to retrieve all clients
    $xml = $webService->get(array('resource' => 'products?schema=synopsis'));
    echo $xml;
}
catch (PrestaShopWebserviceException $ex) {
   // Shows a message related to the error
   echo 'Other error: <br />' . $ex->getMessage();
}
?>
</body>
</html>

в браузере вижу:

 

Other error:
This call to PrestaShop Web Services failed and returned an HTTP status of 404. That means: Not Found.

Происходит это при выполнении

$xml = $webService->get(array('resource' => 'products?schema=synopsis'));

проверено.

 

Не пойму почему так, ведь пример вроде из учебника http://doc.prestashop.com/display/PS15/Chapter+3+-+First+steps+-+Access+the+Web+service+and+list+client

 

ЗЫ Может кто-то уже делал импорт с помощью этой библиотеки и поделится своими наработками?

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...