Browse Source

[Frontend] Rayons : produits déjà dans le panier

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

+ 15
- 0
ShopBundle/Services/Order/OrderUtils.php View File

@@ -338,6 +338,21 @@ class OrderUtils
return false ;
}

public function getOrderProductByProductFamilyInCart($productFamily)
{
$orderShop = $this->getCartCurrent() ;

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

return false ;
}

public function groupOrderProductsByProductFamily($orderProducts)
{
$orderProductsByProductFamily = [];

Loading…
Cancel
Save