58 parent::__construct($context,
$data);
68 return $this->_coreRegistry->registry(
'current_product');
78 if (!$this->
hasData(
'product_stock_qty')) {
84 $this->
setData(
'product_stock_qty', $qty);
86 return $this->
getData(
'product_stock_qty');
97 return $this->stockRegistry->getStockStatus(
$product->getId(),
$product->getStore()->getWebsiteId())->getQty();
107 if (!$this->
hasData(
'threshold_qty')) {
108 $qty = (float)$this->_scopeConfig->getValue(
109 self::XML_PATH_STOCK_THRESHOLD_QTY,
112 $this->
setData(
'threshold_qty', $qty);
114 return $this->
getData(
'threshold_qty');
124 return 'stock-qty-' . $this->
getProduct()->getId();
getData($key='', $index=null)
const XML_PATH_STOCK_THRESHOLD_QTY
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Registry $registry, \Magento\CatalogInventory\Api\StockStateInterface $stockState, \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, array $data=[])
setData($key, $value=null)
getProductStockQty($product)