Magento Extensions Rating 2024
EXTENSIONS BY CATEGORY
B2B (Business-To-Business)
Blog
Customer
ERP (Enterprise Resource Planning)
Mega Menu
One Step Checkout
Order
POS (Point Of Sale)
Search
Shopping Cart
Sitemap
SEO
Social
Stock & Inventory Management
EXTENSIONS BY DEVELOPER
aheadWorks
Amasty
Boost My Shop
BSS Commerce
Magestore
MageWorx
Mirasvit
Templates Master
Wyomind
XTENTO
Magento 2 Documentation
Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
vendor
magento
module-catalog-inventory
Block
Qtyincrements.php
Go to the documentation of this file.
1
<?php
7
namespace
Magento\CatalogInventory\Block
;
8
9
use
Magento\Framework\DataObject\IdentityInterface
;
10
use
Magento\Framework\View\Element\Template
;
11
22
class
Qtyincrements
extends
Template
implements
IdentityInterface
23
{
29
protected
$_qtyIncrements
;
30
36
protected
$_coreRegistry
;
37
41
protected
$stockRegistry
;
42
49
public
function
__construct
(
50
\
Magento
\Framework\View\Element\
Template
\
Context
$context,
51
\
Magento
\Framework\Registry
$registry
,
52
\
Magento
\CatalogInventory\Api\StockRegistryInterface
$stockRegistry
,
53
array
$data
= []
54
) {
55
$this->_coreRegistry =
$registry
;
56
$this->stockRegistry =
$stockRegistry
;
57
parent::__construct($context,
$data
);
58
}
59
65
public
function
getProduct
()
66
{
67
return
$this->_coreRegistry->registry(
'current_product'
);
68
}
69
75
public
function
getProductName
()
76
{
77
return
$this->
getProduct
()->getName();
78
}
79
85
public
function
getProductQtyIncrements
()
86
{
87
if
($this->_qtyIncrements ===
null
) {
88
$stockItem
= $this->stockRegistry->getStockItem(
89
$this->
getProduct
()->getId(),
90
$this->
getProduct
()->getStore()->getWebsiteId()
91
);
92
$this->_qtyIncrements =
$stockItem
->getQtyIncrements();
93
if
(!$this->
getProduct
()->isSaleable()) {
94
$this->_qtyIncrements =
false
;
95
}
96
}
97
return
$this->_qtyIncrements
;
98
}
99
105
public
function
getIdentities
()
106
{
107
return
$this->
getProduct
()->getIdentities();
108
}
109
}
Magento\CatalogInventory\Block\Qtyincrements\$stockRegistry
$stockRegistry
Definition:
Qtyincrements.php:41
Magento\CatalogInventory\Block\Qtyincrements\getProductName
getProductName()
Definition:
Qtyincrements.php:75
Magento\Framework\View\Element\Template
Definition:
Context.php:6
Magento\Framework\DataObject\IdentityInterface
Definition:
IdentityInterface.php:13
Magento\CatalogInventory\Block\Qtyincrements\getIdentities
getIdentities()
Definition:
Qtyincrements.php:105
Magento\CatalogInventory\Block\Qtyincrements\getProductQtyIncrements
getProductQtyIncrements()
Definition:
Qtyincrements.php:85
$stockItem
$stockItem
Definition:
configurable_options_advanced_inventory.php:24
Magento\CatalogInventory\Block\Qtyincrements\__construct
__construct(\Magento\Framework\View\Element\Template\Context $context, \Magento\Framework\Registry $registry, \Magento\CatalogInventory\Api\StockRegistryInterface $stockRegistry, array $data=[])
Definition:
Qtyincrements.php:49
$registry
$registry
Definition:
bundle_product_with_not_visible_children_rollback.php:16
Magento\Framework\View\Element\Template\Context
Definition:
Context.php:23
$data
$data
Definition:
attribute_set_with_image_attribute.php:16
Magento\CatalogInventory\Block\Qtyincrements\getProduct
getProduct()
Definition:
Qtyincrements.php:65
Magento\CatalogInventory\Block
Magento
Magento\Framework\View\Element\Template
Definition:
Template.php:32
Magento\CatalogInventory\Block\Qtyincrements\$_coreRegistry
$_coreRegistry
Definition:
Qtyincrements.php:36
Magento\CatalogInventory\Block\Qtyincrements\$_qtyIncrements
$_qtyIncrements
Definition:
Qtyincrements.php:29
Magento\CatalogInventory\Block\Qtyincrements
Definition:
Qtyincrements.php:22