Skip to content

Commit af55d2b

Browse files
Chhandak.BaruaChhandak.Barua
authored andcommitted
ACP2E-900 Description tab content looks mess-up while page loading on PDP
1 parent 4922fef commit af55d2b

File tree

1 file changed

+11
-13
lines changed
  • app/code/Magento/Catalog/view/frontend/templates/product/view

1 file changed

+11
-13
lines changed

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

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
<div class="product info detailed">
1212
<?php $layout = $block->getLayout(); ?>
1313
<div class="product data items" data-mage-init='{"tabs":{"openedState":"active"}}'>
14-
<?php $counter=0; foreach ($detailedInfoGroup as $name):?>
14+
<?php $hideTabContent = false; ?>
15+
<?php foreach ($detailedInfoGroup as $name):?>
1516
<?php
1617
$html = $layout->renderElement($name);
1718
if (!$html || !trim($html)) {
1819
continue;
1920
}
20-
$counter ++;
2121
$alias = $layout->getElementAlias($name);
2222
$label = $block->getChildData($alias, 'title');
2323
?>
24-
<div class="data item title"
24+
<div class="data item title <?= !$hideTabContent ? 'active' : ''?>"
2525
data-role="collapsible" id="tab-label-<?= $block->escapeHtmlAttr($alias) ?>">
2626
<a class="data switch"
2727
tabindex="-1"
@@ -36,17 +36,15 @@
3636
id="<?= $block->escapeHtmlAttr($alias) ?>" data-role="content">
3737
<?= /* @noEscape */ $html ?>
3838
</div>
39+
<?= $hideTabContent
40+
? /* @noEscape */ $secureRenderer->renderStyleAsTag(
41+
'display: none;',
42+
'#' . $block->escapeHtmlAttr($alias)
43+
)
44+
: '' ?>
45+
<?php $hideTabContent = true; ?>
3946
<?php endforeach;?>
4047
</div>
4148
</div>
42-
<?php if ($counter > 1): ?>
43-
<?php $scriptString = <<<script
44-
if ( document.getElementById("reviews") ) {
45-
document.getElementById("reviews").style.display="none";
46-
}
47-
script;
48-
?>
49-
<?= /* @noEscape */ $secureRenderer->renderTag('script', [], $scriptString, false); ?>
50-
<?php endif;
51-
endif; ?>
49+
<?php endif; ?>
5250

0 commit comments

Comments
 (0)