Please review my actions for the question.
I created one magento product category called Category, which applies to the entire product category.
To describe the product list, I created custom_list.phtml in the catalog folder, and I updated the layout file at the end of magento.
code for custom_list.phtml
<?php ?> <?php ?> <?php $_productCollection=$this->getLoadedProductCollection(); $_helper = $this->helper('catalog/output'); $startWith = $_REQUEST['startWith']; $byCountry = $_REQUEST['byCountry']; $currentCategory = $this->getCurrentCategory(); var_dump(get_class_methods(get_class($this))); ?> <div> <?php if(isset($startWith)): ?> <?php $_productCollection->clear() ->addAttributeToFilter('name', array( array('like' => $startWith.'%'))) ->load(); ?> <span><?php echo $this->__('WINES WITH THE LETTER ').'"'.$startWith.'"'; ?></span> <?php elseif(isset($byCountry)): ?> <?php $_productCollection->clear() ->addAttributeToFilter('country_of_manufacture', array( array('like' => $byCountry))) ->load(); $attribute_code = "country_of_manufacture"; $attribute_details = Mage::getSingleton("eav/config")->getAttribute("catalog_product", $attribute_code); $options = $attribute_details->getSource()->getAllOptions(false); $countryLabel=""; foreach($options as $option){ <span><?php echo $this->__('WINES FROM ').'“ '.$countryLabel.' ”'; ?></span> <?php endif; ?> <span><a href="<?php echo Mage::getModel('catalog/layer')->getCurrentCategory()->getUrl(); ?>"><?php echo $this->__('GO BACK TO MAP'); ?></a></span> </div> <?php if(!$_productCollection->count()): ?> <p class="note-msg"><?php echo $this->__('There are no products matching the selection.') ?></p> <?php else: ?> <div class="category-products"> <?php <?php <?php $_iterator = 0; ?> <ol class="products-list" id="products-list"> <?php foreach ($_productCollection as $_product): ?> <li class="item<?php if( ++$_iterator == sizeof($_productCollection) ): ?> last<?php endif; ?>"> <?php <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" class="product-image"> <img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(65,210); ?>" width="65" height="210" alt="<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /> <?php ?> <?php <img width="30" height="30" class="onsaleicon" /> <?php endif; endif; ?> <?php ?> </a> <?php <div class="product-shop"> <div class="f-fix"> <?php $_productNameStripped = $this->stripTags($_product->getName(), null, true); ?> <h2 class="product-name"><a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped; ?>"><?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a></h2> <?php if($_product->getRatingSummary()): ?> <?php echo $this->getReviewsSummaryHtml($_product) ?> <?php endif; ?> <div class="desc std"> <?php echo $_helper->productAttribute($_product, $_product->getShortDescription(), 'short_description') ?> <a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $_productNameStripped ?>" class="link-learn"><?php echo $this->__('Learn More') ?></a> </div> <div class="custProdList"> <?php echo $this->getPriceHtml($_product, true) ?> <?php if($_product->isSaleable()): ?> <p><button type="button" title="<?php echo $this->__('Add to Cart') ?>" class="button btn-cart" onclick="setLocation('<?php echo $this->getAddToCartUrl($_product) ?>')"><span><span><?php echo $this->__('Add to Cart') ?></span></span></button></p> <?php else: ?> <p class="availability out-of-stock"><span><?php echo $this->__('Out of stock') ?></span></p> <?php endif; ?> </div> </div> </div> </li> <?php endforeach; ?> </ol> <script type="text/javascript">decorateList('products-list', 'none-recursive')</script> <div class="toolbar-bottom"> <?php echo $this->getToolbarHtml() ?> </div> </div> <?php endif; ?>
fiter works fine, but pagination doesn't work. can any body please help me, how can I achieve it?
source share