/** * Add Notify Stock Qty Condition to collection * * @param null|int $storeId * @return $this */ public function useNotifyStockQtyFilter($storeId = null) { $this->joinInventoryItem(['qty']); $notifyStockExpr = $this->getConnection()->getCheckSql($this->_getInventoryItemField('use_config_notify_stock_qty') . ' = 1', (int) $this->stockConfiguration->getNotifyStockQty($storeId), $this->_getInventoryItemField('notify_stock_qty')); $this->getSelect()->where($this->_getInventoryItemField('qty') . ' < ?', $notifyStockExpr); return $this; }
/** * Retrieve Notify for Quantity Below data wrapper * * @return float */ public function getNotifyStockQty() { if ($this->getUseConfigNotifyStockQty()) { return $this->stockConfiguration->getNotifyStockQty($this->getStoreId()); } return (double) $this->getData(static::NOTIFY_STOCK_QTY); }