Browse Source

Merge branch 'develop'

develop
Guillaume 3 years ago
parent
commit
876716d2b2
3 changed files with 5 additions and 5 deletions
  1. +2
    -2
      ShopBundle/Resources/views/backend/default/block/macros.html.twig
  2. +1
    -1
      ShopBundle/Resources/views/backend/user/show.html.twig
  3. +2
    -2
      ShopBundle/Services/Order/OrderUtilsReductionTrait.php

+ 2
- 2
ShopBundle/Resources/views/backend/default/block/macros.html.twig View File







{% macro list_reduction_credits(reductionCredits) %}
{% macro list_reduction_credits(reductionCredits, user) %}
<table class="table table-condensed"> <table class="table table-condensed">
<thead> <thead>
<tr> <tr>
</thead> </thead>
<tbody> <tbody>
{% for reductionCredit in reductionCredits %} {% for reductionCredit in reductionCredits %}
{% set isUsed = orderUtils.isReductionCreditUsed(reductionCredit) %}
{% set isUsed = orderUtils.isReductionCreditUsed(reductionCredit, user) %}
<tr> <tr>
<td>{{ reductionCredit.title }}</td> <td>{{ reductionCredit.title }}</td>
<td> <td>

+ 1
- 1
ShopBundle/Resources/views/backend/user/show.html.twig View File



{% if entity.reductionCredits|length %} {% if entity.reductionCredits|length %}
{{ macros.card_start('ReductionCredit.list', 'warning card-outline', false) }} {{ macros.card_start('ReductionCredit.list', 'warning card-outline', false) }}
{{ macros.list_reduction_credits(entity.reductionCredits) }}
{{ macros.list_reduction_credits(entity.reductionCredits, entity) }}
{{ macros.card_end() }} {{ macros.card_end() }}
{% endif %} {% endif %}



+ 2
- 2
ShopBundle/Services/Order/OrderUtilsReductionTrait.php View File

} }
} }


public function isReductionCreditUsed($reductionCredit){
if($this->orderShopRepo->countValidOrderWithReductionCredit($reductionCredit)) {
public function isReductionCreditUsed($reductionCredit, $user = false){
if($this->orderShopRepo->countValidOrderWithReductionCredit($reductionCredit, $user)) {
return true; return true;
}else{ }else{
return false; return false;

Loading…
Cancel
Save