私は magento を使用しており、製品を Google ベースに追加するための機能が組み込まれています。簡単な説明を Google ベースの説明として使用するように変更したいと考えています。詳細な説明とは対照的に。
4 に答える
このスクリーンキャストによると、属性属性のマッピングを設定できるはずです。それはあなたのために働いていませんか?
深く見てみると、私はグーグルベースアカウントを持っていないので、これをテストすることはできませんが、グーグルベースモジュールを検索すると、これが説明をつかんでいるように見えます
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;
}
幸運を!
私がしなければならなかったのは、変更することだけだとわかりました:
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 内
マジェント 1.7.0.2 グーグルショッピング 1.7.0.0
app/code/core/Mage/GoogleShopping/Model/Attribute/Content.php
変化する $description = $this->getGroupAttributeDescription();
の $description = $this->getGroupAttributeShortDescription();
最終的にモジュールが動作するようになり、すべてのエラーを修正することができました。
アカウントの構成、条件属性とマッピング属性の追加、およびここでの公開を含む、Magento Google Base フィードのセットアップ方法に関する短いステップバイステップのガイドをまとめましたhttp://blog.pod1.com/e-commerce/ magento-google-base-feed/