Get Country name from Country id Magento 2.

Retrieve Country full name from Country Id Using Magento 2 by Country Class of Directory Module.

You need to instantiate CountryFactory in your class __construct() method to get the country full name.

The class responsible to get name is Magento\Directory\Model\Country. Continue reading “Get Country name from Country id Magento 2.”

How to add column in sales_order table using db_schema.xml Magento 2?

You can add a new column in sales_order table using db_schema.xml under your module etc folder from Magento 2.3 and Upper version.

We try to add a new column called order_country in sales_order table.

To add order_country field in sales_order table, you need to only add one row inside the db_schema.xml file structure.

Here, the Main table for Sales Operation is sales_order and you can add a new field in sales_order table by the below way, Continue reading “How to add column in sales_order table using db_schema.xml Magento 2?”

Payment list template Override using mixins.js in Magento 2.

What is Mixins?

  • Mixin is alternative to inheritance, without override entire base file, You can add new methods or change/modify the current method output in mixins file.
  • Mixins is a class that contains methods for use by other classes without having to be the parent class of those other classes.
  • Class Methods are added to or mixed in with parent class methods.

Continue reading “Payment list template Override using mixins.js in Magento 2.”