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-rule
Model
Product
PriceModifier.php
Go to the documentation of this file.
1
<?php
8
namespace
Magento\CatalogRule\Model\Product
;
9
10
use
Magento\Catalog\Model\Product
;
11
use
Magento\Catalog\Model\Product\PriceModifierInterface
;
12
use Magento\CatalogRule\Model\RuleFactory;
13
14
class
PriceModifier
implements
PriceModifierInterface
15
{
19
protected
$ruleFactory
;
20
24
public
function
__construct
(RuleFactory
$ruleFactory
)
25
{
26
$this->ruleFactory =
$ruleFactory
;
27
}
28
36
public
function
modifyPrice
(
$price
,
Product
$product
)
37
{
38
if
(
$price
!==
null
) {
39
$resultPrice = $this->ruleFactory->create()->calcProductPriceRule(
$product
,
$price
);
40
if
($resultPrice !==
null
) {
41
$price
= $resultPrice;
42
}
43
}
44
return
$price
;
45
}
46
}
Magento\CatalogRule\Model\Product
Definition:
PriceModifier.php:8
$price
$price
Definition:
product_alert.php:10
Magento\CatalogRule\Model\Product\PriceModifier\__construct
__construct(RuleFactory $ruleFactory)
Definition:
PriceModifier.php:24
Magento\CatalogRule\Model\Product\PriceModifier\$ruleFactory
$ruleFactory
Definition:
PriceModifier.php:19
Magento\CatalogRule\Model\Product\PriceModifier\modifyPrice
modifyPrice($price, Product $product)
Definition:
PriceModifier.php:36
Magento\Catalog\Model\Product
Definition:
Product.php:42
Magento\Catalog\Model\Product\PriceModifier
Definition:
PriceModifier.php:12
Magento\Catalog\Model\Product
Definition:
ActionTest.php:6
$product
$product
Definition:
bundle_product_with_not_visible_children.php:22
Magento\Catalog\Model\Product\PriceModifierInterface
Definition:
PriceModifierInterface.php:16