2010-04-03 60 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();