Skip to content

Commit 65afa8a

Browse files
🔃 [EngCom] Public Pull Requests - 2.2-develop
Accepted Public Pull Requests: - #21588: [Backport] Fixes for product tabbing issue (by @amol2jcommerce) - #21531: [Backport] Update details.phtml (by @amol2jcommerce) - #19551: [Backport] Resolved upgrade issue if manufacturer attribute missing [Magento 2.2] (by @suneet64) - #21570: [Backport] Change product_price_value in cart data section based on tax settings (by @mage2pratik) - #21532: [Backport] Misconfigured aria-labelledby for product tabs (by @amol2jcommerce) Fixed GitHub Issues: - #21077: Tabbing issue on product detail page (reported by @prakash2jcommerce) has been fixed in #21588 by @amol2jcommerce in 2.2-develop branch Related commits: 1. ab2de15 2. c6c6ead 3. 905085d 4. 2d3a876 - #18134: Manufacturer error when upgrading to 2.2.6 (reported by @N1ghtfl0w) has been fixed in #19551 by @suneet64 in 2.2-develop branch Related commits: 1. f0a92f2 2. dbf5293 3. 4567a1a - #20310: Cart section data has wrong product_price_value (reported by @NickdeK) has been fixed in #21570 by @mage2pratik in 2.2-develop branch Related commits: 1. ce1c1a2 2. c821730
2 parents e1146fd + f6f1419 commit 65afa8a

File tree

5 files changed

+53
-24
lines changed

5 files changed

+53
-24
lines changed

app/code/Magento/Catalog/view/frontend/templates/product/view/details.phtml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,17 @@
2121
$label = $block->getChildData($alias, 'title');
2222
?>
2323
<div class="data item title"
24-
aria-labelledby="tab-label-<?= /* @escapeNotVerified */ $alias ?>-title"
2524
data-role="collapsible" id="tab-label-<?= /* @escapeNotVerified */ $alias ?>">
2625
<a class="data switch"
2726
tabindex="-1"
28-
data-toggle="switch"
27+
data-toggle="trigger"
2928
href="#<?= /* @escapeNotVerified */ $alias ?>"
3029
id="tab-label-<?= /* @escapeNotVerified */ $alias ?>-title">
3130
<?= /* @escapeNotVerified */ $label ?>
3231
</a>
3332
</div>
34-
<div class="data item content" id="<?= /* @escapeNotVerified */ $alias ?>" data-role="content">
33+
<div class="data item content"
34+
aria-labelledby="tab-label-<?= /* @escapeNotVerified */ $alias ?>-title" id="<?= /* @escapeNotVerified */ $alias ?>" data-role="content">
3535
<?= /* @escapeNotVerified */ $html ?>
3636
</div>
3737
<?php endforeach;?>

app/code/Magento/ConfigurableProduct/Setup/InstallData.php

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,24 @@ public function install(ModuleDataSetupInterface $setup, ModuleContextInterface
5757
'color'
5858
];
5959
foreach ($attributes as $attributeCode) {
60-
$relatedProductTypes = explode(
61-
',',
62-
$eavSetup->getAttribute(\Magento\Catalog\Model\Product::ENTITY, $attributeCode, 'apply_to')
63-
);
64-
if (!in_array(Configurable::TYPE_CODE, $relatedProductTypes)) {
65-
$relatedProductTypes[] = Configurable::TYPE_CODE;
66-
$eavSetup->updateAttribute(
67-
\Magento\Catalog\Model\Product::ENTITY,
68-
$attributeCode,
69-
'apply_to',
70-
implode(',', $relatedProductTypes)
60+
if ($attribute = $eavSetup->getAttribute(
61+
\Magento\Catalog\Model\Product::ENTITY,
62+
$attributeCode,
63+
'apply_to'
64+
)) {
65+
$relatedProductTypes = explode(
66+
',',
67+
$attribute
7168
);
69+
if (!in_array(Configurable::TYPE_CODE, $relatedProductTypes)) {
70+
$relatedProductTypes[] = Configurable::TYPE_CODE;
71+
$eavSetup->updateAttribute(
72+
\Magento\Catalog\Model\Product::ENTITY,
73+
$attributeCode,
74+
'apply_to',
75+
implode(',', $relatedProductTypes)
76+
);
77+
}
7278
}
7379
}
7480
}

app/code/Magento/ConfigurableProduct/Setup/UpgradeData.php

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,18 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
4747

4848
if (version_compare($context->getVersion(), '2.2.0') < 0) {
4949
$relatedProductTypes = $this->getRelatedProductTypes('tier_price', $eavSetup);
50-
$key = array_search(Configurable::TYPE_CODE, $relatedProductTypes);
51-
if ($key !== false) {
52-
unset($relatedProductTypes[$key]);
53-
$this->updateRelatedProductTypes('tier_price', $relatedProductTypes, $eavSetup);
50+
if (!empty($relatedProductTypes)) {
51+
$key = array_search(Configurable::TYPE_CODE, $relatedProductTypes);
52+
if ($key !== false) {
53+
unset($relatedProductTypes[$key]);
54+
$this->updateRelatedProductTypes('tier_price', $relatedProductTypes, $eavSetup);
55+
}
5456
}
5557
}
5658

5759
if (version_compare($context->getVersion(), '2.2.1') < 0) {
5860
$relatedProductTypes = $this->getRelatedProductTypes('manufacturer', $eavSetup);
59-
if (!in_array(Configurable::TYPE_CODE, $relatedProductTypes)) {
61+
if (!empty($relatedProductTypes) && !in_array(Configurable::TYPE_CODE, $relatedProductTypes)) {
6062
$relatedProductTypes[] = Configurable::TYPE_CODE;
6163
$this->updateRelatedProductTypes('manufacturer', $relatedProductTypes, $eavSetup);
6264
}
@@ -78,10 +80,17 @@ public function upgrade(ModuleDataSetupInterface $setup, ModuleContextInterface
7880
*/
7981
private function getRelatedProductTypes(string $attributeId, EavSetup $eavSetup)
8082
{
81-
return explode(
82-
',',
83-
$eavSetup->getAttribute(Product::ENTITY, $attributeId, 'apply_to')
84-
);
83+
if ($attribute = $eavSetup->getAttribute(
84+
Product::ENTITY,
85+
$attributeId,
86+
'apply_to'
87+
)) {
88+
return explode(
89+
',',
90+
$attribute
91+
);
92+
}
93+
return [];
8594
}
8695

8796
/**

app/code/Magento/Tax/Plugin/Checkout/CustomerData/Cart.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@
66

77
namespace Magento\Tax\Plugin\Checkout\CustomerData;
88

9+
/**
10+
* Process quote items price, considering tax configuration.
11+
* @SuppressWarnings(PHPMD.CookieAndSessionMisuse)
12+
*/
913
class Cart
1014
{
1115
/**
@@ -68,6 +72,16 @@ public function afterGetSectionData(\Magento\Checkout\CustomerData\Cart $subject
6872
$this->itemPriceRenderer->setItem($item);
6973
$this->itemPriceRenderer->setTemplate('checkout/cart/item/price/sidebar.phtml');
7074
$result['items'][$key]['product_price']=$this->itemPriceRenderer->toHtml();
75+
if ($this->itemPriceRenderer->displayPriceExclTax()) {
76+
$result['items'][$key]['product_price_value'] = $item->getCalculationPrice();
77+
} elseif ($this->itemPriceRenderer->displayPriceInclTax()) {
78+
$result['items'][$key]['product_price_value'] = $item->getPriceInclTax();
79+
} elseif ($this->itemPriceRenderer->displayBothPrices()) {
80+
//unset product price value in case price already has been set as scalar value.
81+
unset($result['items'][$key]['product_price_value']);
82+
$result['items'][$key]['product_price_value']['incl_tax'] = $item->getPriceInclTax();
83+
$result['items'][$key]['product_price_value']['excl_tax'] = $item->getCalculationPrice();
84+
}
7185
}
7286
}
7387
}

lib/web/mage/tabs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ define([
7272

7373
if (anchor && isValid) {
7474
$.each(self.contents, function (i) {
75-
if ($(this).attr('id') === anchorId) {
75+
if ($(this).attr('id') === anchorId || $(this).find('#' + anchorId).length) {
7676
self.collapsibles.not(self.collapsibles.eq(i)).collapsible('forceDeactivate');
7777

7878
return false;

0 commit comments

Comments
 (0)