Magento 2 Upgrade Error SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘magento2.email_abandoned_cart’ doesn’t exist.

When you upgrade Magento version 2.2.2 to 2.3.3, once upgrade is finish and you are trying to run the setup upgrade command, You faced the error at a time of upgrade command,

Upgrading schema.. SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘mage222ce.email_abandoned_cart’ doesn’t exist, query was: DESCRIBE `email_abandoned_cart`

Continue reading “Magento 2 Upgrade Error SQLSTATE[42S02]: Base table or view not found: 1146 Table ‘magento2.email_abandoned_cart’ doesn’t exist.”

Get Country name by 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 by 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?”