Today we are going to talk about how to remove the postcode field in checkout in Magento 2?
The field is dynamically created from EAV attributes on the LayoutProcessor class.
All we need to do is to set is_user_defined to 1 for the postcode eav_attribute. I recommend doing this via a setup resource, like this:
1 2 3 4 5 6 7 8 9 10 11 12 |
public function install(ModuleDataSetupInterface $setup, ModuleContextInterface $context) { /** @var \Magento\Customer\Setup\CustomerSetupFactory $customerSetup */ $customerSetup = $this->customerSetupFactory->create(['setup' => $setup]); $setup->startSetup(); $attribute = $customerSetup->getEavConfig()->getAttribute('customer_address', 'postcode'); $attribute->setIsUserDefined(1)->save(); $attribute->save(); } |
also, we need to remove validation for that, so we can direct set 0 to DB in eav_attribute table
that’s it.
If you want get query string params in controller file,...
Create di.xml and add the below code Magemonkey/Redirect/etc/frontend/di.xml [crayon-62845c3848797373359036/] Create...
You can try below code to change local date to...
Step 1: First you need to add registration.php file in...
Step1 : Override message.js in current theme file on the...