Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redefinition of parameter $quotaMax error when using MWS to get product information

Tags:

php

amazon-mws

I'm trying to get information from a product using Amazon MWS API and I'm get this annoying error:

Fatal error: Redefinition of parameter $quotaMax in....(path to file ResponseHeaderMetadata.php)

My MWS credentials are ok because I tried the exact same credentials on the MWS scratchpad and the response was correct. My code are using the MWS samples for the Products API. I'm using the GetMatchingProductSample.php, the most important part are:

$asin_list = new MarketplaceWebServiceProducts_Model_ASINListType();
$asin_list->setASIN(array("B01BH9EXX2"));

$request = new MarketplaceWebServiceProducts_Model_GetMatchingProductRequest();
$request->setMarketplaceId(MARKETPLACE_ID);
$request->setASINList($asin_list);

invokeGetMatchingProduct($service, $request);

When getting the dump of the request, all seems to be ok, again:

$parameters = $request->toQueryParameterArray();
var_dump($parameters);

array(2) { ["MarketplaceId"]=> string(13) "ATVPDKIKX0DER" ["ASINList.ASIN.1"]=> string(10) "B01BH9EXX2" }

The MWS API documentation is not very good.

Thanks

like image 569
Lincoln Avatar asked Jun 24 '16 00:06

Lincoln


2 Answers

Try following....

Open your MarketplaceWebServices->model->ResponseHeaderMetadata.php

Find and replace below code

public function __construct($requestId = null, $responseContext = null, $timestamp = null,$quotaMax = null, $quotaMax = null, $quotaResetsAt = null){

with

public function __construct($requestId = null, $responseContext = null, $timestamp = null,$quotaMax = null, $quotaRemaining = null, $quotaResetsAt = null) {

:)

like image 192
Jiten Avatar answered Sep 30 '22 00:09

Jiten


Apart from the above line change, the line:

$this->metadata[self::QUOTA_REMAINING] = $quotaMax;

should be changed to

$this->metadata[self::QUOTA_REMAINING] = $quotaRemaining;

Regards

like image 25
Sharat Hegde Avatar answered Sep 30 '22 00:09

Sharat Hegde