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
Pricing
Price
ConfiguredRegularPrice.php
Go to the documentation of this file.
1
<?php
6
declare(strict_types=1);
7
8
namespace
Magento\Catalog\Pricing\Price
;
9
10
use
Magento\Catalog\Model\Product
;
11
use
Magento\Catalog\Model\Product\Configuration\Item\ItemInterface
;
12
use
Magento\Framework\Pricing\Adjustment\CalculatorInterface
;
13
use
Magento\Framework\Pricing\PriceCurrencyInterface
;
14
18
class
ConfiguredRegularPrice
extends
RegularPrice
implements
ConfiguredPriceInterface
19
{
23
const
PRICE_CODE
=
self::CONFIGURED_REGULAR_PRICE_CODE
;
24
28
private
$item;
29
33
private
$configuredOptions;
34
43
public
function
__construct
(
44
Product
$saleableItem,
45
$quantity
,
46
CalculatorInterface
$calculator
,
47
PriceCurrencyInterface
$priceCurrency
,
48
ConfiguredOptions
$configuredOptions,
49
ItemInterface
$item =
null
50
) {
51
$this->item = $item;
52
$this->configuredOptions = $configuredOptions;
53
parent::__construct($saleableItem,
$quantity
,
$calculator
,
$priceCurrency
);
54
}
55
60
public
function
setItem
(
ItemInterface
$item) :
ConfiguredRegularPrice
61
{
62
$this->item =
$item
;
63
64
return
$this;
65
}
66
72
public
function
getValue
()
73
{
74
$basePrice = parent::getValue();
75
76
return
$this->item && $basePrice !==
false
77
? $basePrice + $this->configuredOptions->getItemOptionsValue($basePrice, $this->item)
78
: $basePrice;
79
}
80
}
Magento\Catalog\Pricing\Price\ConfiguredRegularPrice\setItem
setItem(ItemInterface $item)
Definition:
ConfiguredRegularPrice.php:60
Magento\Catalog\Model\Product\Configuration\Item\ItemInterface
Definition:
ItemInterface.php:15
Magento\Framework\Pricing\Price\AbstractPrice\$priceCurrency
$priceCurrency
Definition:
AbstractPrice.php:66
$item
$item
Definition:
partial_invoice.php:27
Magento\Catalog\Pricing\Price\ConfiguredRegularPrice\getValue
getValue()
Definition:
ConfiguredRegularPrice.php:72
Magento\Catalog\Pricing\Price\ConfiguredPriceInterface\CONFIGURED_REGULAR_PRICE_CODE
const CONFIGURED_REGULAR_PRICE_CODE
Definition:
ConfiguredPriceInterface.php:24
Magento\Framework\Pricing\PriceCurrencyInterface
Definition:
PriceCurrencyInterface.php:15
Magento\Catalog\Pricing\Price\ConfiguredRegularPrice\PRICE_CODE
const PRICE_CODE
Definition:
ConfiguredRegularPrice.php:23
Magento\Catalog\Pricing\Price\ConfiguredPriceInterface
Definition:
ConfiguredPriceInterface.php:14
Magento\Catalog\Model\Product
Definition:
Product.php:42
Magento\Framework\Pricing\Adjustment\CalculatorInterface
Definition:
CalculatorInterface.php:17
Magento\Catalog\Model\Product
Definition:
ActionTest.php:6
Magento\Catalog\Pricing\Price\ConfiguredRegularPrice\__construct
__construct(Product $saleableItem, $quantity, CalculatorInterface $calculator, PriceCurrencyInterface $priceCurrency, ConfiguredOptions $configuredOptions, ItemInterface $item=null)
Definition:
ConfiguredRegularPrice.php:43
Magento\Catalog\Pricing\Price\ConfiguredOptions
Definition:
ConfiguredOptions.php:15
Magento\Catalog\Pricing\Price\RegularPrice
Definition:
RegularPrice.php:15
Magento\Framework\Pricing\Price\AbstractPrice\$quantity
$quantity
Definition:
AbstractPrice.php:51
Magento\Catalog\Pricing\Price
Definition:
BasePrice.php:7
Magento\Framework\Pricing\Price\AbstractPrice\$calculator
$calculator
Definition:
AbstractPrice.php:36
Magento\Catalog\Pricing\Price\ConfiguredRegularPrice
Definition:
ConfiguredRegularPrice.php:18