Skip to main content

Posts

Magento add Customer Email to adminhtml order grid

Just copy Grid.php to   app/code/local/Mage/Adminhtml/Block/Sales/Order/ Then appendsales_flat_order table to collection protected function _prepareCollection () { $collection = Mage :: getResourceModel ( $this -> _getCollectionClass ()); $collection -> getSelect ()-> join ( 'sales_flat_order' , 'main_table.entity_id = sales_flat_order.entity_id' , array ( 'customer_email' )); $this -> setCollection ( $collection ); return parent :: _prepareCollection (); }; And a addColumn to _prepareColumns() $this -> addColumn ( 'customer_email' , array ( 'header' => Mage :: helper ( 'sales' )-> __ ( 'Payment method' ), 'index' => 'customer_email' , 'filter_index' => 'sales_flat_order.customer_email' , ));

Magento 2 events observer list

Below is a list of all the events dispatched that you can observe in your Magento 2 web store. Magento 2 Events Observer list: 'adminhtml_cache_flush_all' 'adminhtml_cache_flush_system' 'backend_auth_user_login_success', ['user' => $this->getCredentialStorage()] 'backend_auth_user_login_failed', ['user_name' => $username, 'exception' => $e] 'backend_auth_user_login_failed', ['user_name' => $username, 'exception' => $e] 'adminhtml_store_edit_form_prepare_form', ['block' => $this] 'adminhtml_block_html_before', ['block' => $this] 'backend_block_widget_grid_prepare_grid_before', ['grid' => $this, 'collection' => $this->getCollection()] 'theme_save_after' 'store_group_save', ['group' => $groupModel] 'store_delete', ['store...

Magento 2: Get product attribute’s select option id,label for all products from root folder

First create test.file in root folder place below code <?php echo '<pre>'; require __DIR__ . '/app/bootstrap.php'; $bootstrap = \Magento\Framework\App\Bootstrap::create(BP, $_SERVER); /** @var \Magento\Framework\App\Http $app */ $obj = $bootstrap->getObjectManager(); $state = $obj->get('Magento\Framework\App\State'); $state->setAreaCode('frontend'); /** @var \Magento\Framework\App\Http $app */ $app = $bootstrap->createApplication('TestApp'); $bootstrap->run($app); After that create  loaded application file with name of Testapp (bold letter) place the below code <?php class TestApp extends \Magento\Framework\App\Http implements \Magento\Framework\AppInterface {     public function launch() {         echo "<pre>"; //die("here");         $objectManager = \Magento\Framework\App\ObjectManager::getInstance();         $orderDatamodel = $objectManager->get('Mag...

Magento 2 upgrade 2.1.4 to 2.1.7 process

Use below command to update MAGENTO 2 version from old version to latest version from  root directory. I ended up trying to do the upgrade from the command line and it worked 1>  composer require magento/product-community-edition 2.1.7 --no-update 2> composer update 3> php bin/magento setup:upgrade