The products that are passed by the collection to the list view only contain the basic attributes, description and price are not included.
The easiest thing to is to instantiate the product model and pull the attributes you need with ->getData('attribute').
example:
$product_attr = Mage::getModel('catalog/product')->load($_product->getId());
then you will get your attributes by replacing:
<?php echo $_product->getDescription(); ?>
<?php echo $_product->getPrice(); ?>
with :
<?php echo $product_attr->getData('description'); ?>
<?php echo $product_attr->get('price'); ?>
Although, the recommended way to do it, is to add an observer to the 'catalog_block_product_list_collection' event and add those attributes to the collection
Did you check that the information exist on the DOM, if it is then you probably need to change the query, when you are using an ID (#) selector on jQuery it will only grab the first element that it finds that matches that query you can add specificity to the query by adding an scope the element that you want to show.
try changing the your selector to affect an element that falls within the scope of the element that is triggering the event
something simple like:
jQuery('.product-image')
.mouseover(function () {
jQuery('#hidden_image', $(this)).show();
})
.mouseout(function () {
jQuery('#hidden_image', $(this)).hide();
})
The problem here is, when you are loading your product page directly, Mage::registry('current_category')
will return NULL
and thus nothing will get executed in your code, since all of your code resides in that parent if loop checking.
You can use below code.
<?php
$_imgHtml = '';
$_imgUrl = false;
//check whether a valid category exist
if(Mage::registry('current_category')) {
//grabing category banner if any
$_category=Mage::registry('current_category');
$_helper = Mage::helper('catalog/output');
if ($_imgUrl = $_category->getImageUrl()) {
//prepare banner html
$_imgHtml = '<p class="category-image"><img src="'.$_imgUrl.'" alt="'.$this->escapeHtml($_category->getName()).'" title="'.$this->escapeHtml($_category->getName()).'" /></p>';
$_imgHtml = $_helper->categoryAttribute($_category, $_imgHtml, 'image');
}
}
//check a valid image url exist
if ($_imgUrl) {
echo $_imgHtml;
} else {
echo $this->getLayout()->createBlock('cms/block')
->setBlockId('cms_top_banner')
->toHtml();
}
?>
This will make sure, if a valid category does not exist, it will show your default banner in any case.
Best Answer
You can also manage with static block, create one static and put image or content there and this static block call on your theme product view file :
Open above file and past this code
above
this div so exectly you get your satic block content as you need.
Now, this solution is for every product show same content , but if you need for some product show this banner or content then you need to put product id condition so you show banner specific product.
hope it help of you.