Hot answers tagged

5 votes

How to disable Zip/Postal Code validation Notice Magento 2

Further to the answer by @Trabbie, there is a way to have a local override. The details are on the official docs but in a nutshell, create a custom extension, with a file etc/zip_codes.xml (in fact ...
airdrumz's user avatar
  • 193
5 votes

how do disable/remove Zip Code for specific country in magento 2

If you want to remove the Zip Code based on country selection, then firstly you can make zip code optional for this country from backend (i.e UAE), from store > config > general > Zip/Postal ...
Keyur Shah's user avatar
4 votes
Accepted

Restrict customer in checkout if zip codes are not from predefined zip code list

You can go with re-write of the core Shipping model. Inside your extension config, create a re-write of that model, and in your extended model file, the content will go something like this : <?php ...
Prateek's user avatar
  • 1,949
4 votes
Accepted

region/state code in tablerate.csv file in magento 2

You can get the state/region code from directory_country_region table in database.
Nitin Pawar's user avatar
  • 1,546
4 votes

How to disable Zip/Postal Code validation Notice Magento 2

This gave a bit of a headache but I have found the solution for this. The solution does not cover how to attach or disable warning messages to input fields but answers the question. Context: Every ...
vitoriodachef's user avatar
4 votes
Accepted

Magento2 - Make zipcode requried for all countries

You can unselect it. For that first select any single country option there and then click on that option with CTRL key, after that you can save configuration and clear/flush cache using below commands ...
Kishan Savaliya's user avatar
3 votes
Accepted

How to remove exception message automatically after it appears from magento site(Updated)

You can use setTimeOut jQuery function to hide the message after it appears to users. jQuery(document).ready(function(){ jQuery('.btn-cart, #zip-check').click(function(){ setTimeout(...
Jaimin Sutariya's user avatar
2 votes
Accepted

display shipping charges according to zip code in product view page

It seems you want to calculate shipping cost for individual product and not on for whole cart total. In that case you follow below code to calculate shipping cost per product: <?php class ...
Akshay Jindal's user avatar
2 votes
Accepted

Store zip codes in backend instead of file

The question you should be asking is how to create an extension that allows you save and maintain a list of zipcodes via the admin panel. Once you accomplish this, you can retrieve data from the DB ...
laketuna's user avatar
  • 6,830
2 votes
Accepted

Dispaly different kind of delivery messages in view page

In your checkdelivery/index/index action use below code public function indexAction() { $zip = $this->getRequest()->getParam('zipcode'); $pincodearray = array(); $pindata = Mage::...
Prashant Valanda's user avatar
2 votes
Accepted

Display the shipping charges without clicking on "check" button

I reckon you should be able to do it by doing the following after the estimateProductShipping() JS function declaration (after the last </script> tag): <?php if ($this->htmlEscape($this-&...
Raphael at Digital Pianism's user avatar
2 votes

get the zip code along with messsage

that will show the input too <?php echo "Available with 14 sellers ".$this->getRequest()->getParam('id'); ?>
Qaisar Satti's user avatar
  • 32.5k
2 votes

Want to make zipcode text field as a "required" field on my product page of magento site

add this in your class required-entry <input type="text" class="product-custom-option required-entry" placeholder="Enter your pincode" value="" name="cod" id="cod" size="29" style='color:black; ...
Priyank's user avatar
  • 7,662
2 votes

How to disable Zip/Postal Code validation Notice Magento 2

Just found a solution to this. You can find the zip_codes.xml in <root>vendor/magento/module-directory/etc/zip_code.xml The Dutch postal code is defined like this (somewhere around line 319); &...
Trabbie's user avatar
  • 29
2 votes

How to disable Zip/Postal Code validation Notice Magento 2

You can disable specific zip code input mask by set "active" attribute of to false. In this specific scenario you can use following code to disable 'NL' input mask. <zip countryCode="NL"> ...
Duleep Thivanka's user avatar
2 votes

Remember zip code after we visit other Product page

You can save your zip code for user's session in your controller checkdelivery/index/index. It will look like this: Mage::getSingleton('customer/session')->setData('custom_zip_code', $this->...
Mageworx's user avatar
  • 3,786
2 votes

How to disable Zip/Postal Code validation Notice Magento 2

Step-1: Go to Admin-> Store –> Configuration –> General –> Country Options here you will find an option of “Zip/Postal Code is Optional for”. Step-2: I achieved this through css popped in ...
Jaimie Dijstra's user avatar
2 votes
Accepted

Zip code validation in magento 2

To add validation on the zip field we should overwirte Magento_Checkout/layout/checkout_index_index.xml and add this code : <item name="validation" xsi:type="array"> <item name="zip-...
Alin Lupoiu's user avatar
  • 2,662
2 votes

Shipping method based on ZipCodes In Magento 2

You can set shipping method based on Zip/Post code by Magento-2 default table rates shipping method. You can add you Zip/Postal code which you want to apply shipping rates, shipping rates apply ...
Suresh Chikani's user avatar
2 votes

how do disable/remove Zip Code for specific country in magento 2

I have disabled the field by using jquery first I made "zip code" field optional from admin for UAE. then added a js file in theme Magento_Theme/layout/default_head_blocks.xml <link src="js/...
Waqar's user avatar
  • 974
2 votes
Accepted

How can I update shipping methods on checkout with changes in zipcode input?

I fix that editing this function on shipping.js: checkoutProvider.on('shippingAddress', function (shippingAddressData) { /* Custom code to update shipping rates ...
Plim's user avatar
  • 133
2 votes
Accepted

Magento 2.3 - How to verify US zip code with region in checkout and my account address

You have put the postcode/Region checking at \Magento\Quote\Model\ShippingMethodManagement::estimateByExtendedAddress \Magento\Quote\Model\ShippingMethodManagement::estimateByAddressId because ...
Amit Bera's user avatar
  • 77.3k
2 votes
Accepted

Default zip code for shipping address

Create file in module app\code\Ketan\Module\etc\di.xml <?xml version="1.0"?> <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:...
Ketan Borada's user avatar
  • 2,593
1 vote

Magento 1.9 COD custom maximum order value & minimum order value limit set

Changes: Instead of taken quote from session Mage::getSingleton('checkout/cart')->getQuote(),You cen get Qoute from event $quote = $observer->getEvent()->getQuote(); validate the max and ...
Amit Bera's user avatar
  • 77.3k
1 vote
Accepted

How to disabled ADD TO CART button when user had not checked the zipcode

I think there is a simple solution you can disable add to cart button by default. If some one check valid zipcode then only he/she can able to do add to cart for this you can add below code in cod....
Murtuza Zabuawala's user avatar
1 vote
Accepted

Zip code to order grid backend

Add below code in collection of app/code/local/Atwix/ExtendedGrid/Model/Observer.php: $collection = $observer->getOrderGridCollection(); $select = $collection->getSelect(); $...
Prashant Valanda's user avatar
1 vote
Accepted

get the zip code along with messsage

try this but not sure in file result.phtml <p><?php echo "Available with 14 sellers";?> <?php $addressInfo = $this->getRequest()->getPost('estimate',array()); ?> <?php if(...
Abdul's user avatar
  • 9,702
1 vote

How to disable Zip/Postal Code validation Notice Magento 2

You could consider replacing the functionality with a script that validates international postal codes on entry? I'm actually working on an extension for Magento that uses auto-suggest to speed up ...
HenrikV's user avatar
  • 111
1 vote
Accepted

Want to make zipcode text field as a "required" field on my product page of magento site

For that you have to check condition is zipcode is checked or not. File : app/design/frontend/(your_package_name)/(your_theme_name)/template/catalog/product/ view.phtml <script type="text/...
Gopal Patel's user avatar
  • 3,129
1 vote
Accepted

Validation required for zip codes less than 6 digits

Try this code in Observer.php <?php class Mfp_Cod_Model_Observer { public function getCashOnDelvery(Varien_Event_Observer $observer) { $event = $observer->getEvent(); ...
Abdul's user avatar
  • 9,702

Only top scored, non community-wiki answers of a minimum length are eligible