Magento Forum

Block Type catalog/product_view Parameter
 
andyk123
Member
 
Total Posts:  36
Joined:  2008-02-04
 

Hi!

which parameter do I need, when I use

{{block type="catalog/product_view" PARAMTER }}

to display a Specific Product in Poduct View directly on the homepage?
Thank you for your Help!
 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Replace files below with attached files:

app/code/core/Mage/Core/Block/Template.php
app/code/core/Mage/Catalog/Block/Product/View.php

Then you can use

{{block type="catalog/product_view" product_id="1" template="catalog/product/view.phtml"}}
in CMS pages.
File Attachments
Template.php  (File Size: 6KB - Downloads: 340)
View.php  (File Size: 7KB - Downloads: 361)
 
Magento Community Magento Community
Magento Community
Magento Community
 
andyk123
Member
 
Total Posts:  36
Joined:  2008-02-04
 

thank you very much for your reply! i just have the problem if i replace the template.php and call the frontend or backend there just come white empty pages...could you imagine a reason for that?

 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Possibly there were some other changes made after release that are not compatible with other files in your version…

Alternatively, you can edit your original Template.php:
* remove public function setTemplate($templateName)
* replace all entries of getTemplateName() to getTemplate()

See if this helps.

 
Magento Community Magento Community
Magento Community
Magento Community
 
andyk123
Member
 
Total Posts:  36
Joined:  2008-02-04
 

ok works better now...no more blank page. now the big “but” grin....as soon as i set:

block type="catalog/product_view" product_id="1" template="catalog/product/view.phtml"}}

I get this:

Fatal errorCall to a member function getMetaTitle() on a non-object in /usr/www/users/wowish/shopito.de/app/code/core/Mage/Catalog/Block/Product/View.php on line 41
 
Magento Community Magento Community
Magento Community
Magento Community
 
Moshe
Magento Team
 
Avatar
Total Posts:  1770
Joined:  2007-08-07
Los Angeles
 

Ok, use the original View.php and change public function getProduct() so it looks like this:

public function getProduct()
    
{
        
if (!Mage::registry('product') && $this->getProductId()) {
            $product 
Mage::getModel('catalog/product')->load($this->getProductId());
            
Mage::register('product'$product);
        
}
        
return Mage::registry('product');
    
}
 
Magento Community Magento Community
Magento Community
Magento Community
 
andyk123
Member
 
Total Posts:  36
Joined:  2008-02-04
 

did so and had no ffect...what am i doing wrong...?

 
Magento Community Magento Community
Magento Community
Magento Community
 
dailycloset
Jr. Member
 
Total Posts:  7
Joined:  2012-02-22
 

Was there a solution ever found for this problem or a method to get this to work on the newer versions of Magento?

I am looking to do the same thing.

thank you.

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