Pārlūkot izejas kodu

[Frontoffice] Bug adresses

feature/export_comptable
Fab pirms 4 gadiem
vecāks
revīzija
5fd7d057c6
3 mainītis faili ar 17 papildinājumiem un 4 dzēšanām
  1. +14
    -3
      ShopBundle/Model/User.php
  2. +1
    -1
      ShopBundle/Resources/views/backend/default/block/form_address.html.twig
  3. +2
    -0
      ShopBundle/Resources/views/backend/user/edit.html.twig

+ 14
- 3
ShopBundle/Model/User.php Parādīt failu

@@ -181,9 +181,20 @@ abstract class User extends UserModelFOS
/**
* @return Collection|Address[]
*/
public function getAddresses(): Collection
{
return $this->addresses;
public function getAddresses($status = null): Collection
{
if($status){
$addressToReturn = new ArrayCollection();
foreach ($this->addresses as $address){
if($address->getStatus() == $status) {
$addressToReturn[] = $address;
}
}
return $addressToReturn;
}else{
return $this->addresses;
}

}

public function addAddress(Address $address): self

+ 1
- 1
ShopBundle/Resources/views/backend/default/block/form_address.html.twig Parādīt failu

@@ -71,7 +71,7 @@
<div class="col-12">
{{ form_row(form.status) }}
<p class="callout callout-info">
Sauf si vous avez ce que ce vous faites ce champ doit toujours être "Activer"
Sauf si vous savez ce que ce vous faites ce champ doit toujours être "Activer"
</p>
</div>


+ 2
- 0
ShopBundle/Resources/views/backend/user/edit.html.twig Parādīt failu

@@ -19,7 +19,9 @@
<div class="col-5">
<div class="row" id="user-addresses">
{% for address in entity.addresses %}
{% if address.status >=0 %}
{% include '@LcShop/backend/user/block_useraddress.html.twig' %}
{% endif %}
{% endfor %}
</div>
<button type="button" data-url="{{ path('easyadmin', {"action": 'editAddressUser', 'entity': 'User', 'id': entity.id, 'addressId': 'new'}) }}"

Notiek ielāde…
Atcelt
Saglabāt