Browse Source

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

feature/export_comptable
Fab 4 years ago
parent
commit
b8ada7133f
3 changed files with 11 additions and 2 deletions
  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 View File

$form->handleRequest($request); $form->handleRequest($request);


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

+ 1
- 0
ShopBundle/Repository/TicketRepository.php View File

{ {
$query = $this->findByMerchantQuery() ; $query = $this->findByMerchantQuery() ;
$query->andWhere('e.status IN (:statusOpen)')->setParameter('statusOpen', [Ticket::TICKET_STATUS_OPEN, Ticket::TICKET_STATUS_BEING_PROCESSED]) ; $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() ; return $query->getQuery()->getResult() ;
} }
} }

+ 9
- 1
ShopBundle/Services/Order/OrderUtilsCartTrait.php View File

} }




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


} }
} }


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

return $orderShop; return $orderShop;
} }



Loading…
Cancel
Save