Magento Forum - UK Magento Forum (Unofficial)

An unofficial but dedicated Magento Forum for Magento Users, Designers and Developers

I want to display a specific product on a new page

A forum for web designers working with the Magento system.

I want to display a specific product on a new page

Postby yarddemon » Wed Sep 07, 2011 4:25 pm

I am going to attempt my first post on the unofficial forum. Crickets chirp on the main community forum, so here it goes...

I'm working in magento 1.6.0.0 . I'm trying to add specific products on a new page based on product ID.. here's my attempt:

<reference name="content">
<block type="catalog/product_list" product_id="3" template="catalog/product/list.phtml">
</block>
<block type="catalog/product_list" product_id="4" template="catalog/product/list.phtml">
</block>
</reference>


I’m adding this in CMS > Page > New Page > Design

The problem is, it’s displaying ALL products. How do I fix this?
yarddemon
 
Posts: 6
Joined: Wed Sep 07, 2011 4:21 pm

Re: I want to display a specific product on a new page

Postby edmondscommerce » Fri Sep 16, 2011 4:40 pm

The easiest way to do this is to create a new category and add the products to that. You can the display the products using the following code in the CMS system

Code: Select all
{{block type="catalog/product_list" category_id="123" template="catalog/product/list.phtml"}}


or this in the XML

Code: Select all

<reference name="content">
    <block type="catalog/product_list" name="products" template="catalog/product/list.phtml">
        <action method="setCategoryId"><category_id>123</category_id></action>
    </block>
</reference>


Where 123 is the category id of the new product
User avatar
edmondscommerce
 
Posts: 1157
Joined: Fri Sep 11, 2009 8:55 am
Location: UK

Re: I want to display a specific product on a new page

Postby andycot » Thu Apr 12, 2012 4:09 am

edmondscommerce wrote:The easiest way to do this is to create a new category and add the products to that. You can the display the products using the following code in the CMS system

Code: Select all
{{block type="catalog/product_list" category_id="123" template="catalog/product/list.phtml"}}


or this in the XML

Code: Select all

<reference name="content">
    <block type="catalog/product_list" name="products" template="catalog/product/list.phtml">
        <action method="setCategoryId"><category_id>123</category_id></action>
    </block>
</reference>


Where 123 is the category id of the new product


Good Share
andycot
 
Posts: 10
Joined: Wed Apr 11, 2012 11:29 am
Location: london


Return to Magento Designers

cron