1

私はmagento1.7を複数の店舗で運営しており、さまざまなブランド/メーカーのさまざまな店舗に表示する必要があります

現時点では、このコードを使用しています。

<?php
$product = Mage::getModel('catalog/product');
$attributes = Mage::getResourceModel('eav/entity_attribute_collection')
->setEntityTypeFilter($product->getResource()->getTypeId())
->addFieldToFilter('attribute_code', 'manufacturer');
$attribute = $attributes->getFirstItem()->setEntity($product->getResource());
$manufacturers = $attribute->getSource()->getAllOptions(false);
?>

<?php foreach ($manufacturers as $manufacturer): ?>
<a href="/manufacturer/<?php echo $manufacturer['label'] ?>"> <?php echo $manufacturer['label'] ?> </a>
<?php endforeach; ?>

フロントエンドにメーカーを表示しますが、すべてのサイトで同じブランドを表示しています。

異なるサイトで異なるブランドを表示するようにmagentoに指示するにはどうすればよいですか?

どうもありがとうございます!

4

2 に答える 2

0

属性「manufacturer」のスコープが「storeview」に設定されているか確認してください

于 2012-11-21T09:24:13.003 に答える
0

試す

$attribute->getSource()->setStoreId($yourStoreId);
$manufacturers = $attribute->getSource()->getAllOptions(false);
于 2012-11-20T16:46:19.533 に答える