:::: MENU ::::
Browsing posts in: Magento 2

Magento 2.3 new features

Today we will talk about magento 2.3 new features. Though the magento version 2.3 is not released yet,but magento is planning to release it by the end of this year.During its imagine conference magento announced its plans for the upcoming Magento 2.3 release.Like every major release, there are various exciting features that are set to bring new opportunities for magento clients to sell to their customers, as well as notable back-end efficiencies.

In this article we will look at new features of an enhanced version.i.e magento 2.3.

Magento 2.3 new features

We will have a brief look at the new features and improvements.

PWA

A Progressive Web App is an application,built to take advantage of modern technology features. It provides the feature of caching of data so the website can be used (partially or fully) in an offline mode when internet service is unavailable.
Magento recognizes the multiple benefits to this, and in late 2017 announced its efforts in building what it calls the PWA Studio. PWA Studio will contain tools to develop and deploy a PWA for Magento’s front end. Along with PWA Studio will come a lightweight (not feature-full) demo site. The immediate benefits will be a major increase in front-end performance and a close to 10X increase in speed of onboarding new Magento front-end developers.

GraphQL

GraphQL is a query language for using APIs. With advancement in PWA,it is the need of the hour to get smaller amounts of data and to make fewer API requests.GraphQL’s query language makes this possible by allowing the requestor to request a limited subset of attributes to be returned about an entity (significantly smaller responses) and allows you to chain requests (smaller number of requests).

Magento currently supports REST and SOAP API requests that use Service Contracts. However, to support GraphQL,Magento is writing an entirely new layer that interfaces directly to the Query API. The GraphQL implementation will be the underpinnings on how a PWA frontend will retrieve the data it needs.

Declarative Database Schema

Until now the to change the schema of magento database, you can do that using InstallSchema and UpgradeSchema classes where code is written to modify the schema.

Furthermore Magento 2.3 will change the recommended way by implementing a declarative database schema. This technique will try to accomplish multiple goals, some of which were discussed here. Instead of the database schema definitions being fragmented throughout many install and upgrade scripts, it will be fully defined via XML.

Multi-Source Inventory (MSI)

Magento is introducing multi-source inventory management to Magento’s core.This will let merchants to natively manage inventory via multiple sources.This will also enhance the shipping methods like the shipping of items and tracking of stock levels from multiple warehouses,as well as inventory within retail stores to support “ship from store” and “pick up in store”.
Furthermore Magento 2.3 will also include new functionality around the reservation mechanism of inventory. Inventory is now reserved within a new table structure instead of the direct decrementing of stock. This will increase performance and prevent database unnecessary locking during the order.

Asynchronous API

The Asynchronous WebAPI allows a system to execute API calls asynchronously against the Magento REST API.Because of this, integrations don’t have to wait for requests to fully process when making the calls. This improves the performance of integrations that require many API calls, such as a bulk product integration or customer import. A separate status reporting API will be available to check on the progress of the request by ID. This functionality will be available in both Magento Commerce 2.3 and Magento Open Source.

Page Builder

One of the most amazing and waited for feature of magento is Magento’s native CMS.Magento purchased the Blue Foot CMS technology from Gene Commerce and has made that available to its Magento Commerce merchants. Page Builder is a rewrite of Blue Foot CMS using much of the same foundational features and concepts. These features include template creation, drag-and-drop layout management, and a UX that is clean and friendly to use for a non-technical user.
Page Builder will come natively with Magento Commerce 2.3 and will be available for purchase inside the Magento Marketplace for Open Source implementations.

2FA

Magento 2.3 will have enhanced security.To protect against malicious users that have obtained a password,in any way magento is implementing two-factor authentication. This extra layer of security will require a user to prove that they have access by sending a security code to their phone or email.Similar to many web applications as it is already implemented across the globe extensively.

Message Queue

Support for message queuing is being extended from Magento Commerce to Magento Open Source. Message queues enable asynchronous communication between systems.

ElasticSearch

Support for ElasticSearch is being extended from Magento Commerce to Magento Open Source. ElasticSearch, in addition to many other usages, powers Magento’s site search capabilities, including faceted search (filtering by attributes).

PHP 7.2

PHP 7.2 brings new development features, as well as an increase in performance and security.

Libsodium

Because 7.2 is dropping support for mcrypt (PHP’s go to encryption module), the libsodium module will now be used for encryption.

Import/Export Improvements

Through community engineering, many improvements in speed and usability of import/export functionality are being added to the Magento core.

Contact DEG to learn how our customized ecommerce solutions can boost engagement and improve your conversion rate.

Cache Management ACL

Magento is adding fine-grained administration access control around the ability to interact with the system cache. Caching provides a much-needed layer of performance for Magento, and in the wrong hands, performance can dramatically suffer.

Google reCAPTCHA

Magento is switching the technology used for proving that users are humans, not bots, when interacting with a site. Google’s reCAPTCHA tool will now come native.

So after knowing that what will magento 2.3 bring in, it seems really a hard worked and enhanced version.And certainly it will bring more flexibility and versatile features in magento.

Right then this article is purely informational.I hope it will serve its purpose.I am always open to queries and suggestions. Please feel free to drop any.

Author: Qaisar Satti
Category: Magento 2
Last Modified: October 29, 2018


Magento 2 add canonical link

This tutorial is about Magento 2 add canonical link .i.e how to add a canonical link to a page through it’s layout file?. I assume your question is,is it possible?
So the answer is, Yes.It is possible. And in this tutorial i will try to explain it briefly and in a simple way.

Lets suppose you have a custom page and you want to add a canonical link to it in the layout file. Well,in magento 2 we can specify meta data in the head node.Similarly it is possible to add the canonical link in the layout as well.

It is quite doable and in a very easy way.

Just put the below lines of code in your own code.

<head>
      <link rel="canonical" src="pageurl" src_type="url"/>
</head>

Furthermore change the ‘pageurl’ as per your requirements. And place it in custom layout section in admin , if you want the functionality using admin custom layout section.

That’s it from this tutorial. I hope it serves the purpose.
Since these are learning tutorials,please feel free to drop any suggestions or queries in comments section. That will definitely be highly appreciated.

Author: Qaisar Satti
Category: Magento 2
Last Modified: October 22, 2018


Cookie in magento 2

This tutorial is about Use or Set cookie in magento 2. i.e how to set or use cookie in magento 2?. Suppose you want to set a value to the cookie in a phtml file and need to get it’s value in another phtml file.

There are many ways in magento 2.I will try to discuss some in this tutorial.
Certainly magento uses jquery and it is possible to set and get the values using jQuery.

First of all lets have a look at our first setp. i.e

Set the cookies

You can set the cookies using below code:

<script>
    require([
        'jquery',
        'mage/cookies'
    ], function ($) {
       $.cookie('cookie_name', 'value', { path: '/' });//Set the cookies
    });
</script>

Please note that if you want to get the value from another page, notice the path setting { path: ‘/’ }!

Because cookies are only accessible to the specified path and any subpaths.

Similarly to get cookies:

Get Cookies

<script>
    require([
        'jquery',
        'mage/cookies'
    ], function ($) {
        var temp = $.cookie('cookie_name');//Get the cookies
    });
</script>

Similarly another piece of code is as below:

<script>
    require(
        [ 'jquery'],function($){
            //set cookie
            $.cookie('customname', 'customvalue', { expires: 365, path: '/' });

            //get cookie
            getCookieValue(customname)
        });

        function getCookieValue(cookiename) {
                var name = cookiename + "=";
                var cookieSplit = document.cookie.split(';');
                for(var i = 0; i <cookieSplit.length; i++) {
                    var a = cookieSplit[i];
                    while (a.charAt(0)==' ') {
                        a = a.substring(1);
                    }
                    if (a.indexOf(name) == 0) {
                        return a.substring(name.length,a.length);
                    }
                }
                return "";
            }
</script>

Furthermore there are other way too to do so. I am going to discuss them below. Wil try to keep it short and precise.

Create Cookie

Create a test controller to create:

app/code/QaisarSatti/HelloWorld/Controller/Cookie/Addcookie.php

<?php
namespace QaisarSatti\HelloWorld\Controller\Cookie;
class Addcookie extends \Magento\Framework\App\Action\Action
{
const COOKIE_NAME = 'test';
const COOKIE_DURATION = 86400; // lifetime in seconds
/**
* @var \Magento\Framework\Stdlib\CookieManagerInterface
*/

protected $_cookieManager;
/**
* @var \Magento\Framework\Stdlib\Cookie\CookieMetadataFactory
*/

protected $_cookieMetadataFactory;
/**
* @param \Magento\Framework\App\Action\Context $context
* @param \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager
* @param \Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory
*/

public function __construct(
     \Magento\Framework\App\Action\Context $context,
     \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager,
     \Magento\Framework\Stdlib\Cookie\CookieMetadataFactory $cookieMetadataFactory
)
{
     $this->_cookieManager = $cookieManager;
     $this->_cookieMetadataFactory = $cookieMetadataFactory;
     parent::__construct($context);
}
public function execute()
{
     $metadata = $this->_cookieMetadataFactory
         ->createPublicCookieMetadata()
         ->setDuration(self::COOKIE_DURATION);
     $this->_cookieManager->setPublicCookie(
         self::COOKIE_NAME,
         'YOUR COOKIE VALUE',
         $metadata
     );
     echo('Create Cookie');
}
}

Similarly to Read cookie

Read Cookie

Create a Readcookie.php controller to read cookie

app/code/QaisarSatti/HelloWorld/Controller/Cookie

<?php
namespace QaisarSatti\HelloWorld\Controller\Cookie;
class Readcookie extends \Magento\Framework\App\Action\Action
{
/**
* @var \Magento\Framework\Stdlib\CookieManagerInterface
*/

protected $_cookieManager;
/**
* @param \Magento\Framework\App\Action\Context $context
* @param \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager
*/

public function __construct(
     \Magento\Framework\App\Action\Context $context,
     \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager
)
{
     $this->_cookieManager = $cookieManager;
     parent::__construct($context);
}
public function execute()
{
     $cookieValue = $this->_cookieManager->getCookie(\[Name_Space]\[Your_Module]\Controller\Cookie\Addcookie::COOKIE_NAME);
     echo($cookieValue);
}
}

Furthermore Delete Cookie.

Delete Cookie

Create a Deletecookie.php controller to create cookie.

<?php
namespace QaisarSatti\HelloWorld\Controller\Cookie;
class Deletecookie extends \Magento\Framework\App\Action\Action
{
/**
* @var \Magento\Framework\Stdlib\CookieManagerInterface
*/

protected $_cookieManager;
/**
* @param \Magento\Framework\App\Action\Context $context
* @param \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager
*/

public function __construct(
     \Magento\Framework\App\Action\Context $context,
     \Magento\Framework\Stdlib\CookieManagerInterface $cookieManager
)
{
     $this->_cookieManager = $cookieManager;
     parent::__construct($context);
}
public function execute()
{
     $this->_cookieManager->deleteCookie(
         \[Name_Space]\[Your_Module]\Controller\Cookie\Addcookie::COOKIE_NAME
     );
     echo('DELETED');
}
}

Hence above mentioned steps are the shortest process for you to Use Cookie in Magento 2. I have tried to provide you the code with simple logic.

That’s it from this tutorial. I hope it serves the purpose.

Since these are learning tutorials,please feel free to drop any suggestions or queries in comments section. That will definitely be highly appreciated.

Author: Qaisar Satti
Category: Magento 2
Last Modified: October 22, 2018


Magento 2 shipping extensions

Today we will discuss about Free magento 2 shipping extensions.In this tutorial we will discuss available free magento 2 shipping extensions.This tutorial just have information of free extensions that are available on magento marketplace or any other extension provider.I have tried to list a few.So let’s start with our list.

Free magento 2 Shipping extensions

Magento provides its own shipping methods.Yet here we will discuss free magento shipping extensions.Because these are available for free so anyone can use them.Lets have a look.

Shipping Flat Rate5

This is an upgraded extension that allows the merchant to offer a single flat rate shipping option to their Magento store by serving multiple flat rate methods based on different prices and conditions. This extension overcomes the limitation of having only one flat rate shipping method available in Magento.

Key features:

  • Complete backend configuration
  • Create 5 flat rate shipping methods with different prices and conditions
  • Magento Multi-Store full support and Multiple Currencies as well
  • Select admin section of shipping methods
  • Shipping methods a enable/disable setting
  • Set minimum/maximum order amount for free shipping feature
  • Flat rate shipping methods in fixed manner
  • Dispaly diferent error message for specific shipping method.

Extension Link

ShipRocket

It is a unique E-commerce Shipping Solution which gives access to multiple courier partners on a single platform. With Shiprocket, merchants can automate their shipping seamlessly without any technical know how.
Shiprcoket offers four plans:

  • Lite
  • Basic
  • Advanced
  • Pro

Key features:

  • Automatic Order Sync
  • Automatic shipping status sync
  • Catalog and Inventory sync

Extension Link

MatrixRate Table Rate Shipping

The MatrixRate shipping extension enables you to offer multiple shipping options to customers based on their location.

Key features:

  • The most popular multiple table rates extension for Magento
  • Display multiple delivery methods
  • Customize shipping rates based on destination
  • Customize shipping rates based on cart weight, subtotal or quantity
  • Pattern-based zipcode filtering to determine shipping charges
  • Supports zipcode numerical ranges (e.g. 5000-6000)
  • Proven success across the world – used widely in the UK, Europe, US and Australia
  • Excellent documentation, including walkthrough examples

Extension Link

bpost Shipping Manager

This module implements 5 new shipping methods in Magento. The merchant can create bpost shipping and return labels in the administration panel of Magento. These labels can be generated in bulk or for each order separately.The tracking numbers are automatically filled in.

Key features:

  • Receive your parcel at home or at the office (national or international)
  • Over 1.250 locations (pick-up points) nearby home or the office
  • Pick-up your parcel whenever you want, thanks to the 24/7 service of bpost (parcel locker)
  • Pick-up your parcel on your own shops thanks to Click&Collect delivery method

Extension Link

Shipping Easy

Your orders will automatically download from Magento to ShippingEasy, where powerful automation streamlines carrier/service selection and printing of shipping labels, packing slips, and pick lists, with carrier and tracking information automatically sent back to Magento. Includes full support for leading carriers: USPS, UPS, FedEx, and DHL.

Key features:

  • Savings add up quickly using ShippingEasy
  • Save time on multichannel order fulfillment
  • Streamline inventory processes with Inventory Management
  • Increase sales with Customer Marketing
  • A powerful enterprise platform for high-volume shippers

Extension Link

Advanced Shipping

With Advanced Shipping, you can set shipping fees by using almost all the variables available, such as destination, weight, price, quantity, categories, product attributes, item options, the customer group, customer attributes, coupon codes, Magento custom variables, date, etc.

Key features:

  • Manage one shipping mode or carrier
  • Several conditional shipping methods
  • Shipping fees based on destination, weight, price, quantity
  • Shipping fees based on the customer group or customer attribute
  • Shipping fees based on categories, product attributes or item options
  • Shipping fees based on custom variables, the coupon code, the date
  • Shipping fees based on formulas combining all the variables you need
  • Filtering zip codes with regular expressions
  • Extension used in many countries in the world
  • Documentation in english

Extension Link

Similarly there are many other extensions available. I tried to list a few. I hope this tutorial help you in any way.

Please feel free to drop any suggestions or queries in comments section. It will be highly appreciated.

Author: Qaisar Satti
Category: Magento 2
Last Modified: October 22, 2018


Magento 2 add custom block below shipping method

Hello, this tutorial is about Magento 2 add custom block below shipping method.First of all i assume that you are an advance learner of magento 2.Hence you are here to learn how to add custom block below shipping method in one page check out in magento 2.Above all if you are not familiar with magento 2 please start from basics.

lets start our tutorial and focus on our topic. For example if you want to add custom block below shipping methods. And aslo this custom block should be inside of shipping method form. In this tutorial i will discuss in detail how we can do it. It is a four to five step method.And i would try to explain it in a simple way. So that you can do it efficiently.

The first step is to Declare module’s checkout dependency.

Declare module’s checkout dependency

First of all find the directory to your module file

app/code/QaisarSatti/HelloWorld/etc/module.xml

and paste the below code

<?xml version="1.0"?>

<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Module/etc/module.xsd">
    <module name="QaisarSatti_HelloWorld" setup_version="0.0.1" active="true">
        <sequence>
            <module name="Magento_Checkout"/>
        </sequence>
    </module>
</config>

Now we will move to the second step which is to Overwrite checkout layout.

Overwrite checkout layout

In the

app/code/QaisarSatti/HelloWorld/view/frontend/layout/checkout_index_index.xml

directory, paste the below code:

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceBlock name="checkout.root">
            <arguments>
                <argument name="jsLayout" xsi:type="array">
                    <item name="components" xsi:type="array">
                        <item name="checkout" xsi:type="array">
                            <item name="children" xsi:type="array">
                                <item name="steps" xsi:type="array">
                                    <item name="children" xsi:type="array">
                                        <item name="shipping-step" xsi:type="array">
                                            <item name="children" xsi:type="array">
                                                <item name="shippingAddress" xsi:type="array">
                                                    <item name="children" xsi:type="array">
                                                        <item name="shippingAdditional" xsi:type="array">
                                                            <item name="component" xsi:type="string">uiComponent</item>
                                                            <item name="displayArea" xsi:type="string">shippingAdditional</item>
                                                            <item name="children" xsi:type="array">
                                                                <item name="additional_block" xsi:type="array">
                                                                    <item name="component" xsi:type="string">QaisarSatti_HelloWorld/js/view/checkout/shipping/additional-block</item>
                                                                </item>
                                                            </item>
                                                        </item>
                                                    </item>
                                                </item>
                                            </item>
                                        </item>
                                    </item>
                                </item>
                            </item>
                        </item>
                    </item>
                </argument>
            </arguments>
        </referenceBlock>
    </body>
</page>

similarly the the third step is to Create JavaScript UI Component.

Create JavaScript UI Component

For your information JavaScript (with Knockout)manages checkout in Magento 2 .So for that you need to create a custom JS compnent. It will create the link between checkout UI component and your custom HTML template.

in the

app/code/QaisarSatti/HelloWorld/view/frontend/web/js/view/checkout/shipping/additional-block.js

directory, paste the below code

define([
    'uiComponent'

], function (Component) {
    'use strict';

    return Component.extend({
        defaults: {
            template: 'QaisarSatti_HelloWorld/checkout/shipping/additional-block'
        }
    });
});

Similarly we will move to the fourth step which is to Create HTML template.

Create HTML template

Now create the HTML template wich going to be displayed in checkout.
In the

app/code/QaisarSatti/HelloWorld/view/frontend/web/template/checkout/shipping/additional-block.html

directory,use below code

<div class="checkout-block" id="block-custom">
    <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</p>
    <p>Cum sociis natoque penatibus et magnis dis parturient montes.</p>
</div>

Now the fifth and final step is to clear cache.

clear cache

Finally run following commands to clear cache:

php bin/magento cache:clean
php bin/magento setup:upgrade
chmod -R 777 var/*

That’s it in this tutorial. Certainly, i have tried to explain these codes and their logic in a simple way, i hope they help you learn in an easy and better way.

Since these tutorials are for learning purpose please feel free to drop any suggestions or queries in comments section. That will definitely be highly appreciated.

Author: Qaisar Satti
Category: Magento 2
Last Modified: October 12, 2018


Magento 2 Get base url in js

This tutorial is about magento 2 Get base url in js file. First of all i assume that you are familiar with magento 2 and hence you are at this level where you want to know how to get base url from js file in magento 2. Above all if you are not familiar with advance magento concepts and are looking for basics,please look for magento 2 basic tutorials.

So lets start our tutorial and focus on our topic. For example if you want to get base url from .js file and append it with your module controller link from. How can we do it? It is almost impossible to use block to get the base url.

Get base url

So we will look at the way how we can get base url. to do that,paste the following code in your routes.xml file

define([

   'mage/url'
], function (url) {

  var linkUrl = url.build('test/test/test');
  console.log(linkUrl);
});

Where frontname is your routes.xml file frontname.

Since it is necessary,you have to pass your frontname from routes.xml file instead of module name(namespace_module).

Furthermore you can lookup your routes.xml file from

app/code/QaisarSatti/HelloWorld/etc/frontend/routes.xml

It might work for some and might not for others.

Further more Add this code in phtml file:

<input type="hidden" value="<?php echo $this->getUrl(); ?>" id="baseUrl"/>

having done that you can use this base url in js file by id :

$("#baseUrl").val();

It is a quite useful and tested trick. So i thought to share it.

There is another approach for this task.Having said that it may too be useful.

You should pass url to js(widget).Url is a parameter of js widget.And put script below to your template where you want to.

<script type="text/x-magento-init">
{
    "*": {
        "Magento_Ui/js/core/app": {
            "components": {
                "yourWidget": {
                    "dataUrl": "<?php echo $block->getBaseUrl(); ?>"
                }
            }
        }
    }
}
</script>

Similarly in javascript widget, you can access to dataUrl by below code.

define(['uiComponent'], function(Component) {
    'use strict';

    return Component.extend({
        initialize: function() {
            console.log(this.dataUrl);
        }
    });
});

Another simple approach is

<script>
window.testUrl = <?php echo json_encode($block->getBaseUrl()); ?>
</script>

Using your custom js you can have easy access to window.testUrl global variable.

That’s it from this tutorial. I hope it serves the purpose.

Since these tutorials are for learning purpose please feel free to drop any suggestions or queries in comments section. That will definitely be highly appreciated.

Author: Qaisar Satti
Category: Magento 2
Last Modified: October 12, 2018


Use Country based region selection in admin form Magento 2

In this tutorial we will learn about a default functionality of magento,Use Country based region selection in admin form Magento 2 . This is a built in function of magento. Magento provides this default functionality in the admin panel ui-component.Suppose you want to add country and region fields in your custom module in admin section.Now we know what you want to do, so lets shift our focus to the method and code which will help us to accomplish our task.

Lets have a look at the code part.

Country based region selection magento

Below code will use this default magneto functionality in your admin panel ui component form.

<field name="country_id">
    <argument name="data" xsi:type="array">
        <item name="options" xsi:type="object">Magento\Directory\Model\Config\Source\Country</item>
        <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">text</item>
            <item name="label" xsi:type="string" translate="true">Country</item>
            <item name="formElement" xsi:type="string">select</item>
            <item name="source" xsi:type="string">store</item>
            <item name="component" xsi:type="string">Magento_Ui/js/form/element/country</item>
            <item name="validation" xsi:type="array">
                <item name="required-entry" xsi:type="boolean">true</item>
            </item>
        </item>
    </argument>
</field>
<field name="region">
    <argument name="data" xsi:type="array">
        <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">text</item>
            <item name="label" xsi:type="string" translate="true">State/Region</item>
            <item name="formElement" xsi:type="string">input</item>
            <item name="source" xsi:type="string">store</item>
            <item name="sortOrder" xsi:type="number">15</item>
            <item name="visible" xsi:type="boolean">false</item>
        </item>
    </argument>
</field>
<field name="region_id">
    <argument name="data" xsi:type="array">
        <item name="options" xsi:type="object">Magento\Directory\Model\ResourceModel\Region\Collection</item>
        <item name="config" xsi:type="array">
            <item name="dataType" xsi:type="string">text</item>
            <item name="label" xsi:type="string" translate="true">State/Region</item>
            <item name="formElement" xsi:type="string">select</item>
            <item name="source" xsi:type="string">store</item>
            <item name="sortOrder" xsi:type="number">20</item>
            <item name="customEntry" xsi:type="string">region</item>
            <item name="validation" xsi:type="array">
                <item name="required-entry" xsi:type="boolean">true</item>
            </item>
            <item name="filterBy" xsi:type="array">
                <item name="target" xsi:type="string">${ $.provider }:${ $.parentScope }.country_id</item>
                <item name="field" xsi:type="string">country_id</item>
            </item>
        </item>
    </argument>
</field>

So you can populate the country field values, and by selecting country you can also get the regions by using above code.

That’s it from this tutorial,i have tried to explain this magento functionality in a simplest and easiest way.Therefore i hope this will help you in a better way.

Since these tutorials are for learning purpose please feel free to drop any suggestions or queries in comments section. That will definitely be highly appreciated.

Author: Qaisar Satti
Category: Magento 2
Last Modified: October 12, 2018


Pages:1234567...18