Category Info
File Location
* webalive\template\catalog\category\view.phtml * webalive\template\catalog\product\list.phtml * webalive\template\catalog\product\list\toolbar.phtml * webalive\template\page\html\pager.phtml |
First Create Class Instance
$_helper = $this ->helper( 'catalog/output' ); $_category = $this ->getCurrentCategory(); |
Category Name
<?php echo $_helper ->categoryAttribute( $_category , $_category ->getName(), 'name' ) ?> |
Category Description
<?php if ( $_description = $this ->getCurrentCategory()->getDescription()): ?> <?php echo $_helper ->categoryAttribute( $_category , $_description , 'description' ) ?> <?php endif ; ?> |
Category URL
$_imgUrl = $_category ->getImageUrl(); |
Category Image
$_imgHtml = '' ; if ( $_imgUrl = $_category ->getImageUrl()) { $_imgHtml = '<p class="category-image"><img src="' . $_imgUrl . '" alt="' . $this ->htmlEscape( $_category ->getName()). '" title="' . $this ->htmlEscape( $_category ->getName()). '" /></p>' ; $_imgHtml = $_helper ->categoryAttribute( $_category , $_imgHtml , 'image' ); } |
Product Info
First Create Class Instance
$_productCollection = $this ->getLoadedProductCollection(); $_helper = $this ->helper( 'catalog/output' ); foreach ( $_productCollection as $_product ){ } |
Product Name
<a href= "<?php echo $_product->getProductUrl() ?>" title= "<?php echo $this->stripTags($_product->getName(), null, true) ?>" > <?php echo $_helper ->productAttribute( $_product , $_product ->getName(), 'name' ) ?> </a> |
Product Image
<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(135); ?>" width= "135" height= "135" alt= "<?php echo $this->stripTags($this->getImageLabel($_product, 'small_image'), null, true) ?>" /> </a> |
Product Details Link
<?php echo $_product ->getProductUrl() ?> |
Product Price
<?php echo $this ->getPriceHtml( $_product , true) ?> |
Product Rating and review
<?php if ( $_product ->getRatingSummary()): ?> <?php echo $this ->getReviewsSummaryHtml( $_product , 'short' ) ?> <?php endif ; ?> |
Product Sort Description
<?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> //Truncate <?php echo $_helper ->productAttribute( $_product , $_product ->getShortDescription(), 'short_description' ) ?> <?php echo Mage::helper( 'core/string' )->truncate( $_helper ->productAttribute( $_product , $_product ->getShortDescription(), 'short_description' ), 60, '' , $remainder , false); ?></a> |
Product Add to Cart Btn
<?php if ( $_product ->isSaleable()): ?> <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> <?php else : ?> <p class = "availability out-of-stock" ><span><?php echo $this ->__( 'Out of stock' ) ?></span></p> <?php endif ; ?> |
Add to Wishlist
<?php if ( $this ->helper( 'wishlist' )->isAllow()) : ?> <a href= "<?php echo $this->helper('wishlist')->getAddUrl($_product) ?>" class = "link-wishlist" ><?php echo $this ->__( 'Add to Wishlist' ) ?></a> <?php endif ; ?> |
Add to Compare
<?php if ( $_compareUrl = $this ->getAddToCompareUrl( $_product )): ?> <li><span class = "separator" >|</span> <a href= "<?php echo $_compareUrl ?>" class = "link-compare" ><?php echo $this ->__( 'Add to Compare' ) ?></a></li> <?php endif ; ?> |