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 7
7
8
8
namespace Magento \PageBuilder \Block \Catalog \Block \Product \View ;
9
9
10
+ use Magento \Framework \DataObject ;
11
+
12
+ /**
13
+ * Create a new instance of attributes which excludes Page Builder attributes
14
+ */
10
15
class Attributes extends \Magento \Catalog \Block \Product \View \Attributes
11
16
{
12
17
const DISPLAY_ATTRIBUTES_NON_PAGEBUILDER = 'non_pagebuilder ' ;
13
18
14
19
const DISPLAY_ATTRIBUTES_PAGEBUILDER_ONLY = 'pagebuilder_only ' ;
15
20
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
+
16
36
/**
17
37
* 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.
22
40
*
23
41
* @param \Magento\Eav\Model\Entity\Attribute\AbstractAttribute $attribute
24
42
* @param array $excludeAttr
You can’t perform that action at this time.
0 commit comments