Note that there are some explanatory texts on larger screens.

plurals
  1. POAdding Previous & Next Button to category Products
    text
    copied!<p>I am displaying category products in the home page using the following block. {{block type="catalog/product_list" template="catalog/product/home_short.phtml" category_id="5" column_count="6"}}.Now i need to add prev and next button to the product list and my code is</p> <pre><code>&lt;?php $_productCollection=$this-&gt;getLoadedProductCollection() ?&gt; &lt;?php if(!$_productCollection-&gt;count()): ?&gt; &lt;p class="note-msg"&gt;&lt;?php echo $this-&gt;__('There are no products matching the selection.') ?&gt;&lt;/p&gt; &lt;?php else: ?&gt; &lt;div class="category-products"&gt; &lt;?php // Grid Mode ?&gt; &lt;?php $_collectionSize = $_productCollection-&gt;count() ?&gt; &lt;?php $_columnCount = $this-&gt;getColumnCount(); ?&gt; &lt;?php $i=0; foreach ($_productCollection as $_product): ?&gt; &lt;?php if ($i++%$_columnCount==0): ?&gt; &lt;ul class="products-grid"&gt; &lt;?php endif ?&gt; &lt;li class="item&lt;?php if(($i-1)%$_columnCount==0): ?&gt; first&lt;?php elseif($i%$_columnCount==0): ?&gt; last&lt;?php endif; ?&gt;"&gt; &lt;a href="&lt;?php echo $_product-&gt;getProductUrl() ?&gt;" title="&lt;?php echo $this-&gt;htmlEscape($this-&gt;getImageLabel($_product, 'small_image')) ?&gt;" class="product-image"&gt;&lt;img src="&lt;?php echo $this-&gt;helper('catalog/image')-&gt;init($_product, 'small_image')-&gt;resize(135,135); ?&gt;" width="135" height="135" alt="&lt;?php echo $this-&gt;htmlEscape($this-&gt;getImageLabel($_product, 'small_image')) ?&gt;" /&gt;&lt;/a&gt; &lt;h2 class="product-name"&gt;&lt;a href="&lt;?php echo $_product-&gt;getProductUrl() ?&gt;" title="&lt;?php echo $this-&gt;htmlEscape($_product-&gt;getName()) ?&gt;"&gt;&lt;?php echo $this-&gt;htmlEscape($_product-&gt;getName()) ?&gt;&lt;/a&gt;&lt;/h2&gt; &lt;?php echo $this-&gt;getPriceHtml($_product, true) ?&gt; &lt;div class="actions"&gt; &lt;?php if($_product-&gt;isSaleable()): ?&gt; &lt;button type="button" title="&lt;?php echo $this-&gt;__('Add to Cart') ?&gt;" class="button btn-cart" onclick="setLocation('&lt;?php echo $this-&gt;getAddToCartUrl($_product) ?&gt;')"&gt;&lt;span&gt;&lt;span&gt;&lt;?php echo $this-&gt;__('Add to Cart') ?&gt;&lt;/span&gt;&lt;/span&gt;&lt;/button&gt; &lt;?php else: ?&gt; &lt;p class="availability out-of-stock"&gt;&lt;span&gt;&lt;?php echo $this-&gt;__('Out of stock') ?&gt;&lt;/span&gt;&lt;/p&gt; &lt;?php endif; ?&gt; &lt;/div&gt; &lt;/li&gt; &lt;?php if ($i%$_columnCount==0 || $i==$_collectionSize): ?&gt; &lt;/ul&gt; &lt;?php endif ?&gt; &lt;?php endforeach ?&gt; &lt;script type="text/javascript"&gt;decorateGeneric($$('ul.products-grid'), ['odd','even','first','last'])&lt;/script&gt; &lt;/div&gt; &lt;?php endif; ?&gt; </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload