1

I am using magento and it's built in functionality for adding products to google base. I would like to change it so that it uses the Short description as the Description in Google base. As opposed to the detailed description.

4

4 回答 4

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/code/core/Mage/GoogleBase/Model/Service/Item.php

于 2010-04-05T11:56:07.087 回答
1

根据此截屏视频,您应该能够设置属性属性映射。那不适合你吗?

更深入地看,我没有 google 基本帐户,所以我无法测试这个,但是,当我搜索 Google Base 模块时,它看起来像是在获取描述

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

我在这里的一般方法是为类_setUniversalData上的方法创建一个覆盖Mage_GoogleBase_Model_Service_Item,看起来像这样

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;
}

祝你好运!

于 2010-04-03T21:19:47.810 回答
0

我最终让模块工作并设法修复了所有错误。

我整理了有关如何设置 Magento Google Base 提要的简短分步指南,包括帐户配置、添加条件属性和映射属性并在此处发布它们http://blog.pod1.com/e-commerce/ magento-google-base-feed/

于 2010-09-28T13:05:42.333 回答
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();

于 2013-06-30T14:07:53.503 回答