Skip to main content
edited tags
Link
highlight some important words to get quick answer
Source Link

I have created a module with the following observer that should pull the 'orderstatus_status_code''orderstatus_status_code' custom attribute value from the sales_flat_ordersales_flat_order table through to the Sales Order Grid View;

<?php    <?php

    class OrderSync_Model_Observer {
     
        /**
         * Adds column to admin sales order grid
         *
         * @param Varien_Event_Observer $observer
         * @return OrderSync_Model_Observer
         */
        public function appendOrderSync($observer)
        {
            $block = $observer->getBlock();
            if (!isset($block)) {
                return $this;
            }
    
            if ($block->getType() == 'adminhtml/sales_order_grid') {
                /* @var $block Mage_Adminhtml_Block_Sales_Order_Grid */
                $block->addColumnAfter('ordersync_status_code', array(
                    'header'    => 'Order Sync Status',
                    'type'      => 'varchar',
                    'index'     => 'ordersync_status_code',
                    'filter_index'     => 'ordersync_status_code',
                ), 'status');
            }
        }
 
    }

This has correctly added the 'Order Sync Status''Order Sync Status' column but no value is displaying where I know there is data in the table and I wondered if anyone can help to show me how to get the data there?

I have created a module with the following observer that should pull the 'orderstatus_status_code' custom attribute value from the sales_flat_order table through to the Sales Order Grid View;

    <?php

class OrderSync_Model_Observer {
 
    /**
     * Adds column to admin sales order grid
     *
     * @param Varien_Event_Observer $observer
     * @return OrderSync_Model_Observer
     */
    public function appendOrderSync($observer)
    {
        $block = $observer->getBlock();
        if (!isset($block)) {
            return $this;
        }

        if ($block->getType() == 'adminhtml/sales_order_grid') {
            /* @var $block Mage_Adminhtml_Block_Sales_Order_Grid */
            $block->addColumnAfter('ordersync_status_code', array(
                'header'    => 'Order Sync Status',
                'type'      => 'varchar',
                'index'     => 'ordersync_status_code',
                'filter_index'     => 'ordersync_status_code',
            ), 'status');
        }
    }
 
}

This has correctly added the 'Order Sync Status' column but no value is displaying where I know there is data in the table and I wondered if anyone can help to show me how to get the data there?

I have created a module with the following observer that should pull the 'orderstatus_status_code' custom attribute value from the sales_flat_order table through to the Sales Order Grid View;

<?php    
    class OrderSync_Model_Observer {    
        /**
         * Adds column to admin sales order grid
         *
         * @param Varien_Event_Observer $observer
         * @return OrderSync_Model_Observer
         */
        public function appendOrderSync($observer)
        {
            $block = $observer->getBlock();
            if (!isset($block)) {
                return $this;
            }
    
            if ($block->getType() == 'adminhtml/sales_order_grid') {
                /* @var $block Mage_Adminhtml_Block_Sales_Order_Grid */
                $block->addColumnAfter('ordersync_status_code', array(
                    'header'    => 'Order Sync Status',
                    'type'      => 'varchar',
                    'index'     => 'ordersync_status_code',
                    'filter_index'     => 'ordersync_status_code',
                ), 'status');
            }
        }
    }

This has correctly added the 'Order Sync Status' column but no value is displaying where I know there is data in the table and I wondered if anyone can help to show me how to get the data there?

Source Link

Display custom attribute data in sales order grid view

I have created a module with the following observer that should pull the 'orderstatus_status_code' custom attribute value from the sales_flat_order table through to the Sales Order Grid View;

    <?php

class OrderSync_Model_Observer {

    /**
     * Adds column to admin sales order grid
     *
     * @param Varien_Event_Observer $observer
     * @return OrderSync_Model_Observer
     */
    public function appendOrderSync($observer)
    {
        $block = $observer->getBlock();
        if (!isset($block)) {
            return $this;
        }

        if ($block->getType() == 'adminhtml/sales_order_grid') {
            /* @var $block Mage_Adminhtml_Block_Sales_Order_Grid */
            $block->addColumnAfter('ordersync_status_code', array(
                'header'    => 'Order Sync Status',
                'type'      => 'varchar',
                'index'     => 'ordersync_status_code',
                'filter_index'     => 'ordersync_status_code',
            ), 'status');
        }
    }

}

This has correctly added the 'Order Sync Status' column but no value is displaying where I know there is data in the table and I wondered if anyone can help to show me how to get the data there?