Use of sales_quote_address_collect_totals_before events Magento 2.

You can use sales_quote_address_collect_totals_before event for setting your custom totals related data before Magento collect final totals for a quoted address.

By Use of address collect totals before event inside observer, You can fetch specific quote data, shipping_assignment and total related data for a cart. Continue reading “Use of sales_quote_address_collect_totals_before events Magento 2.”

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?”

Rename a tablename using db_schema(Declarative schema) in Magento 2.

In Magento 2, You can create a new table using db_schema.xml file. After creating a table you want to rename a table name, You can rename a table using declarative schema.

New Table(mycustom_table) db_schema.xml file,

Now you must have to run generate-whitelist command to generate db_schema_whitelist.json file, Continue reading “Rename a tablename using db_schema(Declarative schema) in Magento 2.”