Magento Forum

Special Offers Section Using jCarousel - Product list not populating as intended
 
aikaterine
Member
 
Total Posts:  47
Joined:  2008-04-05
 

Hello all,

I am a bit stuck and am hoping that someone might be able to help. I am using jCarousel to display a category (id=39) on my homepage. I have created a eso.phtml which is called in my page template. Eso.phtml is pulled into the page as expected; however, the output is off. Again, my intention is merely to populate an unordered list with the image, prduct name and price for all products in Category 39. The code in eso.phtml is below:

<?php 
$cat_id 
39;
$cur_cat=Mage::getModel('catalog/category')->load($cat_id);
?>
<?php 
if (($_products $cur_cat->getProductCollection()) && $_products->getSize()): ?>
    
<ul id="mycarousel" class="jcarousel-skin-tango">
        
<?php $i=0; foreach ($_products->getItems() as $_product): ?>
            <?php 
if ($i>5): continue; endif; ?>
            
<li>
            <
a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>">
                <
img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135); ?>" width="135" height="135" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" />
            </
a><br />
<
a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>"><?php echo $this->htmlEscape($_product->getName())?></a><br />                
            
<?php echo $this->helper('catalog/product')->getPriceHtml($_producttrue?>
            
</li>
        
<?php $i++; endforeach; ?>
    
</ul>
<?php endif; ?>

I realize that the first two lines above are not the normal method; however it is the only one that does not (A) return products from all categories and/or (B) return a fatal error. It almost works. Unfortunately, the only output that returns correctly is the href attribute of the anchor tags.

To be more clear, for all returned products:

<a href="<?php echo $_product->getProductUrl() ?>" title="<?php echo $this->htmlEscape($_product->getName()) ?>">

returns the correct href for each product, but returns nothing in the title attribute. This happens both instances that the line appears.

<img src="<?php echo $this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135); ?>" width="135" height="135" alt="<?php echo $this->htmlEscape($_product->getName()) ?>" />

is returning a placeholder image (so the src attribute is not being returned correctly), the alt attribute is returning empty.

<?php echo $this->htmlEscape($_product->getName())?>

Also returns empty.

And finally,

<?php echo $this->helper('catalog/product')->getPriceHtml($_producttrue?>

Returns ‘£0.00’.

The confusing factor for me is that the href attributes are populating correctly. If they were not, then I might have more of a clue as to what is going on. I am just learning the system and imagine I am missing something basic; but I just cannot see it. I am using version 1.0.19700.

Any help would be greatly appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
aikaterine
Member
 
Total Posts:  47
Joined:  2008-04-05
 

bumping up, any help would be greatly appreciated.

 
Magento Community Magento Community
Magento Community
Magento Community
 
aikaterine
Member
 
Total Posts:  47
Joined:  2008-04-05
 

I have moved this to the CPM forum; if anyone is interested in the answer (assuming I find one) please let me know and I will duplicate it here. Of course, there is no guarantee that it will be figured out over there; so, if anyone reading this has an idea please post it on this forum. If we figure it out over here, I will post the solve in the CPM forum.

 
Magento Community Magento Community
Magento Community
Magento Community
 
aikaterine
Member
 
Total Posts:  47
Joined:  2008-04-05
 

Just to let everyone know I followed the tutorial at Scrolling Products Displayed by Category using jCarousel in order to work around this problem.

 
Magento Community Magento Community
Magento Community
Magento Community
 
bonhommie
Member
 
Total Posts:  60
Joined:  2008-06-02
 

Can you please post your site on here?
I am interested, but I will like to see it working first. I am currently using jcarousel with oscommerce.
how’s the load time?
Doesn’t it have to load all the images into the browser first?

thanks

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top