Преглед на файлове

Merge branch 'develop' of https://gitea.laclic.fr/Laclic/LcShopBundle into develop

feature/export_comptable
Fab преди 4 години
родител
ревизия
b8ada7133f
променени са 3 файла, в които са добавени 11 реда и са изтрити 2 реда
  1. +1
    -1
      ShopBundle/Controller/Frontend/CartController.php
  2. +1
    -0
      ShopBundle/Repository/TicketRepository.php
  3. +9
    -1
      ShopBundle/Services/Order/OrderUtilsCartTrait.php

+ 1
- 1
ShopBundle/Controller/Frontend/CartController.php Целия файл

@@ -70,7 +70,7 @@ class CartController extends BaseController
$form->handleRequest($request);

if ($form->isSubmitted() && $form->isValid()) {
$orderShop = $this->orderUtils->getCartCurrent() ;
$orderShop = $this->orderUtils->getCartCurrent(true) ;
$data = $form->getData() ;
foreach($data as $orderProduct) {
if($orderProduct instanceof OrderProductInterface) {

+ 1
- 0
ShopBundle/Repository/TicketRepository.php Целия файл

@@ -27,6 +27,7 @@ class TicketRepository extends BaseRepository implements DefaultRepositoryInterf
{
$query = $this->findByMerchantQuery() ;
$query->andWhere('e.status IN (:statusOpen)')->setParameter('statusOpen', [Ticket::TICKET_STATUS_OPEN, Ticket::TICKET_STATUS_BEING_PROCESSED]) ;
$query->addOrderBy('e.id', 'DESC') ;
return $query->getQuery()->getResult() ;
}
}

+ 9
- 1
ShopBundle/Services/Order/OrderUtilsCartTrait.php Целия файл

@@ -21,7 +21,7 @@ trait OrderUtilsCartTrait
}


public function getCartCurrent()
public function getCartCurrent($createIfNotExist = false)
{
$paramsSearchOrderShop = [];

@@ -63,6 +63,14 @@ trait OrderUtilsCartTrait
}
}

if($createIfNotExist && !$orderShop) {
$orderShop = $this->createOrderShop([
'user' => $user,
'visitor' => $visitor,
'merchant' => $this->merchantUtils->getMerchantCurrent()
]);
}

return $orderShop;
}


Loading…
Отказ
Запис