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 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"
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
You can’t perform that action at this time.
0 commit comments