GithubHelp home page GithubHelp logo

affilinet / productdata-php-sdk Goto Github PK

View Code? Open in Web Editor NEW
3.0 7.0 2.0 14.04 MB

Documentation and Code Package of PHP SDK for affilinet Product Data Webservices

Home Page: http://developer.affili.net/productdata-php-sdk/documentation/

License: MIT License

PHP 99.92% Shell 0.08%
php-sdk composer productdata affilinet publisher webservice webservices productfeed soap rest-api

productdata-php-sdk's Introduction

affilinet Product Data PHP SDK

Grab our Product Data PHP SDK and have access to millions of products within minutes.

Refer to our documentation in order to get started: https://affilinet.github.io/productdata-php-sdk

SensioLabsInsight

Installation

This SDK can be installed with composer

composer require affilinet/productdata-php-sdk

Please note: This packages requires PHP 5.6 or greater.

Examples

$config = [
    'publisher_id' => {PUBLISHER ID},
    'product_webservice_password' => {PRODUCT WEBSERVICE PASSWORD}
]

$affilinet = new \Affilinet\ProductData\AffilinetClient($config);

// simple search for t-shirts (using the product webservice)
try {
    $search = new \Affilinet\ProductData\Requests\ProductsRequest($affilinet);
    $query = new \Affilinet\ProductData\Requests\Helper\Query();
    
    $query->where($query->expr()->exactly('T-Shirt'));
    
    $search
        ->query( $query)
        ->onlyWithImage()
        ->minPrice(1)
        ->maxPrice(100)
        ->page(1)
        ->pageSize(20);
    
    $response = $search->send();
}
catch (\Affilinet\ProductData\Exceptions\AffilinetProductWebserviceException $e) {
    // There is an error within your $search
    echo 'Error: ' . $e->getMessage();
}

echo 'Total results : ' . $response->totalRecords() ;

foreach ($response->getProducts() as $product) {
    echo $product->getProductName();
    echo $product->getPriceInformation()->getDisplayPrice();
}

Tests

All tests rely on composer. Please composer install before running the tests. phpunit tests include some integration tests. To run these tests you need to provide an publisherId and productWebservicePassword. Copy Tests/AffilinetTestCredentials.php.dist to Tests/AffilinetTestCredentials.php and enter your PUBLISHER_ID and PRODUCT_WEBSERVICE_PASSWORD

To run only the unit tests use this command:

phpunit --exclude-group integration

License

Please see the license file for more information.

productdata-php-sdk's People

Contributors

aoderinde avatar avaffilinet avatar sgotre avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

productdata-php-sdk's Issues

Test 3

Test Email Notification

Planned Features

Hey there,

i just wanted to know if its planned to integrate the PublisherStatistics or Account endpoint?

Thanks,
Thomas

PageSize maximaler wert?

Ist die maximale PageSize 5000 oder 500? Entweder stimmt es in der doku oder im SDK nicht....

Original Image is not in include

The default action does not include the original image.

`public function addAllProductImages()
{
$this
->addProductImageWithSize30px()
->addProductImageWithSize60px()
->addProductImageWithSize90px()
->addProductImageWithSize120px()
->addProductImageWithSize180px();

    return $this;
}`

The method addProductImage is never called

Undefined index error on product and shop requests with no credentials.

Hey there
I'm getting an undefined index error if I call for example:

$shopsRequest = new ShopsRequest($affilinet);
$shopsRequest->send();

The same problem appears on every product request. The reason of this problem is that I call the API with invalid credentials (to test whether the credentials are right or wrong).

It's is very easy to fix ;)

screenshot 2017-09-01 13 12 06

License Link in Readme is broken

Hey there,

correct URL would be:

https://github.com/affilinet/productdata-php-sdk/blob/master/LICENSE

Thanks & Cheers,
Thomas

403 Status on Live server

`$objGuzzleClient = new \GuzzleHttp\Client(
[
'verify' => isEnvironment('development') ? false : true
]);

$objHttpClient = new \Affilinet\ProductData\HttpClient\GuzzleClient($objGuzzleClient);

$arrConfig =
[
	'publisher_id' => xxxxx,
	'product_webservice_password' => 'xxxxx',
	'http_client' => $objHttpClient
];

$objClient = new \Affilinet\ProductData\AffilinetClient($arrConfig);

$objProductSearch = (new \Affilinet\ProductData\Requests\ProductsRequest($objClient));

$objProductSearch->pageSize(500);
$objProductSearch->addFilterQuery('EAN', '04260415994004');

$objProductsResponse = $objProductSearch->send();`

This code works well on my local environment. But if i use it on my live server i always get a 403.

{"ErrorMessages":[{"Key":"20300007","Value":"PublisherId is not valid. The PublisherId has to be greater than 0."}]}

cURL - installed 7.38.0
openSSL - installed OpenSSL/1.0.1t
zlib - installed

Any ideas why it isnt working and how i can debug this?

Hey,

for my tests its hard-coded. But a string will not solve the problem.

I cant comment. WTF!?

Suche nach Produktnamen(Query auf productName)

Hallo zusammen,

ich formuliere direkt deutsch, da ich in den anderen Issues sehen konnte, dass das klappt :)

Ich habe mir gestern das SDK runtergeladen und es auch bereits erfolgreich eingebunden.

Ich nutze "productRequest" um Ergebnisse zu erhalten. Jetzt bin ich leider an der Stelle, an der ich nicht weiß, wie ich die Suche verfeinern kann. Ich habe folgendes dazu gefunden:

  1. $productRequest->addRawQuery("t-shirt"); //beispiel aus der doku
  2. $productRequest->query("Query hier"); //beispiel aus der doku
  3. $productRequest->addFilterQuery("Query hier");

Für mein Verständnis ist die 3. Variante das was ich suche.
Ich möchte gerne nur im "Produktnamen" suchen und "Produktbeschreibungen" aus der Suche ausschließen, leider konnte ich das über die 3. Variante nicht ermöglichen, da ich immer einen Fehler erhalte.
Fehler:
Error: The given SearchProductsRequest is not valid. - The given SearchProductsRequest is not valid. FilterQuery ‘productName’ is not supported (please check case and spelling

Ich habe mir natürlich das ResponseObject angeschaut um zu sehen, welche Keys mir zur Verfügung stehen -> "productName" kommt darin vor. Vermutlich verstehe ich es einfach noch nicht richtig, da ich auch erst seit ein paar Wochen an php dran bin.

Mein Code:

`
// get Search-Query from user-input
$filter = $_REQUEST['suche'];

// set filter_parameter for productsRequest
$productsRequest->onlyWithImage(); // only include results with images
$productsRequest->addProductImage(); // include the original image of the product
$productsRequest->addShopLogoWithSize90px(); // also include a shop logo with a specific width of 90px
$productsRequest->maxPrice(1000.01); // maximum price 100 euro and one cent
$productsRequest->minPrice(1);   // minimum price: one euro
$productsRequest->page(1); // show the second result page page (page parameter starts counting at 1)
$productsRequest->pageSize(7); // 20 results per page
$productsRequest->sort(\Affilinet\ProductData\Requests\ProductsRequest::SORT_BY_PRICE, true);
$productsRequest->addFilterQuery('productName',$filter);

`

Würde mich über Unterstützung freuen und sage einfach mal vielen Dank.

Test

Test issue.
@sgotre: Bitte Rückmeldung geben ob du eine Email bekommen hast.

Retrieve transactions

Hi,

How we can retrieve transactions from affilinet ? as we are an advertiser and we display shops, products on our website now when user purchase using our website we have an issue to retrieve transactions of those users, there is no help please guide.

We have account here: http://publisher.affili.net/Help/Help.aspx

Thanks

Test 2

Noch ein Test, dieses mal ohne mention.
Stefan, wäre super wenn du nochmal kurz Bescheid gibst falls du eine Email bekommst, danke :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.