0

Here is what i have tried

i am trying to override Mage/Adminhtml/Block/Sales/Order/Create/Items/Grid.php block

Config.xml

<?xml version="1.0"?>
<config>
    <modules>
        <vendor_module>
            <version>
                0.1.0
            </version>
        </vendor_module>
    </modules>
    <global>
        <blocks>
            <adminhtml>
                <rewrite>
                    <sales_order_create_items_grid>
                        Vendor_Module_Adminhtml_Block_Sales_Order_Create_Items_Grid
                    </sales_order_create_items_grid>
                </rewrite>
            </adminhtml>
        </blocks>
    </global>
</config>

Vendor/Module/Block/Adminhtml/Sales/Order/Create/Items/Grid.php

<?php

class Vendor_Moduley_Adminhtml_Block_Sales_Order_Create_Items_Grid extends Mage_Adminhtml_Block_Sales_Order_Create_Items_Grid
{
    /**
     * Flag to check can items be move to customer storage
     *
     * @var bool
     */
    protected $_moveToCustomerStorage = true;

    /**
     * Class constructor
     */
    public function __construct()
    {
        parent::__construct();
        $this->setId('sales_order_create_search_grid');
    }

    /**
     * Returns the items
     *
     * @return array
     */
    public function getItems()
    {
        echo'check'; exit;
    }
}

Any thoughts what's wrong here ?

0

Two issues, you have a typo in your class definition: Vendor_Moduley_... and you shouldn't have a link breaks in your config.xml:

<global>
    <blocks>
        <adminhtml>
            <rewrite>
                <sales_order_create_items_grid>Vendor_Module_Adminhtml_Block_Sales_Order_Create_Items_Grid</sales_order_create_items_grid>
            </rewrite>
        </adminhtml>
    </blocks>
</global>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.