File tree Expand file tree Collapse file tree 3 files changed +19
-2
lines changed
app/code/Magento/PageBuilder
Block/Catalog/Block/Product/View
view/frontend/templates/catalog/product/view Expand file tree Collapse file tree 3 files changed +19
-2
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
+
10
12
class Attributes extends \Magento \Catalog \Block \Product \View \Attributes
11
13
{
12
14
const DISPLAY_ATTRIBUTES_NON_PAGEBUILDER = 'non_pagebuilder ' ;
13
15
14
16
const DISPLAY_ATTRIBUTES_PAGEBUILDER_ONLY = 'pagebuilder_only ' ;
15
17
18
+ /**
19
+ * @inheritdoc
20
+ */
21
+ public function getProduct ()
22
+ {
23
+ $ product = parent ::getProduct ();
24
+
25
+ if (!$ product ) {
26
+ $ product = new DataObject ();
27
+ $ product ->setAttributes ([]);
28
+ }
29
+
30
+ return $ product ;
31
+ }
32
+
16
33
/**
17
34
* Determine if we should display the attribute on the front-end, add support for exclude page builder & page
18
35
* builder only options on class.
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 ($ product && ( $ additional = $ block ->getAdditionalData () )) : ?>
17
+ <?php if ($ additional = $ block ->getAdditionalData ()) : ?>
18
18
<div class="pagebuilder-attributes-wrapper">
19
19
<?php foreach ($ additional as $ data ) : ?>
20
20
<div class="product-full-width-section">
Original file line number Diff line number Diff line change 9
9
*
10
10
* @var \Magento\Framework\View\Element\Template $block
11
11
*/
12
- $ childHtml = $ block ->getProduct () ? $ block -> getChildHtml () : '' ;
12
+ $ childHtml = $ block ->getChildHtml ();
13
13
?>
14
14
<?php if (trim ($ childHtml ) !== "" ) : ?>
15
15
<div class="product-full-width-section">
You can’t perform that action at this time.
0 commit comments