6 declare(strict_types=1);
23 private $getStockItemConfiguration;
28 private $stockByWebsiteId;
33 private $getProductSalableQty;
38 private $isSourceItemManagementAllowedForProductType;
52 $this->getStockItemConfiguration = $getStockItemConfig;
53 $this->stockByWebsiteId = $stockByWebsiteId;
54 $this->getProductSalableQty = $getProductSalableQty;
55 $this->isSourceItemManagementAllowedForProductType = $isSourceItemManagementAllowedForProductType;
67 $productType = $subject->
getProduct()->getTypeId();
68 if (!$this->isSourceItemManagementAllowedForProductType->execute($productType)) {
74 $stockId = (int)$this->stockByWebsiteId->execute(
$websiteId)->getStockId();
75 $stockItemConfig = $this->getStockItemConfiguration->execute($sku, $stockId);
79 && $stockItemConfig->getMinQty() < 0)
80 && $this->getProductSalableQty->execute($sku, $stockId) <= $stockItemConfig->getStockThresholdQty();
94 $stockId = (int)$this->stockByWebsiteId->execute(
$websiteId)->getStockId();
95 return $this->getProductSalableQty->execute($sku, $stockId);
aroundGetStockQtyLeft(AbstractStockqty $subject, callable $proceed)
aroundIsMsgVisible(AbstractStockqty $subject, callable $proceed)
__construct(StockByWebsiteIdResolverInterface $stockByWebsiteId, GetStockItemConfigurationInterface $getStockItemConfig, GetProductSalableQtyInterface $getProductSalableQty, IsSourceItemManagementAllowedForProductTypeInterface $isSourceItemManagementAllowedForProductType)