Ejemplo n.º 1
0
 /**
  * Update Item data in Google Content
  *
  * @param BlueVisionTec_GoogleShoppingApi_Model_Item $item
  * @return BlueVisionTec_GoogleShoppingApi_Model_Service_Item
  */
 public function update($item)
 {
     $service = Mage::getModel('googleshoppingapi/googleShopping');
     $gItemId = $item->getGoogleShoppingItemId();
     // get product from google shopping
     //$product = $service->getProduct($gItemId,$item->getStoreId());
     $product = $item->getType()->convertAttributes($item->getProduct());
     $shoppingProduct = $service->updateProduct($product, $item->getStoreId());
     $expires = $shoppingProduct->getExpirationDate();
     if ($expires) {
         $expires = $this->convertContentDateToTimestamp($expires);
         $item->setExpires($expires);
     }
     return $this;
 }