简体   繁体   中英

Magento multistore different manufacturers

I've magento 1.7 running multi-stores and I need to display for the different stores different brands/manufacturers

at the moment I use this code:

<?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; ?>

to display the manufacturer in the front end, but it is showing the same brands in all the sites.

how could I tell magento to show different brands on the different sites?

thank you very much!

Try

$attribute->getSource()->setStoreId($yourStoreId);
$manufacturers = $attribute->getSource()->getAllOptions(false);

检查属性“ manufacturer”的范围是否设置为“商店视图”

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM