File tree Expand file tree Collapse file tree 1 file changed +22
-4
lines changed
app/code/Magento/PageBuilder/Block/Catalog/Block/Product/View Expand file tree Collapse file tree 1 file changed +22
-4
lines changed Original file line number Diff line number Diff line change 77
88namespace Magento \PageBuilder \Block \Catalog \Block \Product \View ;
99
10+ use Magento \Framework \DataObject ;
11+
12+ /**
13+ * Create a new instance of attributes which excludes Page Builder attributes
14+ */
1015class Attributes extends \Magento \Catalog \Block \Product \View \Attributes
1116{
1217 const DISPLAY_ATTRIBUTES_NON_PAGEBUILDER = 'non_pagebuilder ' ;
1318
1419 const DISPLAY_ATTRIBUTES_PAGEBUILDER_ONLY = 'pagebuilder_only ' ;
1520
21+ /**
22+ * @inheritdoc
23+ */
24+ public function getProduct ()
25+ {
26+ $ product = parent ::getProduct ();
27+
28+ if (!$ product ) {
29+ $ product = new DataObject ();
30+ $ product ->setAttributes ([]);
31+ }
32+
33+ return $ product ;
34+ }
35+
1636 /**
1737 * Determine if we should display the attribute on the front-end, add support for exclude page builder & page
18- * builder only options on class.
19- *
20- * display_attributes can be set to determine whether to include just Page Builder attributes or to exclude
21- * them.
38+ * builder only options on class. display_attributes can be set to determine whether to include just Page Builder
39+ * attributes or to exclude them.
2240 *
2341 * @param \Magento\Eav\Model\Entity\Attribute\AbstractAttribute $attribute
2442 * @param array $excludeAttr
You can’t perform that action at this time.
0 commit comments