Skip to content

Commit

Permalink
Merge pull request #2738 from spryker/bugfix/core-1781-customer-count…
Browse files Browse the repository at this point in the history
…ry-displaying-issue

CORE-1781 Fix breadcrumbs, wrong country displaying and worng overvie…
  • Loading branch information
dereuromark authored Aug 14, 2017
2 parents 325d675 + 00bb414 commit 570105f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 30 deletions.
11 changes: 8 additions & 3 deletions src/Spryker/Zed/Customer/Communication/Table/CustomerTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,10 +172,15 @@ protected function hydrateCustomerListRow(SpyCustomer $customer)
protected function getCountryNameByCustomer(SpyCustomer $customer)
{
$countryName = '';
if ($customer->getAddresses()->count() === 0) {
return $countryName;
}

if ($customer->getAddresses()->count() > 0) {
$address = $customer->getAddresses()->get(0);
$countryName = $address->getCountry()->getName();
$addresses = $customer->getAddresses();
foreach ($addresses as $address) {
if ($address->getFkCountry() === $customer->getCountry()) {
return $address->getCountry()->getName();
}
}

return $countryName;
Expand Down
49 changes: 23 additions & 26 deletions src/Spryker/Zed/Customer/Communication/navigation.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,14 @@
<uri>#</uri>
<visible>1</visible>
<pages>

<customer>
<label>Customers</label>
<title>Customers</title>
<bundle>customer</bundle>
<controller>index</controller>
<action>index</action>
<visible>1</visible>

<pages>

<customer-add>
<label>Add a customer</label>
<title>Add a customer</title>
Expand All @@ -26,7 +23,14 @@
<action>index</action>
<visible>0</visible>
</customer-add>

<customer-edit>
<label>Edit customer</label>
<title>Edit customer</title>
<bundle>customer</bundle>
<controller>edit</controller>
<action>index</action>
<visible>0</visible>
</customer-edit>
<customer-view>
<label>View</label>
<title>View</title>
Expand All @@ -35,33 +39,26 @@
<action>index</action>
<visible>0</visible>
<pages>

<customer-edit>
<label>Edit customer</label>
<title>Edit customer</title>
<bundle>customer</bundle>
<controller>edit</controller>
<action>index</action>
<visible>0</visible>
</customer-edit>

<customer-address-edit>
<label>Edit address</label>
<title>Edit address</title>
<bundle>customer</bundle>
<controller>address</controller>
<action>edit</action>
<visible>0</visible>
</customer-address-edit>

<label>Edit address</label>
<title>Edit address</title>
<bundle>customer</bundle>
<controller>address</controller>
<action>edit</action>
<visible>0</visible>
</customer-address-edit>
<customer-address-add>
<label>Add address</label>
<title>Add address</title>
<bundle>customer</bundle>
<controller>address</controller>
<action>add</action>
<visible>0</visible>
</customer-address-add>
</pages>
</customer-view>

</pages>

</customer>


</pages>
</customer>
</config>
3 changes: 2 additions & 1 deletion src/Spryker/Zed/Customer/Presentation/Edit/index.twig
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

{% block action %}
{{ removeActionButton(url('/customer/delete', {'id-customer': idCustomer}), 'Delete' | trans) }}
{{ backActionButton(url('/customer/view', {'id-customer': idCustomer}), 'Back to Customer View' | trans) }}
{{ viewActionButton(url('/customer/view', {'id-customer': idCustomer}), 'View' | trans) }}
{{ backActionButton(url('/customer'), 'Back to Customers' | trans) }}
{% endblock %}

{% block content %}
Expand Down

0 comments on commit 570105f

Please sign in to comment.