メタ タイトルなしのフラット テーブル
-
28-09-2020 - |
質問
なぜ製品とカテゴリのフラットテーブルの両方にmeta_title属性が欠落しているのか知っている人はいますか?
フラットテーブルにはmeta_descriptionフィールドとmeta_keywordフィールドが表示されますが、meta_titleは表示されません。したがって、私は eav モデルを使用することになりますが、これは問題ありません。しかし、なぜそうなるのか疑問に思いました。また、フラットテーブルにmeta_titleを追加するためにこれを「修正」した人はいますか?
解決
adminの「meta_title」属性を開く、「製品一覧での使用」をyesに設定してから、再インデックスを実行してください。AFAIK、属性のみが「製品リストで使用する」と選択された属性のみがフラットテーブルに含まれています。
他のヒント
追加することでこれを行うことができます meta_title
の属性 frontend/product/collection/attributes
config.xml のノード
<frontend>
<product>
<collection>
<attributes>
<meta_title/>
</attributes>
</collection>
</product>
</frontend>
説明:
説明しましょう:
まずは授業の様子 Mage_Catalog_Model_Resource_Product_Flat_Indexer
.
そして関数名 getAttributeCodes()
での列の作成を担当します。 catalog product flat
.
Magento はまず属性を取得します。 global/catalog/product/flat/attribute_nodes
使用して
mage :: getConfig() - > getNode(self :: xml_node_attribute_nodes) - > children();
から config.xml
で app/code/core/Mage_Catalog/etc/
<flat>
<max_index_count>64</max_index_count>
<attribute_nodes>
<product_collection>frontend/product/collection/attributes</product_collection>
</attribute_nodes>
<add_filterable_attributes>0</add_filterable_attributes>
<add_child_data>0</add_child_data>
<flag>
<model>catalog/product_flat_flag</model>
</flag>
</flat>
内部的に呼び出すもの 構成ノード: frontend/product/collection/attributes
.
ここで属性を定義すると、この属性は自動的に列として追加されます。 flat table
.
<frontend>
<product>
<collection>
<attributes>
<attribute_Code/>
</attributes>
</collection>
</product>
</frontend>
次に、インデックス管理フォームのフラットインデックスを製品化する必要があります。