Magento category description not displaying in list.phtml - magento

I am creating a custom template for category product view. I am using the catalog/product/list.phtml for this page. The issue is the category title and the description is not displaying.
Can anyone please help me to solve this issue.
Thank You.

Try this code.
<?php
$currentCategory = Mage::registry('current_category');
echo $currentCategory->getName();
echo $currentCategory->getDescription();
?>

Related

How to add approved reviews on Product page

I want to show in my product page the approved reviews for the product.
So I am editing this file:
mytemplate/default/catalog/product/view.phtml
I tried adding this to the view.phtml file but nothing is showing up:
<?php echo $this->getChildHtml('reviews') ?>
Can you suggest a way of adding approved reviews on product page? I'm using Magento 1.7.0.2.
first of all write this code in catalog.xml
<block type="review/product_view_list" name="product.info.product_additional_data" as="reviews" template="review/product/view/list.phtml"/>
then
write this code in your view.phtml
<?php echo $this->getChildHtml('reviews') ?>
it will solve your problem...
add this line in template/review/product/view/list.phtml file
this line add anywere u want
$this->htmlEscape($_review->getStatusId())=='1'){ echo ' Approved Review';

how to display total price on magento product page?

I want to display Total price on product page, like this http://www.4imprint.co.uk/tag/61/Ballpens/product/300090/Bic-Protusion-Grip-Pen . any one know how to do it.
should i use $_product->getFinalPrice();
The answer you want is <?php echo $_product->getFinalPrice();?>
This is even better:
<?php echo $this->helper('checkout')->formatPrice(Mage::getSingleton('checkout/cart')->getQuote()->getGrandTotal()); ?>

Magento - catalog layout

I have modified my magento catalog page using list.phtml by adding manufacturer name next to product name. Now this works well for all categories which have 'Anchor' set as No. It does not show the changes in categories where Anchor is set to yes. Could you please help me on this.
Thanks.
The layout for anchor and non-anchor categories is different look here:
<catalog_category_default>
and
<catalog_category_layered>
in catalog.xml
Perhaps your template only uses the non anchor list.phtml and falls back to base/default for the anchor categories?
In list.phtml I added the manufacturer
<?php echo $_helper->productAttribute($_product, $_product->getAttributeText('manufacturer'),'name') ?> - <?php echo $_helper->productAttribute($_product, $_product->getName() , 'name'); ?></a>

Magento extra add review button

I'm using Magento and what i want is the following:
Under the product reviews on the product page i want to add an extra "add review" button. What I did is add the following link on template\review\product\view\list.html
<a href="<?php echo $this->getReviewsUrl() ?>#review-form"><span><?php echo $this->__('Write review') ?>
The link shows up at the bottom of the product reviews so that goes well but when i click the button nothing happened.
Somebody knows how to fix it?
Thanks in advance!
Try this:
<?php echo $this->getReviewsSummaryHtml($_product, 'short') ?>

Magento - showing review links & add-to-compare links on custom pages

I have a custom page as my magento homepage. It's content is hardcoded on the default CMS page (which shows if a CMS homepage isn't enabled in the CMS pages section of the admin).
I have a list of products showing there (pulled from best-selling/highest rated etc). However, the review links and the add-to-compare links don't show on this page. The list of products is displayed using the same code as the default template/catalog/product/list.phtml, and everything else works except for these 2 things.
It seems that both the following code snippets have no effect on pages other than the default category listing page:
<?php $_compareUrl=$this->getAddToCompareUrl($_product); ?>
&
<?php echo $this->getReviewsUrl() ?>
I'm guessing that there's something else that needs to be called in order for these to work, but can't figure out what it is. Everything else from the product collection is available.
I load my product collection using the following code:
$_productCollection = Mage::getResourceModel('reports/product_collection')
->addAttributeToSelect('*')
->addAttributeToFilter('visibility', $visibility)
$_productCollection->load();
Any ideas?
OK, so after a while digging around, I found that you can use the following to get the compare url working:
<?php $_compareUrl=$this->helper('catalog/product_compare')->getAddUrl($_product) ?>
<span class="addto">
<?php echo $this->__('Add to Compare') ?>
</span>
Still not sure about the review urls, but I've made an acceptable workaround for that so I'm gonna mark this as answered.
If anyone comes up with an answer though please do still post it!
I'm guessing it's because the Block that is serving up your product list may not be correct. I believe it should be Mage_Catalog_Block_Catalog_Product_List. How exactly are you loading in the list of products?

Resources