Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7402947
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T04:55:25+00:00 2026-05-29T04:55:25+00:00

does anyone know howto programmatically show and make the field editable for tracking number

  • 0

does anyone know howto programmatically show and make the field editable for tracking number field in order overview?

I am thinking this.

step 1. First enable showing the tracking field in Grid.php, so extend … Does anyone have an example how to add a column? (and for that matter hide an existing column)

Add this to /etc/config.xml under events so Magento knows what to call

<core_block_abstract_prepare_layout_before>
    <observers>
    <SNH_ShipMailInvoice_Observer_addTrackingColumnToGrid>
        <type>model</type>
        <class>SNH_ShipMailInvoice_Model_Observer</class>
        <method>addTrackingColumnToGrid</method>
    </SNH_ShipMailInvoice_Observer_addTrackingColumnToGrid>
    </observers>
</core_block_abstract_prepare_layout_before>

step 2.a Then populate the Grid with the tracking code if applicable

So first add a field in /Model/Observer.php (that answers step 1)

public function addTrackingColumnToGrid($observer)
{
// this will return the block name for every block triggered by the observer
$block = $observer->getEvent()->getBlock();

// filter - we only want the block for the sales order grid
if ($block instanceof Mage_Adminhtml_Block_Sales_Order_grid){
    // well, that was easy!
    $block->addColumn('tracking_number', array(
        'header' => Mage::helper('sales')->__('Tracking number'),
        'index' => 'tracking_number',
        'type' => 'input',
        'width' => '120px',
        'renderer' => 'SNH_ShipMailInvoice_Block_Adminhtml_Renderer_addTrackingColumnToGrid'
    ));

}
}

step 2.b Then we need to populate the field with available tracking info

‘renderer’ =>
‘SNH_ShipMailInvoice_Block_Adminhtml_Renderer_addTrackingColumnToGrid’

should call to addTrackingColumnToGrid.php in /Block/Adminhtml/Renderer/addTrackingColumnToGrid.php

* CURRENT PROBLEM: ERROR **
This is where I am getting my white page no answer

step 2.c Lookup the tracking number per order in row. Currently untested/unconfirmed

// HOW DO I POPULATE VAR $order for each line? 
$shipmentCollection = Mage::getResourceModel('sales/order_shipment_collection')->setOrderFilter($order)->load();

foreach ($shipmentCollection as $shipment){     
    // This will give me the shipment IncrementId, but not the actual tracking information.
    foreach($shipment->getAllTracks() as $tracknum) {
        $tracknums[]=$tracknum->getNumber(); }  
        // How to show the tracking information     
        // CODE HERE 
    }
}

step 3 Then when I click on the dropdown option Masssaction (already programmed) the backend should process the selected items only and store the tracking ID to the shipment (that is created shortly after)

(and after that continue invoice and ship)

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T04:55:26+00:00Added an answer on May 29, 2026 at 4:55 am

    If I may suggest something simpler:

    1. Add a column that shows a tracking number.
    2. If no tracking number exists, a link that says “Add tracking.”
    3. It tracking number exists, show the tracking number as a hyperlink. Also have an “Add tracking” link below it, for multiple tracking numbers per order.
    4. Clicking the “Add tracking” link converts the link to a text field. Clicking the tracking number (if present), converts the tracking number to a text field prepopulated with the value of the tracking number (for editing).
    5. Clicking away converts the text field(s) back to text links after saving. I do recommend a “loading” visual cue during the saving process.

    How to add a column to the Sales Order grid

    Setup an event observer. (You could use a rewrite in your config.xml file, but this can potentially cause conflicts with other modules.)

    <adminhtml>
        <events>
            <core_block_abstract_prepare_layout_before>
                <observers>
                    <Namespace_Module_Observer_addTrackingColumnToGrid>
                        <type>model</type>
                        <class>Namespace_Module_Observer</class>
                        <method>addTrackingColumnToGrid</method>
                    </Namespace_Module_Observer_addTrackingColumnToGrid>
                </observers>
            </core_block_abstract_prepare_layout_before>
        </events>
    </adminhtml>
    

    Create your observer in ./app/code/local/Namespace/Module/Model/Observer.php. It should look something like this.

    <?php
    class Namespace_Module_Model_Observer
    {
        public function addTrackingColumnToGrid($observer)
        {
            // this will return the block name for every block triggered by the observer
            $block = $observer->getEvent()->getBlock();
    
            // filter - we only want the block for the sales order grid
            if ($block instanceof Mage_Adminhtml_Block_Sales_Order_grid){
    
                // well, that was easy!
                $block->addColumn('tracking_number', array(
                    'header' => Mage::helper('sales')->__('Tracking number')
                ));
    
            }
        }
    }
    

    Try looking in Mage_Adminhtml_Block_Widget_Grid for clues on how to use the addColumn method. It’s pretty much universal for all Magento admin grids, which is nice. If you’re looking to add custom functionality (besides just retrieving data), though, there’s a pretty good chance you’re going to need to figure out how to apply “renderers.”

    Once you’ve got that part figured out, you just need to setup an Ajax controller and drop in a little JavaScript to transmit the update information to your controller.

    This is a pretty broad question, so I can’t exactly do it all for you (without writing an extension), but I’ll try to help you along the way.

    For what it’s worth, you might look into the Tracking Import module over at Creativemgroup.com. Word on the street is a forthcoming version of this module includes the edit-in-place functionality you’re looking for.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Does anyone know how to programmatically obtain the server version number under JBossAS 5.1?
Does anyone know how to programmatically move/order the pages and subsites that appear in
Does anyone know how to turn off iPhone's GPS programmatically? Once I use the
Does anyone know how to programmatically determine the application IDs of the apps on
Does anyone know how to programmatically expand the nodes of an AdvancedDataGrid tree column
does anyone know how to show the new list element form on button click,
Does anyone know how to access SkyDrive programmatically from Windows Phone 7? What API
Does anyone know how to programmatically access the All Users Startup Menu? In XP,
Does anyone know how to get programmatically the absolute path in the filesystem for
Does anyone know how to programmatically remove/add the checked and unchecked event on WPF

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.