Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
__construct (\Magento\CatalogRule\Model\ResourceModel\RuleFactory $ruleFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Customer\Model\Session $customerSession, \Magento\Framework\Event\ManagerInterface $eventManager, PriceCurrencyInterface $priceCurrency, GroupManagementInterface $groupManagement, \Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory $tierPriceFactory, \Magento\Framework\App\Config\ScopeConfigInterface $config, \Magento\Catalog\Helper\Data $catalogData, \Magento\Framework\Serialize\Serializer\Json $serializer=null, ProductTierPriceExtensionFactory $tierPriceExtensionFactory=null) | |
getIsPricesCalculatedByIndex () | |
getPrice ($product) | |
getTotalBundleItemsPrice ($product, $qty=null) | |
getFinalPrice ($qty, $product) | |
getChildFinalPrice ($product, $productQty, $childProduct, $childProductQty) | |
getTotalPrices ($product, $which=null, $includeTax=null, $takeTierPrice=true) | |
getOptions ($product) | |
getSelectionPrice ($bundleProduct, $selectionProduct, $selectionQty=null, $multiplyQty=true) | |
getSelectionPreFinalPrice ($bundleProduct, $selectionProduct, $qty=null) | |
getSelectionFinalTotalPrice ( $bundleProduct, $selectionProduct, $bundleQty, $selectionQty, $multiplyQty=true, $takeTierPrice=true) | |
getTierPrice ($qty, $product) | |
calculateSpecialPrice ( $finalPrice, $specialPrice, $specialPriceFrom, $specialPriceTo, $store=null) | |
getLowestPrice ($bundleProduct, $price, $bundleQty=1) | |
![]() | |
__construct (\Magento\CatalogRule\Model\ResourceModel\RuleFactory $ruleFactory, \Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Framework\Stdlib\DateTime\TimezoneInterface $localeDate, \Magento\Customer\Model\Session $customerSession, \Magento\Framework\Event\ManagerInterface $eventManager, PriceCurrencyInterface $priceCurrency, GroupManagementInterface $groupManagement, \Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory $tierPriceFactory, \Magento\Framework\App\Config\ScopeConfigInterface $config, ProductTierPriceExtensionFactory $tierPriceExtensionFactory=null) | |
getPrice ($product) | |
getBasePrice ($product, $qty=null) | |
getFinalPrice ($qty, $product) | |
getChildFinalPrice ($product, $productQty, $childProduct, $childProductQty) | |
getTierPrice ($qty, $product) | |
setTierPrices ($product, array $tierPrices=null) | |
getTierPriceCount ($product) | |
getFormattedTierPrice ($qty, $product) | |
getFormatedTierPrice ($qty, $product) | |
getFormattedPrice ($product) | |
getFormatedPrice ($product) | |
calculatePrice ( $basePrice, $specialPrice, $specialPriceFrom, $specialPriceTo, $rulePrice=false, $wId=null, $gId=null, $productId=null) | |
calculateSpecialPrice ( $finalPrice, $specialPrice, $specialPriceFrom, $specialPriceTo, $store=null) | |
isTierPriceFixed () | |
Data Fields | |
const | PRICE_TYPE_FIXED = 1 |
const | PRICE_TYPE_DYNAMIC = 0 |
![]() | |
const | CACHE_TAG = 'PRODUCT_PRICE' |
Protected Member Functions | |
getBundleSelectionIds (\Magento\Catalog\Model\Product $product) | |
_applyTierPrice ($product, $qty, $finalPrice) | |
![]() | |
getExistingPrices ($product, $key, $returnRawData=false) | |
getWebsiteForPriceScope () | |
_applyTierPrice ($product, $qty, $finalPrice) | |
getAllCustomerGroupsId () | |
_getCustomerGroupId ($product) | |
_applySpecialPrice ($product, $finalPrice) | |
_applyOptionsPrice ($product, $qty, $finalPrice) | |
Protected Attributes | |
$_isPricesCalculatedByIndex | |
$_catalogData = null | |
![]() | |
$_eventManager | |
$_customerSession | |
$_localeDate | |
$_storeManager | |
$_ruleFactory | |
$priceCurrency | |
$_groupManagement | |
$tierPriceFactory | |
$config | |
Additional Inherited Members | |
![]() | |
static | $attributeCache = [] |
@api @SuppressWarnings(PHPMD.CouplingBetweenObjects)
__construct | ( | \Magento\CatalogRule\Model\ResourceModel\RuleFactory | $ruleFactory, |
\Magento\Store\Model\StoreManagerInterface | $storeManager, | ||
\Magento\Framework\Stdlib\DateTime\TimezoneInterface | $localeDate, | ||
\Magento\Customer\Model\Session | $customerSession, | ||
\Magento\Framework\Event\ManagerInterface | $eventManager, | ||
PriceCurrencyInterface | $priceCurrency, | ||
GroupManagementInterface | $groupManagement, | ||
\Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory | $tierPriceFactory, | ||
\Magento\Framework\App\Config\ScopeConfigInterface | $config, | ||
\Magento\Catalog\Helper\Data | $catalogData, | ||
\Magento\Framework\Serialize\Serializer\Json | $serializer = null , |
||
ProductTierPriceExtensionFactory | $tierPriceExtensionFactory = null |
||
) |
Constructor
\Magento\CatalogRule\Model\ResourceModel\RuleFactory | $ruleFactory | |
\Magento\Store\Model\StoreManagerInterface | $storeManager | |
\Magento\Framework\Stdlib\DateTime\TimezoneInterface | $localeDate | |
\Magento\Customer\Model\Session | $customerSession | |
\Magento\Framework\Event\ManagerInterface | $eventManager | |
PriceCurrencyInterface | $priceCurrency | |
GroupManagementInterface | $groupManagement | |
\Magento\Catalog\Api\Data\ProductTierPriceInterfaceFactory | $tierPriceFactory | |
\Magento\Framework\App\Config\ScopeConfigInterface | $config | |
\Magento\Catalog\Helper\Data | $catalogData | |
\Magento\Framework\Serialize\Serializer\Json | null | $serializer | |
ProductTierPriceExtensionFactory | null | $tierPriceExtensionFactory | @SuppressWarnings(PHPMD.ExcessiveParameterList) |
Definition at line 68 of file Price.php.
|
protected |
calculateSpecialPrice | ( | $finalPrice, | |
$specialPrice, | |||
$specialPriceFrom, | |||
$specialPriceTo, | |||
$store = null |
|||
) |
|
protected |
getChildFinalPrice | ( | $product, | |
$productQty, | |||
$childProduct, | |||
$childProductQty | |||
) |
Returns final price of a child product
\Magento\Catalog\Model\Product | $product | |
float | $productQty | |
\Magento\Catalog\Model\Product | $childProduct | |
float | $childProductQty |
Definition at line 215 of file Price.php.
getFinalPrice | ( | $qty, | |
$product | |||
) |
Get product final price
float | $qty | |
\Magento\Catalog\Model\Product | $product |
Definition at line 187 of file Price.php.
getIsPricesCalculatedByIndex | ( | ) |
Is min/max prices have been calculated by index
Definition at line 105 of file Price.php.
getLowestPrice | ( | $bundleProduct, | |
$price, | |||
$bundleQty = 1 |
|||
) |
Returns the lowest price after applying any applicable bundle discounts
/Magento/Catalog/Model/Product | $bundleProduct | |
float | string | $price | |
int | $bundleQty |
Definition at line 640 of file Price.php.
getOptions | ( | $product | ) |
getPrice | ( | $product | ) |
getSelectionFinalTotalPrice | ( | $bundleProduct, | |
$selectionProduct, | |||
$bundleQty, | |||
$selectionQty, | |||
$multiplyQty = true , |
|||
$takeTierPrice = true |
|||
) |
Calculate final price of selection with take into account tier price
\Magento\Catalog\Model\Product | $bundleProduct | |
\Magento\Catalog\Model\Product | $selectionProduct | |
float | $bundleQty | |
float | $selectionQty | |
bool | $multiplyQty | |
bool | $takeTierPrice |
Definition at line 441 of file Price.php.
getSelectionPreFinalPrice | ( | $bundleProduct, | |
$selectionProduct, | |||
$qty = null |
|||
) |
Calculate selection price for front view (with applied special of bundle)
\Magento\Catalog\Model\Product | $bundleProduct | |
\Magento\Catalog\Model\Product | $selectionProduct | |
float | $qty |
Definition at line 424 of file Price.php.
getSelectionPrice | ( | $bundleProduct, | |
$selectionProduct, | |||
$selectionQty = null , |
|||
$multiplyQty = true |
|||
) |
Calculate price of selection
\Magento\Catalog\Model\Product | $bundleProduct | |
\Magento\Catalog\Model\Product | $selectionProduct | |
float | null | $selectionQty | |
null | bool | $multiplyQty | Whether to multiply selection's price by its quantity |
Definition at line 411 of file Price.php.
getTierPrice | ( | $qty, | |
$product | |||
) |
Get product tier price by qty
float | $qty | |
\Magento\Catalog\Model\Product | $product |
Definition at line 518 of file Price.php.
getTotalBundleItemsPrice | ( | $product, | |
$qty = null |
|||
) |
Get Total price for Bundle items
\Magento\Catalog\Model\Product | $product | |
null | float | $qty |
Definition at line 132 of file Price.php.
getTotalPrices | ( | $product, | |
$which = null , |
|||
$includeTax = null , |
|||
$takeTierPrice = true |
|||
) |
Retrieve Price considering tier price
\Magento\Catalog\Model\Product | $product | |
string | null | $which | |
bool | null | $includeTax | |
bool | $takeTierPrice |
Check if product price is fixed
Definition at line 232 of file Price.php.