承接 findologic/findologic-api 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

findologic/findologic-api

最新稳定版本:v2.0.0

Composer 安装命令:

composer require findologic/findologic-api

包简介

Library for FINDOLOGIC API requests

README 文档

README

Tests codecov Packagist

Synopsis

FINDOLOGIC-API is an object oriented wrapper for the Findologic API, with over 300 automated unit-tests and 100% code coverage.

This library not only helps requesting the Findologic API, but also getting data from the response and mapping them to corresponding objects. You won't have to mess around with sending requests and getting the data from the Findologic's response anymore.

You want to get filters? Just call Response::getMainFilters(). It really is that simple, just try out the Basic Usage or see some Examples.

To have a better understanding about the API, please make sure to read the general Findologic API documentation. We already got you covered with quicklinks to it:

Limitations

Currently, we support the following response formats:

Response Type Format Version Supported End of life
Search/Navigation JSON 1.0 ✔️ Not in the foreseeable future
XML 2.1 ✔️ Not in the foreseeable future
XML 2.0 ✖️ → Use XML_2.1 instead 2019-10-18
HTML any ✔️ → The response is not parsed Not in the foreseeable future
Smart Suggest JSON 3.0 ✔️ Not in the foreseeable future
Item Update JSON latest ✔️ Not in the foreseeable future

Requirements

Installation

For a simple installation you can use Composer. Using this command will install the latest version.

composer require findologic/findologic-api

Basic usage

The usage is pretty simple. Here is an example:

// Require composer autoload
require_once __DIR__ . '/vendor/autoload.php';

use FINDOLOGIC\Api\Config;
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.

Examples

  • Working examples can be found in the /examples directory.
  • The documentation can be found in our Project Wiki.

Projects using this library

Bug Report

We need your help! If you find any bug, please submit an issue and use our template! Be as precise as possible so we can reproduce your case easier. For further information, please refer to our issue template at .github/ISSUE_TEMPLATE/bug_report.md.

Contributing

Please check our contribution guide on how to contribute.

统计信息

  • 总下载量: 102.28k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 1
  • 依赖项目数: 1
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 4
  • Forks: 3
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2019-07-05