Esempio n. 1
0
 /**
  * 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;
 }
Esempio n. 2
0
 /**
  * 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);
 }