Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Design Home page with single product in catalog view mode
 
thunder3k
Jr. Member
 
Total Posts:  16
Joined:  2010-08-25
 

I would like home page to display a single product in full blown mode with all description and add to cart button like it is when we click on a particular product (catalog view layout). The product should be selected dynamically based on some yes-no attribute. How to achieve this in Magento community edition 1.4?

Thanks
Thunder

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

Thunder,

You could simple do a custom URL and point your homepage to that product.

Otherwise you could include the view.html template on your homepage. You will need to set the id to the entity_id of that product. There is a WIKI on how to do that, but I don’t have it on the tip of my tongue.

I also think their is a featured product module that is free

 
Magento Community Magento Community
Magento Community
Magento Community
 
satish
Enthusiast
 
Total Posts:  812
Joined:  2008-03-24
34,mantri Sadan,Shivaji Nagar,Nagpur,MS,India 4400
 

You should create a listing with single product with all description and add to cart button. You will call listing block on home page content part. You will get the product s dynamically.

Satish

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

@satish:: But he wanted to change it dynamically based on a attribute. How would he do that?

 
Magento Community Magento Community
Magento Community
Magento Community
 
thunder3k
Jr. Member
 
Total Posts:  16
Joined:  2010-08-25
 

Brent/Satish,

I am trying to use the solution provided by Dan in one of the thread (http://www.magentocommerce.com/boards/viewthread/4454/) with a change.  Instead of using homepage.phtml, i would like to use catalog\product\view.phtml. I am able to set my product in homepage.php which I am able to get in view.phtml. [using this->setProduct(products->getfirstitem()) ].

But view.phtml uses many childHtml() block which my cms page is not able to get. Can you help me with the changes i need to do here. i was thinking of using update layout xml instead of content. If that can work, what should go into update layout xml? which handle can I use there to replace it with <catalog_product_view> handle. I have also tried writing a custom widget to include it in cms home page. But i do not know how to get the view.phtml data into that.

My intention is not to replicate the same code twice for maintainability and uniformity. So I want to reuse the same component used during normal product display.

Please help me with the solutions.

Thanks
Thunder

 
Magento Community Magento Community
Magento Community
Magento Community
 
thunder3k
Jr. Member
 
Total Posts:  16
Joined:  2010-08-25
 

Hi Brent,

I am using
{{block type="catalog/product_view" product_id="1" template="catalog/product/view.phtml"}} to get the view page on home page itself. But there are two problems:
a) The product id has to be dynamically picked up based on some logic
b) It is not showing other child component of the view.phtml viz media, add to cart, price etc.

whats the solution?
i am trying something like : {{block type="catalog/product_view" product_id="1" template="catalog/product/view.phtml"}, {block type="catalog/product_view_media" name="product.info.media" as="media" template="catalog/product/view/media.phtml"}} but the media is overwriting the view.phtml.

Please help.

 
Magento Community Magento Community
Magento Community
Magento Community
 
thunder3k
Jr. Member
 
Total Posts:  16
Joined:  2010-08-25
 

Hi Brent,

Please guide me with using nested block elements in cms content?

Thanks,
Thunder3k

 
Magento Community Magento Community
Magento Community
Magento Community
 
Brent W Peterson
Moderator
 
Avatar
Total Posts:  3217
Joined:  2009-02-26
Minneapolis MN
 

Thunder, I am not quite sure what you are asking?

 
Magento Community Magento Community
Magento Community
Magento Community
 
thunder3k
Jr. Member
 
Total Posts:  16
Joined:  2010-08-25
 

Hi Brent,

I am using
{{block type="catalog/product_view" product_id="1" template="catalog/product/view.phtml"}}
to get the view.phtml page on cms home page. But the problem is that other child elements of the view.phtml like the media.phtml, adtocart.phtml etc are not displayed.
Looking into the layout for catalog/product_view, there are many nested blocks within that element. How to include them inside my cms page inside my block -
{{block type="catalog/product_view" product_id="1" template="catalog/product/view.phtml"}}

Hope it is clear now. Please help me with the solution.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top