|
Hi everyone,
My client has asked us to write something which allows him to change a specific order’s email address. It turns out the customers don’t enter their email address correctly fairly often, and Magento does not support this out the box.
The plan was to extend the existing Sales Order View Info block and add an “edit” link to the Account Information area, much like you see for “Shipping Address” and other areas on the page. I’ve spent an entire day looking at other people’s code including Magentocommerce.com regarding rewriting blocks and just can’t get it to work.
Here’s what I got:
In app/etc/modules/Webulartech_Adminhtml.xml
<?xml version="1.0" encoding="utf-8"?> <config> <modules> <Webulartech_Adminhtml> <active>true</active> <codePool>local</codePool> <depends> <Mage_Adminhtml/> </depends> </Webulartech_Adminhtml> </modules> </config>
In app/code/local/Webulartech/Adminhtml/etc/config.xml
<?xml version="1.0" encoding="utf-8"?> <config> <modules> <Webulartech_Adminhtml> <version>0.0.1</version> </Webulartech_Adminhtml> </modules> <global> <blocks> <adminhtml> <rewrite> <sales_order_view_info> Webulartech_Adminhtml_Block_Sales_Order_View_Info </sales_order_view_info> </rewrite> </adminhtml> </blocks> </global> </config>
In app/code/local/Webulartech/Adminhtml/Block/Sales/Order/View/Info.php
<?php class Webulartech_Adminhtml_Block_Sales_Order_View_Info extends Mage_Adminhtml_Block_Sales_Order_View_Info {
public function getAddressEditLink($address, $label='') { return "YES! IT WORKS!"); } }
Needless to say, it doesn’t work! The block Mage_Adminhtml_Block_Sales_Order_View_Info does not get extended by my class. I’m expecting the “Edit” links in Billing Address and Shipping Address to change to “YES! IT WORKS!” but it doesn’t.
I’m using Magento 1.5.1.0. Can anyone explain where I’ve gone wrong, or if not then perhaps suggest another way?
|