Sfoglia il codice sorgente

Correctif bug paniers multiples

master
Guillaume 4 anni fa
parent
commit
5ac4515df4
2 ha cambiato i file con 10 aggiunte e 2 eliminazioni
  1. +1
    -1
      ShopBundle/Controller/Frontend/CartController.php
  2. +9
    -1
      ShopBundle/Services/Order/OrderUtilsCartTrait.php

+ 1
- 1
ShopBundle/Controller/Frontend/CartController.php Vedi File

@@ -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) {

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

@@ -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…
Annulla
Salva