Thursday, 5 December 2019

Magento2 Professional Developer Certification Experience

       My Personal Magento2 Professional Developer Certification  Experience
       
      

     

What areas covered in the exam?
  • Dependency Injection
  • Module dependencies
  • Plugins
  • Events
  • EAV
  • XML Arguments
  • Extension Attributes
  • API
  • UI Components in the Adminhtml
  • Frontend Layout and Blocks
  • Catalog And Category
  • Checkout
  • Sales Order ( invoice , order history )
How you can prepare for the exam?

1. Deep Study on Magento2 Dev Doc
2. You can study on swiftotter
3. Create one big module which uses admin html grid , system settings , menu , auth , router , api , etc

Friday, 8 November 2019

Add customer address attribute programmatically in Magento 2.3 using Data Patch

1.Create file registration.php in app/code/Custom/CustomerAddressAttribute/registration.php

<?php
/**
 * Ansar Husain
 * Custom_CustomerAddressAttribute
 */
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Custom_CustomerAddressAttribute,
    __DIR__
);


Add customer attribute programmatically in Magento 2.3 using Data Patch

1.Create file registration.php in app/code/Custom/CustomerAttribute/registration.php

<?php
/**
 * Ansar Husain
 * Custom_CustomerAttribute
 */
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Custom_CustomerAttribute,
    __DIR__
);


Add order state and status programmatically in Magento 2.3 using Data Patch

1.Create file registration.php in app/code/Custom/OrderStatus/registration.php

<?php
/**
 * Ansar Husain
 * Custom_OrderStatus
 */
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Custom_OrderStatus',
    __DIR__
);


Monday, 5 August 2019

Sunday, 7 July 2019

Display product image in custom phtml file Magento2.

Use below code for display product image in custom template file.

$_imagehelper = $this->helper('\Magento\Catalog\Helper\Image');

 <img src=" <?= $_imagehelper->init($_product, 'product_page_image_small')->getUrl(); ?>" width="100" height="100" alt="product-image"/>

Tuesday, 2 July 2019

Update Category Attribute Programatically in Magento2 using csv

<?php
ini_set('display_errors', 1);
ini_set('memory_limit', '5G');
error_reporting(E_ALL);

use Magento\Framework\App\Bootstrap;

require 'app/bootstrap.php';

Monday, 1 July 2019

Category Name instead of category ids in category path magento2.

protected $_categoryFactory;

public function __construct(
        \Magento\Catalog\Model\CategoryFactory $categoryFactory
    ) {
        $this->_categoryFactory = $categoryFactory;
        parent::__construct($context);
    }

Thursday, 27 June 2019

Category Custom Attribute Value in magento2

1. Create Block file Attribute.php app/code/Category/CustomAttribute/Block/Attribute.php

<?php
/**
 * Ansar Husain
 * Category_CustomAttribute
 */

namespace Category\CustomAttribute\Block;

use Magento\Catalog\Api\CategoryRepositoryInterface;

/**
 * Class Attribute
 * @package  Category\CustomAttribute\Block
 */
class Attribute extends Template
{

Monday, 29 April 2019

Reorder of magento2 checkout fields like as postcode and company

Create file checkout_index_index.xml in Vendor\Module\view\frontend\layout


<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="checkout" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="checkout.root">
            <arguments>

Monday, 8 April 2019

Display admin user name who made order comment Magento2

1.Create file registration.php in app/code/Order/CommentsUser/registration.php

<?php
/**
 * Ansar Husain
 * Order_CommentsUser
 */
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Order_CommentsUser',
    __DIR__
);

Monday, 4 March 2019

Create and install magento2 patch files

1. Go to magento2 vendor directory

2.run command inside vendor directory

   git init


3. run following commands now

   git add -A

   git commit -m " temp added "

Magento2 Google Translation

1.Create file registration.php in app/code/Google/Translator/registration.php

<?php
/**
 * Ansar Husain
 * Google_Translator
 */
\Magento\Framework\Component\ComponentRegistrar::register(
    \Magento\Framework\Component\ComponentRegistrar::MODULE,
    'Google_Translator',
    __DIR__
);