0

彼ら。

一部のエンティティの eav 属性をプリロードするにはどうすればよいですか? お気に入り:

顧客の属性をプログラムでプリロードしたいですか? またはプログラムで私の製品カタログ?

4

1 に答える 1

2

「プリロード」とはどういう意味ですか? loadByCode を呼び出すだけで、任意の属性を簡単にロードできます。

$attribute = Mage::getModel('eav/entity_attribute')->loadByCode('catalog_product', '%attribute_code%')

または、コレクションを使用してすべての属性をロードできます。

$entityType          = Mage::getModel('eav/entity_type')->loadByCode('catalog_product');
$attributeCollection = Mage::getModel('eav/entity_attribute')->getCollection()->setEntityTypeFilter($entityType);

Magento には 8 つのエンティティ タイプがあります。

  1. お客様
  2. customer_address
  3. カタログ_カテゴリ
  4. catalog_product
  5. 注文
  6. 請求書
  7. クレジットメモ
  8. 出荷
于 2012-04-30T18:04:40.463 に答える