Magento – Magento 1.9.2 – Home page in grid format shows wrong number of columns, no add cart button

addtocartce-1.9.2.0checkoutmagento-1.9

I'm a newbie Magento developer and I'm facing a couple of issues with the product grid view in the home page and category page. All this is with Magento 1.9.2.0, running on xampp. It looks the same both in Chrome and Firefox.

I created 6 products, all added to the root category, then 2 subcategories one with 4 of the 6 products, and the second one has the other 2.

RWD theme

Using the default RWD theme, the problem is that the home page shows 2 products in a line, a single product the next line, then 2 again, then 1. (subimage 1)

When I go to the category with 4 items, it shows all 4 in a single line. (subimage 2)

If, following the suggestion of a page, I change in layout\catalog.xml both lines that look like this

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

to

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

the category page is modified, but the home page is exactly the same. (subimage 3)

It doesn't seems a problem exclusive to the RWD theme, in the default theme is even more noticeable the issue AND even the category looks broken there. It doesn't even matter if the column count is 3 or 4, the category looks like the home page in rwd. (subimages 4 and 5)

Default theme

In the CMS, my home page home page has '3 column' selected in the design, and the content of the home page is

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/product/list.phtml"}}

A secondary issue is that in the home page in the RWD theme, the 'Add to cart', 'add to wishlist', etc aren't visible, while they are in the category page, even as they come from the same block, as shown in the template hints that I activated. Also there are some unexpected bullet points, similar to the reported in this question, though I don't really understand the suggested solution and in any case, I'm using the default layout/template, except of course the content in the CMS.

It appears it isn't something exclusive to the 1.9.2 version

Apologies if something isn't easy to understand, since my native language isn't english.

Edit: so, after fiddling a bit with Firebug, I noticed that the actual buttons for the Cart, compare and such, are added to the page, they are just made invisible somehow.

In the category page they appear as

<div class="actions">
<button onclick="setLocation('http://10.10.1.103:7010/magento2/index.php/checkout/cart/add/uenc/aHR0cDovLzEwLjEwLjEuMTAzOjcwMTAvbWFnZW50bzIvaW5kZXgucGhwL2pveWFzbGlzdGEtMi5odG1s/product/3/form_key/p23G7eJhugsvwvyS/')" class="button btn-cart" title="Add to Cart2.1" type="button"><span><span>Add to Cart2.2</span></span></button>
<ul class="add-to-links">
<li><a class="link-wishlist" href="http://10.10.1.103:7010/magento2/index.php/wishlist/index/add/product/3/form_key/p23G7eJhugsvwvyS/">Add to Wishlist</a></li>
<li><span class="separator">|</span> <a class="link-compare" href="http://10.10.1.103:7010/magento2/index.php/catalog/product_compare/add/product/3/uenc/aHR0cDovLzEwLjEwLjEuMTAzOjcwMTAvbWFnZW50bzIvaW5kZXgucGhwL2pveWFzbGlzdGEtMi5odG1s/form_key/p23G7eJhugsvwvyS/">Add to Compare</a></li>
</ul>
</div>

while in the homepage is

<div class="actions" style="">
<button onclick="setLocation('http://10.10.1.103:7010/magento2/index.php/checkout/cart/add/uenc/aHR0cDovLzEwLjEwLjEuMTAzOjcwMTAvbWFnZW50bzIvaW5kZXgucGhwLz9tb2RlPWdyaWQ,/product/4/form_key/p23G7eJhugsvwvyS/')" class="button btn-cart" title="Add to Cart2.1" type="button"><span><span>Add to Cart2.2</span></span></button>
<ul class="add-to-links">
<li><a class="link-wishlist" href="http://10.10.1.103:7010/magento2/index.php/wishlist/index/add/product/4/form_key/p23G7eJhugsvwvyS/">Add to Wishlist</a></li>
<li><span class="separator">|</span> <a class="link-compare" href="http://10.10.1.103:7010/magento2/index.php/catalog/product_compare/add/product/4/uenc/aHR0cDovLzEwLjEwLjEuMTAzOjcwMTAvbWFnZW50bzIvaW5kZXgucGhwLz9tb2RlPWdyaWQ,/form_key/p23G7eJhugsvwvyS/">Add to Compare</a></li>
</ul>
</div>

With the only difference that the home page has an empty style attribute there.

Best Answer

I had a simliar issue. Changing this piece of code on the homepage. Somehow the homepage block with products does not listen to the catalog.xml

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" template="catalog/product/list.phtml"}}

into this. Solved my issue

{{block type="catalog/product_list" name="home.catalog.product.list" alias="products_homepage" column_count="3" template="catalog/product/list.phtml"}}

I also notice some bullets in the first screenshot. This might be a CSS related issue. Maybe you could paste some HTML to?

Related Topic