1

Here are my questions 1.) How to display products of specific category? 2.) How can I organize the way it is displayed? (column, size, row, etc) ?

Hi. I have tried almost all the tutorials in google but I failed to display products in my Home Page. Although displaying "all products" is not working, the displaying of new items works fine. This is what I did so far.

This is the line of code which works:

{{block type="catalog/product_new" name="home.catalog.product.list" template="catalog/product/new.phtml"}}

Though the code above works, the way it displays the product is not right.

This line of code doesn't work:

{{block type="catalog/product_list" category_id="3" template="catalog/product/list.phtml"}}

Yes, I have tried clearing the cache as well. Also, I am using Magento 1.9.2.3.

UPDATE: After following the instruction, something was displayed: enter image description here

Although something was displayed on my homepage, this is not how I expect the products to be displayed. Why does it display like this ?

  • All your products are inside the category ID equal 3? – Denis Spalenza Jan 26 '16 at 15:37
  • can please try this echo $this->getLayout()->createBlock("catalog/product_list")->setTemplate("catalog/product/list.phtml")->setCategoryId('category_id')->toHtml(); – Magento 2 Jan 26 '16 at 15:53
  • I'm sorry. But where do I paste that? I am new to Magento. – MagentoUser Jan 26 '16 at 15:59
2

As you have using magento c.E 1.9 version and this version already applied magento patch SUPEE-6788.

So,you need to remove catalog/product_list from white list

  1. System > Permissions > Blocks
  2. Add New Block
  3. Block Name: catalog/product_list
  4. Is Allowed : Yes
  • Hi. Thanks. Something was displayed on my home page. But there is still a problem. Please see my update. Thank you. – MagentoUser Jan 26 '16 at 16:06
  • may be there are some code which is creating the issue after sort by – Amit Bera Jan 26 '16 at 16:17
  • just remove the toolbar code from list.phtml and check – Amit Bera Jan 26 '16 at 16:19
  • Woah, okay I found the file and removed the toolbar. But will removing that toolbar not affect other modules? Will it really be okay to remove that? – MagentoUser Jan 26 '16 at 16:28
  • 1
    Change the template you use to your own template. Don't use catalog/product/list.phtml and restore the toolbar code back in the list.phtml template. Your display will then be specific to your template, and not affect anything else. – ProxiBlue Jan 26 '16 at 16:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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