|
|
@@ -58,18 +58,26 @@ trait OrderUtilsStockTrait |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function isProductAvailable(Product $product, $quantityOrder = 0, $checkCart = false, $orderShop = null) |
|
|
|
public function isProductSaleStatusOn(Product $product) |
|
|
|
{ |
|
|
|
if ($product->getStatus() != 1 || $product->getProductFamily()->getStatus() != 1 || $product->getProductFamily()->getSaleStatus()!=1) { |
|
|
|
return false; |
|
|
|
if($product->getProductFamily()->getSaleStatus()!=1) { |
|
|
|
return false ; |
|
|
|
} |
|
|
|
|
|
|
|
$allCategoriesSalesOff = true; |
|
|
|
foreach ($product->getProductFamily()->getProductCategories() as $category){ |
|
|
|
if($category->getSaleStatus())$allCategoriesSalesOff = false; |
|
|
|
} |
|
|
|
if($allCategoriesSalesOff)return false; |
|
|
|
if($allCategoriesSalesOff) return false; |
|
|
|
|
|
|
|
return true ; |
|
|
|
} |
|
|
|
|
|
|
|
public function isProductAvailable(Product $product, $quantityOrder = 0, $checkCart = false, $orderShop = null) |
|
|
|
{ |
|
|
|
if ($product->getStatus() != 1 || $product->getProductFamily()->getStatus() != 1 || !$this->isProductSaleStatusOn($product)) { |
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
|
if (!$orderShop) { |
|
|
|
$orderShop = $this->getCartCurrent(); |