function get_detail_by_skus($skus) { global $serviceUrl, $config, $service; $request = new MarketplaceWebServiceProducts_Model_GetMatchingProductForIdRequest(); $request->setSellerId(MWS_MERCHANG_ID); $request->withMarketplaceId(MWS_MARKETPLACE_ID); $request->withIdType('SellerSKU'); $asinList = new MarketplaceWebServiceProducts_Model_IdListType(); foreach ($skus as $sku) { $asinList->withId($sku); } $request->withIdList($asinList); // object or array of parameters return invokeGetMatchingProductForId($service, $request); }
* Responses are loaded from local XML files. You can tweak XML files to * experiment with various outputs during development * * XML files available under MarketplaceWebServiceProducts/Mock tree * ***********************************************************************/ // $service = new MarketplaceWebServiceProducts_Mock(); /************************************************************************ * Setup request parameters and uncomment invoke to try out * sample for Get Matching Product For Id Action ***********************************************************************/ // @TODO: set request. Action can be passed as MarketplaceWebServiceProducts_Model_GetMatchingProductForId $request = new MarketplaceWebServiceProducts_Model_GetMatchingProductForIdRequest(); $request->setSellerId(MERCHANT_ID); // object or array of parameters invokeGetMatchingProductForId($service, $request); /** * Get Get Matching Product For Id Action Sample * Gets competitive pricing and related information for a product identified by * the MarketplaceId and ASIN. * * @param MarketplaceWebServiceProducts_Interface $service instance of MarketplaceWebServiceProducts_Interface * @param mixed $request MarketplaceWebServiceProducts_Model_GetMatchingProductForId or array of parameters */ function invokeGetMatchingProductForId(MarketplaceWebServiceProducts_Interface $service, $request) { try { $response = $service->GetMatchingProductForId($request); echo "Service Response\n"; echo "=============================================================================\n"; $dom = new DOMDocument();