1

I want to display the products according to the categories and make them list of all the products related to that category.

So far I have tried using this code:

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

And in this category there are 10 products.

But the output gives me There are no products matching the selection.

Can anyone please help me to achieve this. Thank you.

5
  • please tell us in more detail what you want what you have tried so far Dec 14, 2016 at 5:07
  • @MurtuzaZabuawala I have edited the question once have a check.
    – Ritu
    Dec 14, 2016 at 5:12
  • 1
    You may need to whitelist the catalog/product_list block. Dec 14, 2016 at 5:18
  • @Ritu check my answer Dec 14, 2016 at 5:19
  • @MurtuzaZabuawala I have done according to your answer but no luck. Still it shows the same thing.
    – Ritu
    Dec 14, 2016 at 5:50

2 Answers 2

0

CE 1.9.2.2 includes all the changes from the recent-patch SUPEE-6788, one of which was restrict the blocks that can be used in CMS blocks, pages, emails (etc...) by default.

Fortunately you can whitelist additional blocks through the admin under System > Permissions > (Blocks | Variables)

  • System > Permissions > Blocks
  • Add New Block
  • Block Name: catalog/product_list
  • Is Allowed : Yes

Don't forget to add cms/block if it's not already there.

Don't forget to clear the cache too

enter image description here

3
  • Bilal I didn't get this point "Don't forget to add cms/block if it's not already there."
    – Ritu
    Dec 14, 2016 at 5:58
  • i have added a screen shot to ma answer please take a look
    – NID
    Dec 14, 2016 at 6:16
  • if this doesn't work try reindexing
    – NID
    Dec 14, 2016 at 6:17
0

I got your point

1) login to admin panel

2) go to System->permission->Blocks

3) click add new Block button

4) add this block catalog/product_list and set enable in dropdown and save

5) clear magento cache and check again

3
  • I have done according to your answer but no luck. Still it shows the same thing.
    – Ritu
    Dec 14, 2016 at 5:53
  • @ritu Do reindexing from System->index managment Dec 14, 2016 at 6:05
  • @Ritu If Its done because of my answer then feel free to mark as accepted Dec 14, 2016 at 6:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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