Magento2: Zip / postcode has a default value of * in the checkout

Created on 12 Jan 2017  路  14Comments  路  Source: magento/magento2

Preconditions


+------------------+-----------------------------------------------------+
| name             | value                                               |
+------------------+-----------------------------------------------------+
| Name             | Magento                                             |
| Version          | 2.1.3                                               |
| Edition          | Community                                           |
| Application Mode | production                                          |
| Session          | files                                               |
| Cache Backend    | Cm_Cache_Backend_Redis                              |
| Vendors          | Magento, Amasty, Elephant, Adyen, Nostress, Wyomind |
+------------------+-----------------------------------------------------+

PHP 7.0.14-2
MySQL 5.6.33

Steps to reproduce

  1. Clear all relevant browser data to be sure you're in a clean browser.
  2. Add a product to the cart on goosecraft.com.
  3. Go to the checkout
  4. The zip / postcode is pre-filled with a *, causing it to validate straight away.

Steps I've done to find out more

I have checked Magento_Ui/view/base/web/js/form/element/abstract.js and when I log initConfig(), I get the validate observer that show me a _latestValue of "*". It's very weird, there is no setting that leads to this.

Expected result

  1. The _latestValue should never have a value of *.

Actual result

  1. The _latestValue has a value of * causing it to validate:

wrong_latestvalue

Checkout Cannot Reproduce Clear Description Format is valid needs update bug report

Most helpful comment

@TommyKolkman asterisk is pulled from Tax configuration, just remove "*" default value:

asterik

All 14 comments

Might be related: #7724

Hi @TommyKolkman, I cannot reproduce issue
Can you reproduce it on fresh magento without any custom theme or modules ?

I am having same issue on 2.1.3
Any idea how to remove that?

Also same issue here.

Simple to fix it is using jQuery:
====> Fix checkout
$('.checkout-cart-index .action.primary.checkout').hover(function(){
if($('input[name="postcode"]').val() == '*'){
$('input[name="postcode"]').val('').change();
}

});

===> Fix cart
$('.checkout-cart-index #block-shipping .title').click(function(){
if($('input[name="postcode"]').val() == '*'){
$('input[name="postcode"]').val('').change();
}
});
It worked for me.

@KrystynaKabannyk can you check if this is a known issue in checkout?

It would be great if we just need a control to turn it on or off in the configuration (maybe even per store/website)? some of us may need it if we have no Post Code (ZIP) in our country?

@TommyKolkman , Hi, i try to reproduce your bug and it unsuccessfully.
I try on clean magento 2.1.3 in production mode with different locales and local packages.
Maybe you forgot some specific settings for reproduce this issue ??? Thank you.

@TommyKolkman asterisk is pulled from Tax configuration, just remove "*" default value:

asterik

@TommyKolkman, thank you for your report.
We were not able to reproduce this issue by following the steps you provided. If you'd like to update it, please reopen the issue.

This also happens when tax/defaults/postcode in core_config_data has a NULL value.

This is still happening on 2.2.5. Gentlemen you are awfully trigger happy with cannot reproduce buttons. Im interested in which version of 2.2.x did you fix this by referencing this https://github.com/magento/magento2/issues/7724 and the 2.2.5 version I can't really see that fix. Thank you very much!

Can also reproduce..

Still exists in 2.3.0. Just have to set a postcode in "Default Tax Destination Calculation"

Which is set here:
http://Base_url/admin/admin/system_config/edit/section/tax/
postcode set here

Use Xdebug in any active shipping module on calling RateRequest->getDestPostcode(). We observe that:

Magento\Quote\Model\Quote\Address\RateRequest->$_data['dest_postcode'] = Default Tax Destination Calculation
Was this page helpful?
0 / 5 - 0 ratings