public function getItems() { $this->genMd5Hash(); $this->removeOldRecords(); $items = $this->getItemsFromDB(); if ($items !== false) { return $items; } $service = new Services\FindingService(array('appId' => $this->config['production']['appId'], 'apiVersion' => $this->config['findingApiVersion'], 'globalId' => Constants\GlobalIds::US)); $request = new Types\FindItemsAdvancedRequest(); $request->keywords = $this->replaseSimbols(strtolower($this->queryText)); if (!empty($this->queryCategory)) { $request->categoryId = $this->queryCategory; // array($this->queryCategory); } else { $request->categoryId = array('6030'); } $itemFilter = new Types\ItemFilter(); $itemFilter->name = 'ListingType'; $itemFilter->value[] = 'AuctionWithBIN'; $itemFilter->value[] = 'FixedPrice'; $request->itemFilter[] = $itemFilter; if (isset($this->queryMinPrice)) { $request->itemFilter[] = new Types\ItemFilter(array('name' => 'MinPrice', 'value' => array($this->queryMinPrice))); } if (isset($this->queryMaxPrice)) { $request->itemFilter[] = new Types\ItemFilter(array('name' => 'MaxPrice', 'value' => array($this->queryMaxPrice))); } switch ($this->querySort) { case 0: $request->sortOrder = 'PricePlusShippingHighest'; break; case 1: $request->sortOrder = 'PricePlusShippingLowest'; break; } $request->paginationInput = new Types\PaginationInput(); $request->paginationInput->entriesPerPage = 100; $request->paginationInput->pageNumber = $this->queryPage; $response = $service->findItemsAdvanced($request); if ($response->ack !== 'Failure') { $this->pageCount = (int) $response->paginationOutput->totalPages; $arrayresp = $response->toArray(); if (!$this->isFill($arrayresp)) { $this->emptyResponse = true; return false; } $this->addToBD($arrayresp); return $this->getItemsFromDB(); } else { return false; } }
*/ $config = (require __DIR__ . '/../configuration.php'); /** * The namespaces provided by the SDK. */ use DTS\eBaySDK\Constants; use DTS\eBaySDK\Finding\Services; use DTS\eBaySDK\Finding\Types; use DTS\eBaySDK\Finding\Enums; /** * Create the service object. * * For more information about creating a service object, see: * http://devbay.net/sdk/guides/getting-started/#service-object */ $service = new Services\FindingService(array('appId' => $config['production']['appId'], 'apiVersion' => $config['findingApiVersion'], 'globalId' => Constants\GlobalIds::US)); /** * Create the request object. * * For more information about creating a request object, see: * http://devbay.net/sdk/guides/getting-started/#request-object */ $request = new Types\FindItemsAdvancedRequest(); $request->keywords = 'Harry Potter'; /** * Search across two categories. * DVDs & Movies > DVDs & Blue-ray (617) * Books > Fiction & Literature (171228) */ $request->categoryId = array('617', '171228'); /**
<?php /** * Created by PhpStorm. * User: user * Date: 10/13/15 * Time: 12:27 PM */ //require 'vendor/autoload.php'; require __DIR__ . '/vendor/autoload.php'; use DTS\eBaySDK\Constants; use DTS\eBaySDK\Finding\Services; use DTS\eBaySDK\Finding\Types; // Create the service object. $service = new Services\FindingService(['appId' => 'KKK6bb807-2fab-408e-aea4-9b2a2a89b87', 'globalId' => Constants\GlobalIds::DE]); // Create the request object. //$request = new Types\FindItemsAdvancedRequest(); //$request = new Types\FindItemsByKeywordsRequest(); $request = new Types\FindItemsByCategoryRequest(); $request->categoryId = array('2613'); //$request->keywords = 'TV'; /*$request->itemFilter[] = new Types\ItemFilter(array( 'name' => 'MaxPrice', 'value' => array('10.00') ));*/ // Send the request to the service operation. //$response = $service->findItemsByKeywords($request); $response = $service->findItemsByCategory($request); // Output the result of calling the service operation. foreach ($response->searchResult->item as $item) { printf("(%s) %s: %s %.2f\n", $item->itemId, $item->location, $item->title, $item->sellingStatus->currentPrice->currencyId, $item->sellingStatus->currentPrice->value);
use \DTS\eBaySDK\Shopping\Services;*/ use DTS\eBaySDK\Shopping\Services as ShServices; use DTS\eBaySDK\Shopping\Types as ShTypes; //echo "<h1>الله اكبر</h1>"; $ShService = new ShServices\ShoppingService(array('apiVersion' => $config['shoppingApiVersion'], 'appId' => $config['production']['appId'])); $ShRequest = new ShTypes\GeteBayTimeRequestType(); $ShRequest = $ShService->geteBayTime($ShRequest); if ($ShRequest->Ack !== 'Success') { if (isset($ShRequest->Errors)) { foreach ($ShRequest->Errors as $error) { printf("Error: %s\n", $error->ShortMessage); } } } else { printf("The official eBay time is: %s\n", $ShRequest->Timestamp->format('H:i (\\G\\M\\T) \\o\\n l jS F Y')); } echo "</br>"; echo "--------------------------------------------------------------------------------"; // Create the service object. $service = new Services\FindingService(['appId' => 'KKK6bb807-2fab-408e-aea4-9b2a2a89b87', 'globalId' => Constants\GlobalIds::US]); // Create the request object. //$request = new Types\FindItemsAdvancedRequest(); $request = new Types\FindItemsByKeywordsRequest(); $request->keywords = 'TV'; $request->itemFilter[] = new Types\ItemFilter(array('name' => 'MaxPrice', 'value' => array('10.00'))); // Send the request to the service operation. $response = $service->findItemsByKeywords($request); // Output the result of calling the service operation. foreach ($response->searchResult->item as $item) { printf("(%s) %s: %s %.2f\n", $item->itemId, $item->title, $item->sellingStatus->currentPrice->currencyId, $item->sellingStatus->currentPrice->value); }
*/ $config = (require __DIR__ . '/../configuration.php'); /** * The namespaces provided by the SDK. */ use DTS\eBaySDK\Constants; use DTS\eBaySDK\Finding\Services; use DTS\eBaySDK\Finding\Types; use DTS\eBaySDK\Finding\Enums; /** * Create the service object. * * For more information about creating a service object, see: * http://devbay.net/sdk/guides/getting-started/#service-object */ $service = new Services\FindingService(array('appId' => $config['production']['appId'], 'apiVersion' => $config['findingApiVersion'], 'globalId' => Constants\GlobalIds::US)); /** * Create the request object. * * For more information about creating a request object, see: * http://devbay.net/sdk/guides/getting-started/#request-object */ $request = new Types\FindItemsByProductRequest(); /** * Assign the product ID that we want to search for. * This example will use a UPC as a product ID. * NOTE: eBay only allow a UPC value for products in the Music (e.g. CDs), DVD and Movie, and Video Game categories. * Using a UPC value for any other product will result in no items been returned. */ $productId = new Types\ProductId(); $productId->value = '085392246724';