Skip to content

Instantly share code, notes, and snippets.

@ho-nl
Created September 9, 2010 14:23
Show Gist options
  • Save ho-nl/571928 to your computer and use it in GitHub Desktop.
Save ho-nl/571928 to your computer and use it in GitHub Desktop.
<block type="catalog/product_list_related" name="catalog.product.related" template="catalog/product/list/related.phtml">
<block type="catalog/product_list_toolbar" name="product_list_toolbar" template="catalog/product/list/toolbar.phtml">
<block type="page/html_pager" name="product_list_toolbar_pager"/>
<action method="addPagerLimit"><mode>list</mode><limit>20</limit></action>
</block>
<action method="setToolbarBlockName"><name>product_list_toolbar</name></action>
</block>
<div class="block block-related">
<div class="block-title">
<strong><span><?php echo $this->__('Related Products') ?></span></strong>
</div>
<div class="block-content">
<?php echo $this->getToolbarHtml() ?>
<p class="block-subtitle"><?php echo $this->__('Check items to add to the cart or') ?>&nbsp;<a href="#" onclick="selectAllRelated(this); return false;"><?php echo $this->__('select all') ?></a></p>
<ol class="mini-products-list" id="block-related">
<?php foreach ($_productCollection as $_product): ?>
<li class="item">
<?php if(!$_product->isComposite() && $_product->isSaleable()): ?>
<?php if (!$_product->getRequiredOptions()): ?>
<input type="checkbox" class="checkbox related-checkbox" id="related-checkbox<?php echo $_product->getId() ?>" name="related_products[]" value="<?php echo $_product->getId() ?>" />
<?php endif; ?>
<?php endif; ?>
<div class="product">
<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>" class="product-image"><img src="<?php echo $this->helper('catalog/image')->init($_product, 'thumbnail')->resize(50) ?>" width="50" height="50" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" /></a>
<div class="product-details">
<p class="product-name"><a href="<?php echo $_product->getProductUrl() ?>"><?php echo $this->htmlEscape($_product->getName()) ?></a></p>
<?php echo $this->getPriceHtml($_product, true, '-related') ?>
<?php if ($this->helper('wishlist')->isAllow()) : ?>
<a href="<?php echo $this->getAddToWishlistUrl($_product) ?>" class="link-wishlist"><?php echo $this->__('Add to Wishlist') ?></a>
<?php endif; ?>
</div>
</div>
</li>
<?php endforeach ?>
</ol>
<script type="text/javascript">decorateList('block-related', 'none-recursive')</script>
<?php echo $this->getToolbarHtml() ?>
</div>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment