Browse Source

Correctif bug paniers multiples

master
Guillaume 4 years ago
parent
commit
5ac4515df4
2 changed files with 10 additions and 2 deletions
  1. +1
    -1
      ShopBundle/Controller/Frontend/CartController.php
  2. +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) {

+ 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