Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Attributes
MsrpPrice Class Reference
Inheritance diagram for MsrpPrice:
FinalPrice MsrpPriceInterface AbstractPrice FinalPriceInterface PriceInterface

Public Member Functions

 __construct (Product $saleableItem, $quantity, CalculatorInterface $calculator, \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency, \Magento\Msrp\Helper\Data $msrpData, \Magento\Msrp\Model\Config $config)
 
 isShowPriceOnGesture ()
 
 getMsrpPriceMessage ()
 
 isMsrpEnabled ()
 
 canApplyMsrp (Product $product)
 
 isMinimalPriceLessMsrp (Product $product)
 
- Public Member Functions inherited from FinalPrice
 getValue ()
 
 getMinimalPrice ()
 
 getMaximalPrice ()
 
- Public Member Functions inherited from AbstractPrice
 __construct (SaleableInterface $saleableItem, $quantity, CalculatorInterface $calculator, \Magento\Framework\Pricing\PriceCurrencyInterface $priceCurrency)
 
 getValue ()
 
 getAmount ()
 
 getCustomAmount ($amount=null, $exclude=null, $context=[])
 
 getPriceCode ()
 
 getProduct ()
 
 getQuantity ()
 

Data Fields

const PRICE_CODE = 'msrp_price'
 
- Data Fields inherited from FinalPrice
const PRICE_CODE = 'final_price'
 
- Data Fields inherited from AbstractPrice
const PRICE_CODE = 'abstract_price'
 

Protected Attributes

 $msrpData
 
 $config
 
- Protected Attributes inherited from FinalPrice
 $minimalPrice
 
 $maximalPrice
 
- Protected Attributes inherited from AbstractPrice
 $amount
 
 $calculator
 
 $product
 
 $priceType
 
 $quantity
 
 $priceInfo
 
 $value
 
 $priceCurrency
 

Additional Inherited Members

- Protected Member Functions inherited from FinalPrice
 getBasePrice ()
 

Detailed Description

MSRP price model

Definition at line 16 of file MsrpPrice.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( Product  $saleableItem,
  $quantity,
CalculatorInterface  $calculator,
\Magento\Framework\Pricing\PriceCurrencyInterface  $priceCurrency,
\Magento\Msrp\Helper\Data  $msrpData,
\Magento\Msrp\Model\Config  $config 
)
Parameters
Product$saleableItem
float$quantity
CalculatorInterface$calculator
\Magento\Framework\Pricing\PriceCurrencyInterface$priceCurrency
\Magento\Msrp\Helper\Data$msrpData
\Magento\Msrp\Model\Config$config

Definition at line 41 of file MsrpPrice.php.

Member Function Documentation

◆ canApplyMsrp()

canApplyMsrp ( Product  $product)

Check if can apply Minimum Advertise price to product

Parameters
Product$product
Returns
bool

Implements MsrpPriceInterface.

Definition at line 90 of file MsrpPrice.php.

91  {
92  return $this->msrpData->canApplyMsrp($product);
93  }

◆ getMsrpPriceMessage()

getMsrpPriceMessage ( )

Get Msrp message for price

Returns
string

Implements MsrpPriceInterface.

Definition at line 69 of file MsrpPrice.php.

70  {
71  return $this->msrpData->getMsrpPriceMessage($this->product);
72  }

◆ isMinimalPriceLessMsrp()

isMinimalPriceLessMsrp ( Product  $product)
Parameters
Product$product
Returns
bool|float

Definition at line 99 of file MsrpPrice.php.

100  {
101  return $this->msrpData->isMinimalPriceLessMsrp($product);
102  }

◆ isMsrpEnabled()

isMsrpEnabled ( )

Check if Minimum Advertised Price is enabled

Returns
bool

Implements MsrpPriceInterface.

Definition at line 79 of file MsrpPrice.php.

80  {
81  return $this->config->isEnabled();
82  }

◆ isShowPriceOnGesture()

isShowPriceOnGesture ( )

Returns whether the MSRP should be shown on gesture

Returns
bool

Implements MsrpPriceInterface.

Definition at line 59 of file MsrpPrice.php.

60  {
61  return $this->msrpData->isShowPriceOnGesture($this->product);
62  }

Field Documentation

◆ $config

$config
protected

Definition at line 31 of file MsrpPrice.php.

◆ $msrpData

$msrpData
protected

Definition at line 26 of file MsrpPrice.php.

◆ PRICE_CODE

const PRICE_CODE = 'msrp_price'

Price type MSRP

Definition at line 21 of file MsrpPrice.php.


The documentation for this class was generated from the following file: