File tree Expand file tree Collapse file tree 3 files changed +14
-11
lines changed
app/code/Magento/PageBuilder
Block/Catalog/Block/Product/View
templates/catalog/product/view Expand file tree Collapse file tree 3 files changed +14
-11
lines changed Original file line number Diff line number Diff line change @@ -13,17 +13,20 @@ class Attributes extends \Magento\Catalog\Block\Product\View\Attributes
13
13
* Determine if we should display the attribute on the front-end, add support for exclude page builder & page
14
14
* builder only options on class.
15
15
*
16
+ * pagebuilder_attributes can be set to determine whether to include just Page Builder attributes or to exclude
17
+ * them.
18
+ *
16
19
* @param \Magento\Eav\Model\Entity\Attribute\AbstractAttribute $attribute
17
20
* @param array $excludeAttr
18
21
* @return bool
19
22
* @throws \Magento\Framework\Exception\LocalizedException
20
23
*/
21
- protected function shouldDisplay (
24
+ protected function isVisibleOnFrontend (
22
25
\Magento \Eav \Model \Entity \Attribute \AbstractAttribute $ attribute ,
23
26
array $ excludeAttr
24
27
) {
25
- return parent ::shouldDisplay ($ attribute , $ excludeAttr )
26
- && (($ this ->getExcludePagebuilder () && ! $ attribute ->getIsPagebuilderEnabled ())
27
- || ($ this ->getPagebuilderOnly () && $ attribute ->getIsPagebuilderEnabled ()));
28
+ return parent ::isVisibleOnFrontend ($ attribute , $ excludeAttr )
29
+ && (($ this ->getPagebuilderAttributes () && $ attribute ->getIsPagebuilderEnabled ())
30
+ || (! $ this ->getPagebuilderAttributes () && ! $ attribute ->getIsPagebuilderEnabled ()));
28
31
}
29
32
}
Original file line number Diff line number Diff line change 24
24
<container name =" product.info.description.wrapper" after =" main.content" before =" product.info.details.after.wrapper" htmlTag =" div" htmlClass =" page-main-description product-full-width-section" htmlId =" description" />
25
25
<!-- Create a new wrapper to house the custom Page Builder attributes -->
26
26
<container name =" product.attributes.pagebuilder.wrapper" after =" product.info.description.wrapper" before =" product.info.details.after.wrapper" htmlTag =" div" htmlClass =" page-main-pagebuilder-attributes" >
27
- <block class =" Magento\PageBuilder\Block\Catalog\Block\Product\View\Attributes" name =" product.attributes.only.pagebuilder" as =" additional.pagebuilder" template =" Magento_PageBuilder::catalog/product/view/title_attributes .phtml" >
27
+ <block class =" Magento\PageBuilder\Block\Catalog\Block\Product\View\Attributes" name =" product.attributes.only.pagebuilder" as =" additional.pagebuilder" template =" Magento_PageBuilder::catalog/product/view/attributes .phtml" >
28
28
<arguments >
29
- <argument name =" pagebuilder_only " xsi : type =" boolean" >true</argument >
29
+ <argument name =" pagebuilder_attributes " xsi : type =" boolean" >true</argument >
30
30
</arguments >
31
31
</block >
32
32
</container >
41
41
<!-- Create a new instance of attributes which excludes Page Builder attributes -->
42
42
<block class =" Magento\PageBuilder\Block\Catalog\Block\Product\View\Attributes" name =" product.attributes.exclude.pagebuilder" as =" additional" template =" Magento_Catalog::product/view/attributes.phtml" >
43
43
<arguments >
44
- <argument name =" exclude_pagebuilder " xsi : type =" boolean" >true </argument >
44
+ <argument name =" pagebuilder_attributes " xsi : type =" boolean" >false </argument >
45
45
</arguments >
46
46
</block >
47
47
</block >
Original file line number Diff line number Diff line change 14
14
$ helper = $ this ->helper (Magento \Catalog \Helper \Output::class);
15
15
$ product = $ block ->getProduct ();
16
16
?>
17
- <?php if ($ _additional = $ block ->getAdditionalData ()) : ?>
17
+ <?php if ($ additional = $ block ->getAdditionalData ()) : ?>
18
18
<div class="pagebuilder-attributes-wrapper">
19
- <?php foreach ($ _additional as $ _data ) : ?>
19
+ <?php foreach ($ additional as $ data ) : ?>
20
20
<div class="product-full-width-section">
21
21
<div class="page-main">
22
- <h2 class="product-section-title"><?= $ block ->escapeHtml (__ ($ _data ['label ' ])) ?> </h2>
22
+ <h2 class="product-section-title"><?= $ block ->escapeHtml (__ ($ data ['label ' ])) ?> </h2>
23
23
</div>
24
24
<div class="pagebuilder-attribute-wrapper">
25
- <?= /* @escapeNotVerified */ $ helper ->productAttribute ($ product , $ _data ['value ' ], $ _data ['code ' ]) ?>
25
+ <?= /* @noEscape */ $ helper ->productAttribute ($ product , $ data ['value ' ], $ data ['code ' ]) ?>
26
26
</div>
27
27
</div>
28
28
<?php endforeach ; ?>
You can’t perform that action at this time.
0 commit comments