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-msrp
Model
Msrp.php
Go to the documentation of this file.
1
<?php
6
namespace
Magento\Msrp\Model
;
7
8
use
Magento\Catalog\Model\Product
;
9
use Magento\Catalog\Model\ResourceModel\Eav\AttributeFactory;
10
11
class
Msrp
12
{
16
protected
$mapApplyToProductType
=
null
;
17
21
protected
$eavAttributeFactory
;
22
26
public
function
__construct
(
27
AttributeFactory
$eavAttributeFactory
28
) {
29
$this->eavAttributeFactory =
$eavAttributeFactory
;
30
}
31
39
public
function
canApplyToProduct(
$product
)
40
{
41
if
($this->mapApplyToProductType ===
null
) {
43
$attribute
= $this->eavAttributeFactory->create()->loadByCode(
Product::ENTITY
,
'msrp'
);
44
$this->mapApplyToProductType =
$attribute
->getApplyTo();
45
}
46
return
in_array(
$product
->getTypeId(),
$this->mapApplyToProductType
);
47
}
48
}
Magento\Catalog\Model\Product\ENTITY
const ENTITY
Definition:
Product.php:57
Magento\Msrp\Model
Definition:
Config.php:6
$attribute
$attribute
Definition:
attribute_set_with_image_attribute.php:41
Magento\Msrp\Model\Msrp\$mapApplyToProductType
$mapApplyToProductType
Definition:
Msrp.php:16
Magento\Msrp\Model\Msrp
Definition:
Msrp.php:11
Magento\Catalog\Model\Product
Definition:
ActionTest.php:6
$product
$product
Definition:
bundle_product_with_not_visible_children.php:22
Magento\Msrp\Model\Msrp\__construct
__construct(AttributeFactory $eavAttributeFactory)
Definition:
Msrp.php:26
Magento\Msrp\Model\Msrp\$eavAttributeFactory
$eavAttributeFactory
Definition:
Msrp.php:21