Take the 2-minute tour ×
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

I want to show 4 products in one row on my magento site. i tried some tricks but it don’t work..

i set this in list.phtml

<?php $_columnCount = 4; ?>

but nothing..

I also put this in catalog.xml

<action method="setColumnCount"><count>4</count></action>

here is my list.phtml and my catalog.xml

This is my screenshot

share|improve this question
1  
shahkeyul.wordpress.com/2013/07/14/… you can go All details as @Sander told –  Keyul Shah Feb 19 at 11:55
add comment

2 Answers

up vote 3 down vote accepted

You can set the column count through the layout XML. I'm guessing your homepage is a CMS page so the block was probably added in the Design tab under Layout Update XML.

The XML syntax should look something like this for adding the list and setting the column count.

[...]
<block type="catalog/product_list" name="product_list" template="catalog/product/list.phtml">
    <action method="setColumnCount"><count>4</count></action>
</block>
[...]
share|improve this answer
    
Yes, i add this to my cms page to show products from one category . '{{block type="catalog/product_list" category_id="14" template="catalog/product/list.phtml" column_count="4""}}' Where i need to put that blocks... This is my Layout Update XML pastebin.com/mv22uugD –  Zzuum Feb 19 at 11:39
    
ah ok, you've added it through the content editor in that case. If you print $this->getColumnCount(); in the list.phtml what do you get on the homepage? –  Sander Mangel Feb 19 at 11:41
    
I put this in list.phtml but nothing happend.. line 92.. <?php $_columnCount = 4; ?> –  Zzuum Feb 19 at 11:58
add comment

You have everything doubled in this template, as it is used for two cases. you have set it for the wrong, there should be a second where you could set it and it has effect.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.