How to resolve Call to a member function toHtml() error in Magento?

Share
Posted on October 18th, 2012 | Posted by admin

How to resolve Call to a member function toHtml() error in Magento?
To resolve the problem, kindly open /app/design/frontend/default/template_number/layout/page.xml

Change

<block type=”core/profiler” output=”toHtml”/><br /><br />

to

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

How to compile Javascript loaded by Ajax?

Share
Posted on October 14th, 2012 | Posted by admin

Hi everyone. We know that Javascript is compiled when the browser loads your webpage. However, sometimes you need to compile your script loaded by Ajax, how should you do? As default, the browser doesn’t compile the script responded by Ajax. If you use the function eval() to compile your script, the variable (defined in your Ajax response code) will be unavailable to call in your page. Thus I have a tip that may help you solve this issue. You can call the function below to compile your script loaded by Ajax.

// Compile your custom script
function compileJsAjax(yourScript){
    var jsElement = document.createElement('script');
    jsElement.type = 'text/javascript';
    jsElement.text = yourScript;
    var existedJs = document.getElementsByTagName('script')[0];
    existedJs.parentNode.insertBefore(jsElement,existedJs);
}

How to create Downloadable Products Magento

Share
Posted on September 30th, 2012 | Posted by admin

How to create Downloadable Products Magento

1. Go to Catalog -> Manage Products -> Add product.

Select the Downloadable Product type:

2. Basic set up. Name, price, stock, website, category…

HOW TO GENERATE THUMBNAIL OF HTML PAGES

Share
Posted on July 5th, 2012 | Posted by admin

I was just adding my site on Alexa and in some minutes Alexa generated a thumbnail of my html site. And again it was same with blog catelog. So I thought is there any PHP code that crawled the site and generates its image thumb? After a lots of research I came out with these. Remember, this only works in windows server.
There is one thing called IECapt.exe ( A Internet Explorer Web Page Rendering Capture Utility). This renders the page and generate thumbnail of it. You can download it from IECapt.exe. And to run that through php here’s the code.

This is the class file that generates thumb images from the output of IECapt.exe. Save it as image.class.php

How to hide ‘Add Item’ button in Magento Backend Grid

Share
Posted on February 19th, 2012 | Posted by admin

In some cases you might need to hide the ‘Add Item’ button on the grid page in backend module for admin. This may eat your head if you have no idea of what is going on. But this is as simple as nothing. Follow the below given steps and you are done in less than a minute.

Open app\code\local\<namespace>\<module>\Block\Adminhtml\<module>.php and perform following changes:

<?php
class <Namespace>_<Module>_Block_Adminhtml_<Module> extends Mage_Adminhtml_Block_Widget_Grid_Container
Page 4 of 21« First...«23456»1020...Last »