Skip to main content

Posts

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

How to put the code google remarketing

 View.phtml Paste the below code on your product view template. You can find the file inside the catalog folder. <? php $_product = Mage :: registry ( "current_product" );?> <? php if ( $_product && $_product -> getId ()): ?> <script> dataLayer . push ({ "event" : "fireRemarketingTag" , "google_tag_params" : { "ecomm_prodid’: " <? php echo $_product -> getSku (); ?> ", "ecomm_pagetype’: " product ", "ecomm_totalvalue’: <? php echo $_product -> getfinalprice (); ?> } }); </script> <script type="text/javascript"> /* <![CDATA[ */ var google_conversion_id = XXXXXXXXXXX; var google_custom_params = window.google_tag_params; var google_remarketing_only = true; /* ]]> */ </script> <script type="text/javascript" src="// www.googleadservices.com/pagead/conversion.js "...