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

3

8

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

Silverweed answered 24/6, 2016 at 0:20 Comment(0)
Z
14

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) {

:)

Zen answered 6/8, 2016 at 7:32 Comment(0)
T
5

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

Tuberculous answered 23/12, 2016 at 16:54 Comment(0)
H
1
  1. Open file "MWSMerchantFulfillmentService/Model/ResponseHeaderMetadata.php"

  2. Replace :

    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)

  3. Replace :

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

    with :

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

Hanger answered 7/7, 2018 at 11:23 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.