File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change 472472 const mailLines = getMailLinesNl ( values ) ;
473473 storedAddress . set ( values , mailLines ) ;
474474
475- if ( addressType === 'billing' && ! window . checkout . ship_to_different_address . checked )
475+ if ( addressType === 'billing' && isUseBillingAsShipping ( ) )
476476 {
477477 // Also set shipping to avoid redundant validation at next pageview.
478478 storedAddresses . shipping . set ( values , mailLines ) ;
655655
656656 storedAddress . set ( values , result . mailLines ) ;
657657
658- if ( addressType === 'billing' && ! window . checkout . ship_to_different_address . checked )
658+ if ( addressType === 'billing' && isUseBillingAsShipping ( ) )
659659 {
660660 storedAddresses . shipping . set ( values , result . mailLines ) ;
661661 }
904904 formRow . append ( wrapper ) ;
905905 } ;
906906
907- // Search PostcodeNlAddressFieldMapping.mapping for given value and
908- // return the first corresponding key if successful. Otherwise returns null.
909- const findFieldMapping = ( value ) => {
910- for ( let key in PostcodeNlAddressFieldMapping . mapping )
907+ const isUseBillingAsShipping = function ( )
908+ {
909+ if ( typeof window . checkout . ship_to_different_address === 'undefined' )
911910 {
912- if ( PostcodeNlAddressFieldMapping . mapping [ key ] === value )
913- {
914- return key ;
915- }
911+ // Return false because there's no shipping form in this case.
912+ return false ;
916913 }
917914
918- return null ;
915+ return ! window . checkout . ship_to_different_address . checked ;
919916 } ;
920917
921918 class StoredAddress {
You can’t perform that action at this time.
0 commit comments