Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Helper/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Config extends AbstractHelper
*/
public function isEnabled(): bool
{
return (bool)$this->scopeConfig->getValue(self::ADDRESS_SEARCH_API_ENABLED_CONFIG_PATH, ScopeInterface::SCOPE_STORE);
return $this->scopeConfig->isSetFlag(self::ADDRESS_SEARCH_API_ENABLED_CONFIG_PATH, ScopeInterface::SCOPE_STORE);
}

/**
Expand Down
1 change: 1 addition & 0 deletions i18n/pt_BR.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
"I dont know my postcode","Eu não sei meu CEP"
2 changes: 0 additions & 2 deletions view/adminhtml/web/css/source/_module.less
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,3 @@
}
}
}


2 changes: 1 addition & 1 deletion view/frontend/layout/default.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="content">
<block class="Magento\Framework\View\Element\Template" name="postcode.regions.json" template="TheITNerd_Core::checkout/regionJson.phtml" >
<block ifconfig="address_search/api/enabled" class="Magento\Framework\View\Element\Template" name="postcode.regions.json" template="TheITNerd_Core::checkout/regionJson.phtml" >
<arguments>
<argument name="region_provider" xsi:type="object">Magento\Customer\ViewModel\Address\RegionProvider</argument>
</arguments>
Expand Down
12 changes: 8 additions & 4 deletions view/frontend/web/js/postcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,14 @@ define([
},

_create: function() {
this.initOptions()
.initMask()
.createPostcodeSearchLink()
.bindEvents();
if (!this.options.isAddressSearchEnabled) {
this.initMask();
} else {
this.initOptions()
.initMask()
.createPostcodeSearchLink()
.bindEvents();
}
},

bindEvents: function() {
Expand Down