orderable_start || $now->gt($product->orderable_start); $end = ! $product->orderable_end || $now->lt($product->orderable_end); $isOrderable = $start && $end; return $isOrderable && $product->status && $this->isAssociatedWithInco($product); } public function isPublished(Product $product): bool { return $product->status; } public function isBasketProductPublished(BasketProduct $basketProduct): bool { $product = $this->productRepository->find($basketProduct->id); if (! $product) { // NOTE: Don't throw an exception here, as the product may have been deleted after being added to the basket return false; } return $this->isPublished($product); } public function isAssociatedWithInco(Product $product): bool { return $product->hasInco; } }