File tree Expand file tree Collapse file tree 1 file changed +11
-13
lines changed
app/code/Magento/Catalog/view/frontend/templates/product/view Expand file tree Collapse file tree 1 file changed +11
-13
lines changed Original file line number Diff line number Diff line change 11
11
<div class="product info detailed">
12
12
<?php $ layout = $ block ->getLayout (); ?>
13
13
<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 ):?>
15
16
<?php
16
17
$ html = $ layout ->renderElement ($ name );
17
18
if (!$ html || !trim ($ html )) {
18
19
continue ;
19
20
}
20
- $ counter ++;
21
21
$ alias = $ layout ->getElementAlias ($ name );
22
22
$ label = $ block ->getChildData ($ alias , 'title ' );
23
23
?>
24
- <div class="data item title"
24
+ <div class="data item title <?= ! $ hideTabContent ? ' active ' : '' ?> "
25
25
data-role="collapsible" id="tab-label-<?= $ block ->escapeHtmlAttr ($ alias ) ?> ">
26
26
<a class="data switch"
27
27
tabindex="-1"
36
36
id="<?= $ block ->escapeHtmlAttr ($ alias ) ?> " data-role="content">
37
37
<?= /* @noEscape */ $ html ?>
38
38
</div>
39
+ <?= $ hideTabContent
40
+ ? /* @noEscape */ $ secureRenderer ->renderStyleAsTag (
41
+ 'display: none; ' ,
42
+ '# ' . $ block ->escapeHtmlAttr ($ alias )
43
+ )
44
+ : '' ?>
45
+ <?php $ hideTabContent = true ; ?>
39
46
<?php endforeach ;?>
40
47
</div>
41
48
</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 ; ?>
52
50
You can’t perform that action at this time.
0 commit comments