Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
iljamobilemojo committed Oct 5, 2022
2 parents ae0232e + 06c338e commit 967e3f6
Show file tree
Hide file tree
Showing 7 changed files with 44 additions and 23 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "endereco/endereco-shopware6-client",
"description": "Checks customers' addresses in real time. In case of errors, the customer is prompted to correct his address before sending via warning windows and error messages.",
"version": "1.0.7",
"version": "1.1.0",
"type": "shopware-platform-plugin",
"license": "AGPL-3.0-or-later",
"authors": [
Expand Down
2 changes: 1 addition & 1 deletion src/EnderecoShopware6Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
use Shopware\Core\Framework\Plugin\Context\UninstallContext;
use Shopware\Core\Framework\Plugin\Context\InstallContext;
use Shopware\Core\Framework\Plugin\Context\UpdateContext;
use Shopware\Core\Framework\Log\LoggerFactory;

class EnderecoShopware6Client extends Plugin
{

Expand Down
12 changes: 12 additions & 0 deletions src/Resources/config/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,20 @@
<label>Check API connection</label>
<label lang="de-DE">API Verbindung prüfen</label>
</component>
</card>

<card>
<title>Sales-Channel Settings</title>
<title lang="de-DE">Verkaufskanaleinstellungen</title>

<input-field type="bool">
<name>enderecoActiveInThisChannel</name>
<label>Active</label>
<label lang="de-DE">Aktiv</label>
<defaultValue>true</defaultValue>
<helpText>If this toggle is set to active, then the plugin will be activated in this sales channel.</helpText>
<helpText lang="de-DE">Mit dieser Einstellung kann man das Plugin in bestimmten Verkaufkanälen deaktivieren.</helpText>
</input-field>
</card>

<card>
Expand Down
14 changes: 8 additions & 6 deletions src/Resources/views/storefront/base.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

{% block base_body_script %}
{{ parent() }}
<script
defer
async
src="{{ asset('bundles/enderecoshopware6client/endereco.min.js') }}?var={{ page.endereco_config.enderecoVersion }}"
onload="if(typeof enderecoLoadAMSConfig === 'function'){enderecoLoadAMSConfig();}"
></script>
{% if page.endereco_config.pluginActive %}
<script
defer
async
src="{{ asset('bundles/enderecoshopware6client/endereco.min.js') }}?var={{ page.endereco_config.enderecoVersion }}"
onload="if(typeof enderecoLoadAMSConfig === 'function'){enderecoLoadAMSConfig();}"
></script>
{% endif %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,21 @@

{% block component_address_form_address_fields %}
{{ parent() }}
<input
type="hidden"
name="endereco_data_marker" value="ams"
data-container-selector = "form"
data-container-type = "form"
data-used-prefix = "{{ prefix }}"
data-has-object = "no"
data-name = ""
data-type = ""
data-country-code-selector = "{{ prefix }}[countryId]"
data-subdivision-code-selector = "{{ prefix }}[countryStateId]"
data-postal-code-selector = "{{ prefix }}[zipcode]"
data-locality-selector = "{{ prefix }}[city]"
data-street-full-selector = "{{ prefix }}[street]"
>
{% if page.endereco_config.pluginActive %}
<input
type="hidden"
name="endereco_data_marker" value="ams"
data-container-selector = "form"
data-container-type = "form"
data-used-prefix = "{{ prefix }}"
data-has-object = "no"
data-name = ""
data-type = ""
data-country-code-selector = "{{ prefix }}[countryId]"
data-subdivision-code-selector = "{{ prefix }}[countryStateId]"
data-postal-code-selector = "{{ prefix }}[zipcode]"
data-locality-selector = "{{ prefix }}[city]"
data-street-full-selector = "{{ prefix }}[street]"
>
{% endif %}
{% endblock %}
3 changes: 3 additions & 0 deletions src/Resources/views/storefront/layout/meta.html.twig
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{% sw_extends '@Storefront/storefront/layout/meta.html.twig' %}

{% block layout_head_meta_tags %}
{% if page.endereco_config.pluginActive %}
<script>
if (undefined === window.EnderecoIntegrator) {
window.EnderecoIntegrator = {};
Expand Down Expand Up @@ -224,5 +225,7 @@
}, 1);
}
</script>
{% endif %}

{{ parent() }}
{% endblock %}
2 changes: 2 additions & 0 deletions src/Service/AddDataToPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public function addEnderecoConfigToPage(GenericPageLoadedEvent $event): void
$configContainer->enderecoAllowCloseIcon = $this->systemConfigService->get('EnderecoShopware6Client.config.enderecoAllowCloseIcon', $salesChannelId);
$configContainer->enderecoConfirmWithCheckbox = $this->systemConfigService->get('EnderecoShopware6Client.config.enderecoConfirmWithCheckbox', $salesChannelId);

$configContainer->pluginActive = $this->systemConfigService->get('EnderecoShopware6Client.config.enderecoActiveInThisChannel', $salesChannelId);

$countries = $this->countryRepository->search(new Criteria(), $context);

$mapping = [];
Expand Down

0 comments on commit 967e3f6

Please sign in to comment.