Luc
Total Posts: 15
Joined: 2007-08-31
Hello,
I was developping some code to be able to display products from different categories on home page.
I’ve have the following problem : only the first category is list even if correct category id is set.
So I check my code, but I was unable to find the problem. Then I tried ‘core code’ with the following blocks on home page :
{{block type = "catalog/product_list" category_id = "5" template = "catalog/product/list.phtml" }} {{block type = "catalog/product_list" category_id = "6" template = "catalog/product/list.phtml" }}
The first block shows correct products of the category (id=5) but the second block show the products of the previous category (id=5) and not the products of the awaiting category (id=6).
I mention that no cache is used on our development plateform.
Any idea ?
Luc
Luc
Total Posts: 15
Joined: 2007-08-31
Hello,
Could someone try this code in the homepage CMS and confirm there is only one category listed instead of the four awaiting ?
{{block type = "catalog/product_list" category_id = "1" num_products = "5" template = "catalog/product/list.phtml" }} {{block type = "catalog/product_list" category_id = "2" num_products = "5" template = "catalog/product/list.phtml" }} {{block type = "catalog/product_list" category_id = "5" num_products = "5" template = "catalog/product/list.phtml" }} {{block type = "catalog/product_list" category_id = "6" num_products = "5" template = "catalog/product/list.phtml" }}
You have to configure the cotegory_id according to you catalog.
I would like to understand why the four blocks display the products of the first categroy_id.
Luc
Posted: May 8 2008
| top
| # 1
timothyleetaylor
Total Posts: 160
Joined: 2008-02-05
New Zealand
Hey Luc,
That’s correct - I realized the same categories are showing over and over again.
Haven’t tested enough to see what works - but I confirm that what you’re finding is true.
An alternative would be this (until this “issue” gets addressed and fixed):
Create a new category, and add whatever products you want to that category (simply by going into the product’s settings and adding it to the category). Then, display the one, new category via:
{{block type = "catalog/product_list" category_id = "9" template = "catalog/product/list.phtml" }}
(but change the “category_id” appropriately)
Thanks,
- Lee
Signature
Elias Interactive
Web Design & Development
http://www.eliasinteractive.com
Skype: leetaylor.elias
Posted: May 8 2008
| top
| # 2
Ron Phillips
Total Posts: 49
Joined: 2008-04-16
Creating an alternate category doesn’t seem like a useful solution especially if the design calls for categories to be separate on the homepage.
Signature
Ron Phillips
Posted: May 8 2008
| top
| # 3
double02
Total Posts: 28
Joined: 2007-12-08
Los Angeles, CA
I am having the same problem.
I am thinking using xml update instead would work.
Has anybody added more than one category to their frontpage using xml update?
Posted: May 14 2008
| top
| # 4
Luc
Total Posts: 15
Joined: 2007-08-31
Hi,
XML update won’t change the ‘strange’ beaviour.
I’ve asked magento but, for the moment, no answer.
I’ve tried to developp my own block but, same result, the following code returns a collection of products of the first categoryId used.
$layer = Mage :: getSingleton ( 'catalog/layer' ); $category = Mage :: getModel ( 'catalog/category' )-> load ( $this -> getCategoryId ()); $layer -> setCurrentCategory ( $category ); $productCollection = $layer -> getProductCollection ();
Any Idea ?
Luc
Posted: May 15 2008
| top
| # 5
double02
Total Posts: 28
Joined: 2007-12-08
Los Angeles, CA
Luc - 15 May 2008 01:54 AM
XML update won’t change the ‘strange’ beaviour.
What code did you use for XML update?
Posted: May 15 2008
| top
| # 6
Moshe
Total Posts: 1771
Joined: 2007-08-07
Los Angeles
Hi, Luc, we’re currently making catalog blocks more flexible so multiple blocks could be shown on same page.
This update will be available in next release.
If it will be possible easily to update existing version, we will post a patch.
Signature
- I would love to change the world, but they won’t give me the source code -
Posted: May 15 2008
| top
| # 7
Luc
Total Posts: 15
Joined: 2007-08-31
Hi Moshe,
Thanks for your reply. I hope a patch will be available before the next release.
Luc
Posted: May 16 2008
| top
| # 8
sdb
Total Posts: 223
Joined: 2007-11-13
coastal California, USA
that sounds like a pretty cool / useful feature, i’m glad its being worked on
Signature
my preferred host: http://www.schostpro.com
Posted: May 16 2008
| top
| # 9
a0z0ra
Total Posts: 6
Joined: 2008-05-14
Hi, is this feature available already? Did anyone manage to get this working w/ Magento ver. 1.0.19870.1?
John
Total Posts: 39
Joined: 2007-12-20
Sheffield
Hi Moshe, Has this made it into 1.1? or is this going to be in later releases?
Thanks
John
brianpat
Total Posts: 38
Joined: 2008-04-05
I also get the same problems. It doesn’t work even in new fresh latest 1.1.1 installation. Magento should look for a permanent fix
skitpt
Total Posts: 17
Joined: 2008-05-09
Same thing here, latest magento release. Isnt there a fix for this ? Is it that hard ?
Scott
Total Posts: 317
Joined: 2007-08-31
Northwest Ohio
Well, if the M team is supposedly to have been working on this it should be available… but only one of them can say for sure. What’s the word?
Signature
Need a Magento designer ? I specialize in helping developers and shop owners create Magento themes designed with aesthetic bliss, crisp refreshing style, and usability-focused design. Check out Tealo, the first public Magento theme !
Your Magento Partner for Stunning Creative Work!
Posted: August 15 2008
| top
| # 15