Я использую API Google Content для обновления своих списков продуктов в Google Merchant Center. Однако, когда я просматриваю продукт на странице покупок Google, он показывает статус «контакт для онлайн -доступности» вместо «в складе онлайн».$credentialsFilePath = 'content-api-key.json';
$client = new Google_Client();
$client->setAuthConfig($credentialsFilePath);
$client->setScopes('https://www.googleapis.com/auth/content');
$client->fetchAccessTokenWithAssertion();
$token = $client->getAccessToken();
$client->setAccessToken($token['access_token']);
$service = new Google_Service_ShoppingContent($client);
$product = new Google_Service_ShoppingContent_Product();
$product->setOfferId('789');
$product->setTitle('Low Profile Flush Mount Hard');
$product->setDescription('Lorem IPsum');
$product->setLink('https://dummy.com');
$product->setImageLink('https://dummy.com/img.png');
$product->setContentLanguage('en');
$product->setTargetCountry('CA');
$product->setChannel('online');
$product->setAvailability('in stock');
$product->setCondition('new');
$product->setProductTypes('Hardware');
$product->setSellOnGoogleQuantity(5);
$product->setAvailabilityDate(date('c'));
$product->setGtin('QWERTY123');
$product->setBrand('Test');
$price = new Google_Service_ShoppingContent_Price();
$price->setValue('99.99');
$price->setCurrency('CAD');
$product->setPrice($price);
if ($pcp_on_sale) {
$salePrice = new Google_Service_ShoppingContent_Price();
$salePrice->setValue('99.99');
$salePrice->setCurrency('CAD');
$product->setSalePrice('79.99');
}
$shipping_price = new Google_Service_ShoppingContent_Price();
$shipping_price->setValue($shippingAmount);
$shipping_price->setCurrency('CAD');
$shipping = new Google_Service_ShoppingContent_ProductShipping();
$shipping->setPrice(0);
$shipping->setCountry('CA');
$shipping->setService('Standard shipping');
$product->setShipping(array($shipping));
$result = $service->products->insert('7894563251', $product);
Подробнее здесь: https://stackoverflow.com/questions/796 ... r-shopping
Проблема с статусом "in Stock Online" в Google Content API для покупок ⇐ Php
Кемеровские программисты php общаются здесь
1746510447
Anonymous
Я использую API Google Content для обновления своих списков продуктов в Google Merchant Center. Однако, когда я просматриваю продукт на странице покупок Google, он показывает статус «контакт для онлайн -доступности» вместо «в складе онлайн».$credentialsFilePath = 'content-api-key.json';
$client = new Google_Client();
$client->setAuthConfig($credentialsFilePath);
$client->setScopes('https://www.googleapis.com/auth/content');
$client->fetchAccessTokenWithAssertion();
$token = $client->getAccessToken();
$client->setAccessToken($token['access_token']);
$service = new Google_Service_ShoppingContent($client);
$product = new Google_Service_ShoppingContent_Product();
$product->setOfferId('789');
$product->setTitle('Low Profile Flush Mount Hard');
$product->setDescription('Lorem IPsum');
$product->setLink('https://dummy.com');
$product->setImageLink('https://dummy.com/img.png');
$product->setContentLanguage('en');
$product->setTargetCountry('CA');
$product->setChannel('online');
$product->setAvailability('in stock');
$product->setCondition('new');
$product->setProductTypes('Hardware');
$product->setSellOnGoogleQuantity(5);
$product->setAvailabilityDate(date('c'));
$product->setGtin('QWERTY123');
$product->setBrand('Test');
$price = new Google_Service_ShoppingContent_Price();
$price->setValue('99.99');
$price->setCurrency('CAD');
$product->setPrice($price);
if ($pcp_on_sale) {
$salePrice = new Google_Service_ShoppingContent_Price();
$salePrice->setValue('99.99');
$salePrice->setCurrency('CAD');
$product->setSalePrice('79.99');
}
$shipping_price = new Google_Service_ShoppingContent_Price();
$shipping_price->setValue($shippingAmount);
$shipping_price->setCurrency('CAD');
$shipping = new Google_Service_ShoppingContent_ProductShipping();
$shipping->setPrice(0);
$shipping->setCountry('CA');
$shipping->setService('Standard shipping');
$product->setShipping(array($shipping));
$result = $service->products->insert('7894563251', $product);
Подробнее здесь: [url]https://stackoverflow.com/questions/79601813/issue-with-in-stock-online-status-in-google-content-api-for-shopping[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия