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.

Thanks so much for this, I will implement the changes you suggested on Sunday hopefully as I have uni work to be doing right now. I wasn’t too sure how to create the block, but will have a look around at using the template instead to accomplish what I need. If you know of any good tutorials or posts on getting some javascript to appear at the bottom of every page just before the </body> tag then that would be great!

Thanks so much again and I will update back here when I know if it works or not!

Thanks so much for all of your help, I have now fixed all of the problems and got it all working. :D

All being the settings section, the actual main code doesn’t work and that brings me onto my next question:

uguptu - 31 March 2011 11:33 AM

Two more recommendations inspired by the checking out your code:

1. Building up your default helper, derive it from Mage_Core_Helper_Data rather than from Mage_Core_Helper_Abstract.
2. Creating a block, suggest NEVER to build HTML directly in the block’s _toHtml() method, use a template instead. Anyway, inheriting your block from Mage_Core_Block_Text doesn’t make you any good when you are hacking it’s _toHtml(), it just makes no sence. If you prefer to ignore my buzz and still render HTML directly, use Mage_Core_Block_Abstract as an ancestor.

What would be the best way to go about what I need to do. You say that inheriting from Mage_Core_Block_Text is bad… Would it be better for me to inherit from Page_Footer and add my HTML to a template file and add it to the footer that way as my code needs to go in the footer as it is tracking code...?

Thanks so much for all of your help, I have now fixed all of the problems and got it all working. :D

All being the settings section, the actual main code doesn’t work and that brings me onto my next question:

uguptu - 31 March 2011 11:33 AM

Two more recommendations inspired by the checking out your code:

1. Building up your default helper, derive it from Mage_Core_Helper_Data rather than from Mage_Core_Helper_Abstract.
2. Creating a block, suggest NEVER to build HTML directly in the block’s _toHtml() method, use a template instead. Anyway, inheriting your block from Mage_Core_Block_Text doesn’t make you any good when you are hacking it’s _toHtml(), it just makes no sence. If you prefer to ignore my buzz and still render HTML directly, use Mage_Core_Block_Abstract as an ancestor.

What would be the best way to go about what I need to do. You say that inheriting from Mage_Core_Block_Text is bad… Would it be better for me to inherit from Page_Footer and add my HTML to a template file and add it to the footer that way as my code needs to go in the footer as it is tracking code...?

In case you are going to insert your block into the existing footer, it’s not right to inherit your own block from the same type as footer. Besides, there can only be one footer on the page, at least it only makes sense if there is only one.

What you need to do is to inherit from Mage_Core_Block_Template. In this case, your block will render itself according to the template which must be assigned to the block by either using <block type="..." name="..." template="mymodule/template.phtml" /> or putting

Template, in fact, is a PHTML file that is being included in block’s _toHtml() method. Thus, all methods of your block are available inside the template. It’s strongly restricted to use ONLY public methods and properties of the block inside the template, though.

Physically, the template will be located here: app/design/frontend/base/default/mymodule/template.phtml

I have created magento module using
http://t.wits.sg/tag/magento/
its working in local but when i checked on my live server error comes of class helper data not found i flushed cache,session every thing but nothing is working for me.Please help

I’ve got a very similar issue here, getting the error:
Fatal error: Class ‘Mage_Paygateus_Helper_Data’ not found in /home/site/public_html/app/Mage.php on line 546

Background:

I’ve been a developer for a while, but new to development for Magento. For various reasons, my client needs to 2 copies of the authorize.net (Paygate) plugin, each one to be run under slightly different circumstances with different authorize.net accounts.

Basically, I’ve copied app/code/core/Mage/Paygate to app/code/local/CO4/Paygateus and changed all the class names from Mage_Paygate_* to CO4_Paygateus_*, and made similar changes to config.xml and system.xml; wherever the short form ‘paygate’ was used, I replaced with ‘paygateus’.