2012-11-20 61 views
1

我的Magento 1.7運行多店,我需要顯示爲不同的商店不同品牌/製造商Magento的MultiStore的不同廠家

此刻我用這個代碼:

<?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在不同的網站上顯示不同的品牌?

非常感謝你!

回答

0

嘗試

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

遺憾的是它不工作。我認爲問題的很大一部分是在後端,我的意思是沒有選擇,哪裏可以定義哪個製造商在哪裏展示......這很讓人傷心! –

0

檢查屬性「製造商」的範圍是否被設置爲「存儲視圖」或不