59 $product = $this->registry->registry(
'current_product');
65 if ($this->weeeData->isEnabled() &&
$product->getTypeId() == \Magento\Catalog\Model\Product\Type::TYPE_BUNDLE) {
66 if ($this->taxData->priceIncludesTax() && $this->taxData->displayPriceExcludingTax()) {
71 if (!array_key_exists(
'optionTemplate',
$options)) {
73 $options[
'optionTemplate'] =
'<%- data.label %>' 74 .
'<% if (data.' . $calcPrice .
'.value) { %>' 75 .
' +<%- data.' . $calcPrice .
'.formatted %>' 79 if (!$this->weeeData->isDisplayIncl(
$product->getStoreId()) &&
80 !$this->weeeData->isDisplayExcl(
$product->getStoreId())) {
82 foreach ($this->weeeData->getWeeeAttributesForBundle(
$product) as $weeeAttributes) {
83 foreach ($weeeAttributes as $weeeAttribute) {
84 if (!preg_match(
'/' . $weeeAttribute->getCode() .
'/',
$options[
'optionTemplate'])) {
85 $options[
'optionTemplate'] .= sprintf(
86 ' <%% if (data.weeePrice' . $weeeAttribute->getCode() .
') { %%>' 87 .
' (' . $weeeAttribute->getName()
88 .
': <%%- data.weeePrice' . $weeeAttribute->getCode()
97 if ($this->weeeData->isDisplayExclDescIncl(
$product->getStoreId())) {
98 $options[
'optionTemplate'] .= sprintf(
99 ' <%% if (data.weeePrice) { %%>' 100 .
'<%%- data.weeePrice.formatted %%>' 117 $calcPrice =
'finalPrice';
119 if ($this->weeeData->isDisplayExclDescIncl(
$storeId) ||
120 ($this->weeeData->isDisplayExcl(
$storeId) && $this->taxData->displayPriceExcludingTax())) {
121 $calcPrice =
'basePrice';
__construct(\Magento\Framework\Registry $registry, \Magento\Weee\Helper\Data $weeeData, \Magento\Tax\Helper\Data $taxData)
getWhichCalcPriceToUse($storeId=null)
execute(Observer $observer)