Magento - 使用 Google 基本描述的简短描述

发布于 2024-08-27 06:01:01 字数 83 浏览 9 评论 0原文

我正在使用 magento,它内置了将产品添加到 google 库的功能。我想更改它,以便它使用简短描述作为 Google 库中的描述。与详细描述相反。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

ゞ花落谁相伴 2024-09-03 06:01:01

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

更深入地看,我没有谷歌基本帐户,所以我无法测试这个,但是,当我搜索谷歌基本模块时,看起来这就是它获取描述的地方

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

祝你好运!

According to this Screencast you should be able to setup attribute attribute mappings. Is that not working for you?

Looking deeper, I don't have a google base account, so I can't test this, BUT, when I search through the Google Base module it looks like this is where it's grabbing the description

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

My general approach here would be to create an override for the _setUniversalData method on the Mage_GoogleBase_Model_Service_Item class that looks something like this

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

Good luck!

飘落散花 2024-09-03 06:01:01

发现我所要做的就是更改:

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

Figured out all I had to do was change:

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

to

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

in app/code/core/Mage/GoogleBase/Model/Service/Item.php

心安伴我暖 2024-09-03 06:01:01

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

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

I eventually got the module to work and managed to fix all errors.

I put together short step-by-step guide on how to set up the Magento Google Base feed, including account configuration, adding the condition attribute & mapping attributes and publishing them here http://blog.pod1.com/e-commerce/magento-google-base-feed/

国产ˉ祖宗 2024-09-03 06:01:01

Magento 1.7.0.2 Google 购物 1.7.0.0

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

更改 $description = $this->getGroupAttributeDescription();

$description = $this->getGroupAttributeShortDescription();

Magento 1.7.0.2 Google Shopping 1.7.0.0

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

Change $description = $this->getGroupAttributeDescription();

In $description = $this->getGroupAttributeShortDescription();

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文