How to add new field in customer_entity table magento 2 using db_schema.xml?

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

You just need your table name to add a new field or column for that table.

I have added a new field called Nickname of the customer, For add nickname field in the customer table, you need to only add one row inside the db_schema.xml file. Continue reading “How to add new field in customer_entity table magento 2 using db_schema.xml?”

How to ignore address validation error in Magento 2?

You can ignore address validation for shipping and billing address when you create address programmatically or sometimes you don’t need to worry about validation for billing or shipping address.

Make sure addresses will be saved without validation errors, You need to use setShouldIgnoreValidation(true) function on quote object. Continue reading “How to ignore address validation error in Magento 2?”

Customer Logged in Programmatically using Magento 2.

You can do customer logged in Programmatically using Magento 2.

You required only Customer id to logged-in customer programmatically without going to the login page.

You need to first get Customer object using CustomerRepositoryInterface interface. Use Customer Object to customer session with setCustomerDataAsLoggedIn function. Continue reading “Customer Logged in Programmatically using Magento 2.”