$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) { |
} | } | ||||
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; | ||||
} | } | ||||