0

このチュートリアルから拡張機能の属性を作成しました -

http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/installing_custom_attributes_with_your_module

それは私がグーグルで見つけた最高のものです。

実際に、product のカスタム タイプも作成しました。タイプ名は「custom_product」、ラベルは「custom product」です。属性を追加した後、それがすべての製品タイプに適用されていることがわかりました。それを「カスタム製品」タイプに適用するにはどうすればよいですか? それで、それが新しい「カスタム製品」ページにのみ表示されたときは?

ありがとう。

4

1 に答える 1

0

これを使って:

$this->addAttribute('catalog_product', 'custom_product', array(
    'type'                       => 'int',
    'label'                      => 'Custom Product',
    'input'                      => 'select',
    'required'                   => false,
    'user_defined'               => true,
    'searchable'                 => true,
    'filterable'                 => true,
    'comparable'                 => true,
    'visible_in_advanced_search' => true,
    //this is the line that adds it to a type of product
    'apply_to'                   => Mage_Catalog_Model_Product_Type::TYPE_SIMPLE.','.Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE, 
    'group'                      => 'General',
));

Mage_Catalog_Model_Product_Type利用可能なすべてのタイプのクラスを確認し、あなたのものを選択してください。コンマで区切って、必要な数のタイプを追加できます。

于 2013-09-27T08:11:25.757 に答える