Browse Source

[Frontend] Produits : déjà dans votre panier

feature/export_comptable
Guillaume 4 years ago
parent
commit
4f9d03347c
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      ShopBundle/Services/Order/OrderUtils.php

+ 4
- 3
ShopBundle/Services/Order/OrderUtils.php View File

return false ; return false ;
} }


public function getOrderProductByProductFamilyInCart($productFamily)
public function getOrderProductsByProductFamilyInCart($productFamily)
{ {
$arrayOrderProducts = [] ;
$orderShop = $this->getCartCurrent() ; $orderShop = $this->getCartCurrent() ;


if($orderShop) { if($orderShop) {
foreach($orderShop->getOrderProducts() as $orderProduct) { foreach($orderShop->getOrderProducts() as $orderProduct) {
if($orderProduct->getProduct()->getProductFamily() == $productFamily) { if($orderProduct->getProduct()->getProductFamily() == $productFamily) {
return $orderProduct ;
$arrayOrderProducts[] = $orderProduct ;
} }
} }
} }


return false ;
return $arrayOrderProducts ;
} }


public function groupOrderProductsByProductFamily($orderProducts) public function groupOrderProductsByProductFamily($orderProducts)

Loading…
Cancel
Save