Beispiel #1
0
 /**
  * Insert Item into Google Content
  *
  * @param Mage_GoogleShopping_Model_Item $item
  * @return Mage_GoogleShopping_Model_Service_Item
  */
 public function insert($item)
 {
     $service = $this->getService();
     $entry = $service->newEntry();
     $item->getType()->convertProductToEntry($item->getProduct(), $entry);
     $entry = $service->insertItem($entry);
     $published = $this->convertContentDateToTimestamp($entry->getPublished()->getText());
     $item->setGcontentItemId($entry->getId())->setPublished($published);
     $expires = $this->_getAttributeValue($entry, 'expiration_date');
     if ($expires) {
         $expires = $this->convertContentDateToTimestamp($expires);
         $item->setExpires($expires);
     }
     return $this;
 }