Преглед изворни кода

Merge branch 'develop'

master
Guillaume пре 4 година
родитељ
комит
d9404c6b13
3 измењених фајлова са 9 додато и 7 уклоњено
  1. +3
    -2
      ShopBundle/Controller/Backend/ReductionCartController.php
  2. +2
    -1
      ShopBundle/Repository/ReductionCartRepository.php
  3. +4
    -4
      ShopBundle/Resources/views/backend/reductioncart/panel_info.html.twig

+ 3
- 2
ShopBundle/Controller/Backend/ReductionCartController.php Прегледај датотеку

@@ -20,8 +20,9 @@ class ReductionCartController extends AdminController
{
$displayError =false;
foreach ($entity->getCodes() as $code) {
if ($reductionCart = $this->orderUtils->getReductionCartByCode($code)) {
$this->addFlash('success', "Le code " . $code . " est déjà utilisé dans la réduction #" . $reductionCart->getId() . " " . $reductionCart->getTitle());
$reductionCart = $this->orderUtils->getReductionCartByCode($code);
if ($reductionCart && $reductionCart->getId() != $entity->getId()) {
$this->addFlash('error', "Le code " . $code . " est déjà utilisé dans la réduction #" . $reductionCart->getId() . " " . $reductionCart->getTitle());
$displayError = true;
}
}

+ 2
- 1
ShopBundle/Repository/ReductionCartRepository.php Прегледај датотеку

@@ -70,7 +70,8 @@ class ReductionCartRepository extends BaseRepository implements DefaultRepositor
foreach($reductionCarts as $reductionCart) {
if($this->orderUtils->isReductionCartMatchWithUser($reductionCart, $user)
&& $this->orderUtils->isReductionCartMatchWithGroupUser($reductionCart, $user)
&& $this->orderUtils->countReductionCartAvailableForUser($reductionCart, $user)) {
&& $this->orderUtils->countReductionCartAvailableForUser($reductionCart, $user)
&& ($reductionCart->getUsers()->count() > 0 || $reductionCart->getGroupUsers()->count() > 0)) {

$reductionCartsArray[] = $reductionCart ;
}

+ 4
- 4
ShopBundle/Resources/views/backend/reductioncart/panel_info.html.twig Прегледај датотеку

@@ -9,16 +9,16 @@
<div class="col-12">
{{ form_row(form.type) }}
</div>
<div class="col-4">
<div class="col-6">
{{ form_row(form.availableQuantity) }}
</div>
<div class="col-4">
<div class="col-6">
{{ form_row(form.availableQuantityPerUser) }}
</div>
{#
<div class="col-4">
{{ form_row(form.availableQuantityPerCode) }}
</div>
</div>#}
<div class="col-12">
{{ form_row(form.codes, {"attr":{'v-on:keyup' : 'updateCodes'}}) }}
</div>

Loading…
Откажи
Сачувај