0

I want to display category wise products on my homepage, for that i am using catalog/list via custom static blocks. Below is my code which i am pasting in my static block content.

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

The problem is when i am pasting the same code in my another static block to display products from different category it is not working.

Please assist me what i am doing wrong.

  • Try with cms block – Magento 2 Feb 4 '16 at 10:53
  • I have googled it and some guys said there is a problem with name, i need to change the name of name="home.catalog.product.list" i did that but still its not working. It is a CMS block only i am talking about CMS > Static Blocks.? Or do i need to create from CMS > Pages – Soeb Safi Feb 4 '16 at 10:57
  • yes cms pages try it – Magento 2 Feb 4 '16 at 10:59
  • if you are using the 1.9.2 or apply patches the add your block in permission. system > permission > block – Qaisar Satti Feb 4 '16 at 11:08
2

From ,Magento Community v1.9.2.x,you need to remove a block of a static block from white list.

Try to navigate to `System > Configuration > Permissions > Blocks > Add New Block

Block Name: catalog/product_list

Is Allowed: Yes

Make sure to clear cache and it should work.

  • Thanx for prompt reply, i have already added that block in permissions that why i am able see it on my homepage at the first place. My problem is with another category with different category id. When i display the same block with different category id i doesn't work. – Soeb Safi Feb 4 '16 at 11:40
  • can you try using this? {{block type="catalog/product_list" name="catalog.product.list.custom.block" alias="products_custom_block" category_id="10" template="catalog/product/list.phtml"}} change category_id a per your requirement inside a static block. Make sure your static block is called out in that specific page. – Shivani Feb 4 '16 at 12:06
  • I tried that but it didn't worked! Is there any other way around. – Soeb Safi Feb 4 '16 at 13:53
  • I got it resolved :-) actually i am using flexslider along with it, so because i didn't created separate flexslider id for another category that's why its was not displaying, but actually products were coming :-) I am posting it as an answer may be someone else come stuck at the same point :-) – Soeb Safi Feb 4 '16 at 14:46
  • Anyway thanx @Shivani – Soeb Safi Feb 4 '16 at 14:48
0

I have resolved it, actually i am using flexslider along with this block.

Everything was in place i have created the block, got it displayed on custom homepage and then changed the category id but because i didn't created another id in flexslider for my another category it was not being displayed on the homepage but actually block was working products were coming from db. Its because of the slider id it was not working.

Hope this helps someone :-)

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.