Pārlūkot izejas kodu

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

feature/export_comptable
Guillaume pirms 4 gadiem
vecāks
revīzija
f56c73ca92
1 mainītis faili ar 15 papildinājumiem un 0 dzēšanām
  1. +15
    -0
      ShopBundle/Services/Order/OrderUtils.php

+ 15
- 0
ShopBundle/Services/Order/OrderUtils.php Parādīt failu

@@ -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 = [];

Notiek ielāde…
Atcelt
Saglabāt