2010-04-03 78 views

回答

1

根據this Screencast你應該能夠設置屬性屬性映射。這不適合你嗎?

尋找更深層次的,我沒有一個谷歌帳戶的基礎,所以我不能對此進行測試,但是,當我搜索通過谷歌基本模塊,它看起來像這是它抓住了描述

app/code/core/Mage/GoogleBase/Model/Service/Item.php  
protected function _setUniversalData() 
{ 
    //... 
    if ($object->getDescription()) { 
     $content = $service->newContent()->setText($object->getDescription()); 
     $entry->setContent($content); 
    } 
    //... 
} 
這裏

我一般的做法是創建一個覆蓋有關Mage_GoogleBase_Model_Service_Item_setUniversalData方法,看起來像這樣

protected function _setUniversalData() 
{ 
    parent::_setUniversalData(); 

    //your code to parse through this object, find the long desription, 
    //and replace with the short. The following is pseudo code and just 
    //a guess at what would work 
    $service = $this->getService(); 
    $object = $this->getObject(); 
    $entry = $this->getEntry();  

    $new_text = $object->getShortDescription(); //not sure on getter method 
    $content = $service->newContent()->setText($new_text); 
    $entry->setContent($content); 

    return $this; 
} 

祝你好運!

+0

映射只能用於非默認屬性。描述似乎是硬編碼的地方,但我找不到在哪裏。 – a1anm 2010-04-04 14:45:02

+0

用更多信息更新答案。祝你好運! – 2010-04-04 19:40:04

1

想通了一切我所要做的就是改變:

if ($object->getDescription()) { 
    $content = $service->newContent()->setText($object->getDescription()); 
    $entry->setContent($content); 
} 

if ($object->getDescription()) { 
    $content = $service->newContent()->setText($object->getShortDescription()); 
    $entry->setContent($content); 
} 
在app /代碼/核心/法師/的GoogleBase /型號/服務

/Item.php

0

Magento的1.7.0.2谷歌購物1.7.0.0

app/code/core/Mage/GoogleShopping/Model/Attribute/Content.php 

變化$description = $this->getGroupAttributeDescription();

$description = $this->getGroupAttributeShortDescription();