PHP code example of findologic / findologic-api
1. Go to this page and download the library: Download findologic/findologic-api library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
findologic / findologic-api example snippets
// Require composer autoload
use FINDOLOGIC\Api\Client;
use FINDOLOGIC\Api\Requests\Request;
use FINDOLOGIC\Api\Requests\SearchNavigation\SearchRequest;
use FINDOLOGIC\Api\Responses\Json10\Json10Response;
// Set your ServiceId/Shopkey, which can be found in the customer account.
$config = new Config('ABCDABCDABCDABCDABCDABCDABCDABCD');
$client = new Client($config);
/** @var SearchRequest $request */
$request = Request::getInstance(Request::TYPE_SEARCH);
$request->setQuery('shirt') // Users search query.
->setShopUrl('blubbergurken.de') // Url of the shop.
->setUserIp('127.0.0.1') // Users IP.
->setReferer($_SERVER['HTTP_REFERER']) // Page where search was fired.
->setRevision('1.0.0') // Version of your API wrapper.
->setOutputAdapter('JSON_1.0'); // Optional setting of output format.
/** @var Json10Response $response */
$response = $client->send($request);
var_dump($response->getResult()->getItems()); // Get all products/items.
var_dump($response->getResult()->getMainFilters()); // Get all main filters easily.
var_dump($response->getResult()->getOtherFilters()); // Get all other filters easily.
var_dump($response); // Entire response, full of helper methods.