Step 1 - Code
Log into the server (eg. through FTP) and go to the [your_prestashop_folder]/override/classes/webservice
folder.
Create a file WebserviceRequest.php
with the following content:
<?php
class ProductCarrier extends ObjectModelCore
{
public $id_product;
public $id_carrier_reference;
public $id_shop;
public static $definition = array(
'table' => 'product_carrier',
'primary' => 'id_product',
'fields' => array(
'id_product' => array('type' => self::TYPE_INT, 'required' => true),
'id_carrier_reference' => array('type' => self::TYPE_INT, 'required' => true),
'id_shop' => array('type' => self::TYPE_INT, 'required' => true),
),
);
protected $webserviceParameters = array();
}
class WebserviceRequest extends WebserviceRequestCore
{
public static function getResources()
{
$resources=parent::getResources();
$resources['product_carrier'] = array('description' => 'Attach carriers to a product', 'class' => 'ProductCarrier');
ksort($resources);
return $resources;
}
}
Step 2 - Cache
Log into the Prestashop's backoffice panel and clear the cache.
It can be done by navigating to the "Advanced Paremeters > Performance" and clicking the button "Clear cache" at the top right.
Step 3 - Permissions
In the backoffice panel, go to the "Advanced Parameters > Webservice" and click on the Xintegrator API key. And then select the checkboxes in the product_carrier
row.
Sources: