Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CanApplyMsrp.php
Go to the documentation of this file.
1 <?php
7 
9 {
13  protected $msrpHelper;
14 
18  public function __construct(\Magento\Msrp\Helper\Data $msrpHelper)
19  {
20  $this->msrpHelper = $msrpHelper;
21  }
22 
27  public function isCanApplyMsrp($address)
28  {
29  $canApplyMsrp = false;
30  foreach ($address->getAllItems() as $item) {
31  if (!$item->getParentItemId()
32  && $this->msrpHelper->isShowBeforeOrderConfirm($item->getProductId())
33  && $this->msrpHelper->isMinimalPriceLessMsrp($item->getProductId())
34  ) {
35  $canApplyMsrp = true;
36  break;
37  }
38  }
39  return $canApplyMsrp;
40  }
41 }
$address
Definition: customer.php:38
__construct(\Magento\Msrp\Helper\Data $msrpHelper)
$canApplyMsrp
Definition: default.phtml:16