Snippets with the tag: sidebar

Number of products in the sidebar

Description

Get the number of products shown in the sidebar.

Code

Mage::getStoreConfig('checkout/sidebar/count');

Shop by brand

Description

Shop by brand, for example in the sidebar.

Code

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

<ul id="manufacturer_list">
<?php foreach ($manufacturers as $manufacturer): ?>
<li>
<a href="http://www.yourdomain.com/catalogsearch/advanced/result/?manufacturer[]=<?php echo $manufacturer['value'] ?>">
<?php echo $manufacturer['label'] ?>
</a>
</li>
<?php endforeach; ?>
</ul>