Remove Billing Agreements and Recurring Profiles My Account Dashboard

Tuesday, 8. May 2012

Easier way to remove these links from My account page in Magento is to use the custom layout.xml files as shown below

You will need to Add these layout.xml file to your current theme.

app/design/frontend/[your theme]/layout/sales/billing_agreement.xml
app/design/frontend/[your theme]/layout/sales/recurring_profile.xml

with the content:

<?xml version="1.0"?>
<layout version="0.1.0">
</layout>

**IMPORTANT
Make sure you clear your cache before changes can take place.

Enjoy!

Another way to Get Current page layout in Magento

Saturday, 4. February 2012

Here is a little snippet for getting the current page layout in Magento

echo str_replace(array('page/','.phtml'),array('',''),$this->getLayout()->getBlock('root')->getTemplate());

enjoy!

Fatal error: Call to a member function toHtml() on a non-object in app/code/core/Mage/Core/Model/Layout.php on line 529

Friday, 11. November 2011

Most upgrades from versions below 1.4 to latest version are more likely to encounter this problem when trying to re-install the same theme back on the new version. The solution is simple as explained below:

Fatal error: Call to a member function toHtml() on a non-object in app/code/core/Mage/Core/Model/Layout.php on line 529

Locate and open the file app/design/frontend/default/YOUR_THEME/layout/page.xml file and change the following line:

<block type="core/profiler" output="toHtml"/>

to

<block type="core/profiler" output="toHtml" name="core_profiler"/>

Enjoy!

Add Review List and Review Form on Magento Product Page Tab

Sunday, 30. October 2011

If you want to add customer reviews on product page tab these steps may help you.

Locate and open your theme’s catalog.xml file

– On the file look/search for: catalog_product_view

– Look for the content enclosed within

<block type="catalog/product_view" name="product.info" template="catalog/product/view.phtml">

– Add your review form and list as shown below.

<block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" >
  <block type="review/form" name="product.review.form" as="review_form"/>			                               
  <action method="addTab" translate="title" module="review">
	   <alias>product_additional_data</alias>
	   <title>Reviews</title>
	   <block>review/product_view_list</block>
	   <template>review/product/view/list.phtml</template>
  </action>	                 
</block>

– Your final result should look something like this.

<reference name="content">
  ...
  <block type="catalog/product_view_tabs" name="product.info.tabs" as="info_tabs" template="catalog/product/view/tabs.phtml" >
    <block type="review/form" name="product.review.form" as="review_form"/>			                               
    <action method="addTab" translate="title" module="review">
	   <alias>product_additional_data</alias>
	   <title>Reviews</title>
	   <block>review/product_view_list</block>
	   <template>review/product/view/list.phtml</template>
    </action>	                 
  </block>    
  ...
</reference>

– Finally you will need to make these changes to the review list template file.

Look for and open file review/product/view/list.phtml

On this file and near the bottom of it, look for and comment out this line

#echo $this->getChildHtml('review_form')

Then, add this line underneath

$layout = Mage::getSingleton('core/layout');
echo $layout->getBlock('content')->getChild('product.info')->getChild('info_tabs')->getChild('review_form')->toHtml();