我可以通过Google Content API for Shopping使用PHP语言在Google Merchant Feed中更新(更改其他价格)产品的销售价格。
示例。折扣40%的产品(原价= 100.00欧元,促销价= 60.00欧元):
$product = new Google_Service_ShoppingContent_Product();
$product->setOfferId($myProductId);
$product->setContentLanguage($idData[1]);
$product->setTargetcountry($idData[2]);
$product->setChannel($idData[0]);
$price = new Google_Service_ShoppingContent_Price();
$price->setvalue(100.00);
$price->setCurrency('EUR');
$product->setPrice($price);
$salePrice = new Google_Service_ShoppingContent_Price();
$salePrice->setvalue(60.00);
$salePrice->setCurrency('EUR');
$product->setSalePrice($salePrice);
我无法删除此折扣,我希望我的产品最终价格再次100.00欧元。我尝试过:
$product->setSalePrice(NULL);
但是我遇到了致命错误:
参数1传递给 Google_Service_ShoppingContent_Product :: setSalePrice()必须为 Google_Service_ShoppingContent_Price的实例
我还尝试将值设置为0
$salePrice = new Google_Service_ShoppingContent_Price();
$salePrice->setvalue(0.00);
$salePrice->setCurrency('EUR');
但是Google拒绝了我的提议。
我该怎么做?
预先感谢