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

Overriding getSummaryHtml method
 
BoostMyShop
Sr. Member
 
Avatar
Total Posts:  155
Joined:  2008-06-11
France
 

Hello smile

i’m using magento 1.1 and i’d like to override getSummaryHtml method from Mage_Review_Helper_Product.php in order to display rating average instead of comments number.

I did the folowing but it doesn’t work:

Create “magento\app\etc\modules\MDN_MageCustomization.xml” :

<?xml version="1.0"?>
<config>
    <
modules>
        <
MDN_MageCustomization>
            <
active>true</active>
            <
codePool>local</codePool>
        </
MDN_MageCustomization>
    </
modules>
</
config>

Create magento\app\code\local\MDN\MageCustomization\etc\config.xml

<?xml version="1.0"?>
<config>
    <
modules>
        <
MDN_MageCustomization>
            <
version>0.1.0</version>
        </
MDN_MageCustomization>
    </
modules>
    <global>
    <
Review>
      <
Helper>
        <
rewrite>
          <
Product>MDN_MageCustomization_Review_Helper_Product</Product>
        </
rewrite>
      </
Helper>
    </
Review>
    </global>
</
config>

create magento\app\code\local\MDN\MageCustomization\Review\Helper\Product.php

<?php
class MDN_MageCustomization_Review_Helper_Product extends Mage_Review_Helper_Product
{

        
public function getSummaryHtml($product$type=null$displayBlock=0)
        
{
            
return 'Hello World';
        
}



?>

any idea ?

Thanks in advance smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
nicolas46
Sr. Member
 
Total Posts:  210
Joined:  2008-04-09
Toulouse
 

Maybe try this

config.xml :

<?xml version="1.0"?>
<config>
    <
modules>
        <
MDN_MageCustomization>
            <
version>0.1.0</version>
        </
MDN_MageCustomization>
    </
modules>
    <global>
       <
helpers>
          <
review>
    
              <
rewrite>
                  <
product>MDN_MageCustomization_Review_Helper_Product</product>
            </
rewrite>
       </
review>
   </
helpers>
    </global>
</
config>

Be carefull with the case (lower case, upper case, i don’t know the english word for this but I think you understand what I meen smile )

 
Magento Community Magento Community
Magento Community
Magento Community
 
BoostMyShop
Sr. Member
 
Avatar
Total Posts:  155
Joined:  2008-06-11
France
 

Nicolas: i loooooooooooooooooooooooooove you smile

thank u very much for ur help !!!!!

PS: tu ne serais pas francais par hasard ?? wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
nicolas46
Sr. Member
 
Total Posts:  210
Joined:  2008-04-09
Toulouse
 

Si si , ça se voit tant que ça ?  rasberry

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