Example #1
0
 private function getSingleItemFromEbay($ebayitemid)
 {
     $this->queryText = $ebayitemid;
     $this->getItems();
     if (!ImageGallery::find()->where(['ebay_item_id' => $ebayitemid])->exists()) {
         $service = new ShopSer\ShoppingService(array('apiVersion' => $this->config['shoppingApiVersion'], 'appId' => $this->config['production']['appId']));
         $request = new ShopType\GetSingleItemRequestType();
         $request->ItemID = $ebayitemid;
         $request->IncludeSelector = 'Details';
         $response = $service->getSingleItem($request);
         if ($response->Ack !== 'Failure') {
             $res = $response->toArray();
             $this->addImagesToDB($res, $ebayitemid);
         }
     }
 }
Example #2
0
$request = new Types\GetSingleItemRequestType();
/**
 * Specify the item ID of the listing.
 */
$request->ItemID = '281832802693';
/**
 * Specify that additional fields need to be returned in the response.
 */
$request->IncludeSelector = 'ItemSpecifics,Variations,Compatibility,Details,BusinessSellerDetails';
/**
 * Send the request to the GetSingleItem service operation.
 *
 * For more information about calling a service operation, see:
 * http://devbay.net/sdk/guides/getting-started/#service-operation
 */
$response = $service->getSingleItem($request);
/**
 * Output the result of calling the service operation.
 *
 * For more information about working with the service response object, see:
 * http://devbay.net/sdk/guides/getting-started/#response-object
 */
if (isset($response->Errors)) {
    foreach ($response->Errors as $error) {
        printf("%s: %s\n%s\n\n", $error->SeverityCode === Enums\SeverityCodeType::C_ERROR ? 'Error' : 'Warning', $error->ShortMessage, $error->LongMessage);
    }
}
if ($response->Ack !== 'Failure') {
    var_dump($response);
    $item = $response->Item;
    print "{$item->Title}\n";