$siteObject->title = 'new example site'; $reference = new \Productsup\Platform\Site\Reference(); $reference->setKey('MyTestReference'); $reference->setValue('TestId'); $siteObject->addReference($reference); $siteObject = $siteService->insert($siteObject); /** * To enable an export to a Google Content API, you can use the "exports service": */ $exportService = new \Productsup\Service\Exports($client); /** * adding a reference to the site you want to export: * for more information on how references in services work, @see /examples/Service/ProductData.php */ $Reference = new \Productsup\Platform\Site\Reference(); $Reference->setKey('MyTestReference'); $Reference->setValue('TestId'); $exportService->setReference($Reference); /** * enableContentApi enables the export to one of your merchant centers * * note: it is mandatory to authorize the "parent id" via OAuth at http://platform.productsup.com/ before you enable exports */ $exportService->enableContentApi('1234', '4321', 'de', 'de'); /** * From now on, you can upload products to this site: * * For more detailed explanation on the product service * @see /examples/Service/ProductData.php and @see /examples/migrateContentAPI/addingProducts.php */ $productsService = new \Productsup\Service\ProductData($client);
$Client->id = 1234; $Client->secret = 'simsalabim'; $ProductService = new Productsup\Service\ProductData($Client); /** * Optional, define chunk site to submit products in parts using multiple * post requests. Default is 5000 */ $ProductService->setPostLimit(1000); $Reference = new Productsup\Platform\Site\Reference(); /** * You have to specify the site the products belong to. * This is done by references to the site. * * In case you have a productsup site id, you can pass it like this: **/ $Reference->setKey($Reference::REFERENCE_SITE); $Reference->setValue(397); // Site ID /** * In case you want to use your own reference: **/ //$Reference->setKey('merchant_id'); // A site tag //$Reference->setValue(1234); // Value of the tag $ProductService->setReference($Reference); /** * you may specify which type of import you plan to send: * * a full import replaces all existing products (default, if not specified) * a delta import is used to update the latest full import * * note: one import/service has only one type