From 89ab0fa1b32a4e3dafadfc5394de65dd42fed8c0 Mon Sep 17 00:00:00 2001 From: Stefan Hagspiel Date: Wed, 16 Dec 2020 13:59:00 +0100 Subject: [PATCH 1/2] fix addressAccessType check and improve view --- .../Resources/views/Customer/address.html.twig | 8 ++++++-- .../Resources/views/Customer/addresses.html.twig | 2 ++ .../Core/Customer/Address/AddressAssignmentManager.php | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/CoreShop/Bundle/FrontendBundle/Resources/views/Customer/address.html.twig b/src/CoreShop/Bundle/FrontendBundle/Resources/views/Customer/address.html.twig index a94f0464cb..a3ce58d6e3 100644 --- a/src/CoreShop/Bundle/FrontendBundle/Resources/views/Customer/address.html.twig +++ b/src/CoreShop/Bundle/FrontendBundle/Resources/views/Customer/address.html.twig @@ -14,9 +14,13 @@

- {{ 'coreshop.ui.address'|trans }}
+ {% if address.addressIdentifier is not empty %} + {{ ('coreshop.ui.' ~ address.addressIdentifier.name ~ '_address')|trans }} + {% else %} + {{ 'coreshop.ui.address'|trans }} + {% endif %} {% if not address.getId %} - {{ 'coreshop.ui.add_new_address'|trans }} + – {{ 'coreshop.ui.add_new_address'|trans }} {% endif %}

diff --git a/src/CoreShop/Bundle/FrontendBundle/Resources/views/Customer/addresses.html.twig b/src/CoreShop/Bundle/FrontendBundle/Resources/views/Customer/addresses.html.twig index a4bf841380..3eed02dd72 100644 --- a/src/CoreShop/Bundle/FrontendBundle/Resources/views/Customer/addresses.html.twig +++ b/src/CoreShop/Bundle/FrontendBundle/Resources/views/Customer/addresses.html.twig @@ -26,6 +26,8 @@
{% if customer is not coreshop_address_owner_of(address) %} {{ 'coreshop.ui.company_address'|trans }} + {% elseif address.addressIdentifier is not empty %} + {{ ('coreshop.ui.' ~ address.addressIdentifier.name ~ '_address')|trans }} {% endif %} {{ address|coreshop_format_address }}
diff --git a/src/CoreShop/Component/Core/Customer/Address/AddressAssignmentManager.php b/src/CoreShop/Component/Core/Customer/Address/AddressAssignmentManager.php index 9b4005ec3d..75eab6a93a 100644 --- a/src/CoreShop/Component/Core/Customer/Address/AddressAssignmentManager.php +++ b/src/CoreShop/Component/Core/Customer/Address/AddressAssignmentManager.php @@ -84,7 +84,7 @@ public function checkAddressAffiliationPermissionForCustomer(CustomerInterface $ return true; } - if ($customer->getAddressAccessType() === null) { + if (empty($customer->getAddressAccessType())) { return $customer->hasAddress($address); } From 07640f5e64c0195c666ad97a23946f93bc2e8511 Mon Sep 17 00:00:00 2001 From: Stefan Hagspiel Date: Wed, 16 Dec 2020 14:02:09 +0100 Subject: [PATCH 2/2] remove second badge class --- .../Resources/views/Customer/addresses.html.twig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/CoreShop/Bundle/FrontendBundle/Resources/views/Customer/addresses.html.twig b/src/CoreShop/Bundle/FrontendBundle/Resources/views/Customer/addresses.html.twig index 3eed02dd72..e31fb19a4e 100644 --- a/src/CoreShop/Bundle/FrontendBundle/Resources/views/Customer/addresses.html.twig +++ b/src/CoreShop/Bundle/FrontendBundle/Resources/views/Customer/addresses.html.twig @@ -25,9 +25,9 @@
{% if customer is not coreshop_address_owner_of(address) %} - {{ 'coreshop.ui.company_address'|trans }} + {{ 'coreshop.ui.company_address'|trans }} {% elseif address.addressIdentifier is not empty %} - {{ ('coreshop.ui.' ~ address.addressIdentifier.name ~ '_address')|trans }} + {{ ('coreshop.ui.' ~ address.addressIdentifier.name ~ '_address')|trans }} {% endif %} {{ address|coreshop_format_address }}