2

I am trying to add the product title and short description within the product tabs on the luma theme. With short description, I am happy to use the move object to place this into the tabs but I need to style it with a tag, with the product title I want to replicate this so I will have it as a h1 and h3. Below is the code I have added to description.phtml but I cannot get this to render correctly

<h3><?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getName())) ?></h3>
<h4><?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getShortDescription())) ?></h4>
<?= /* @escapeNotVerified */ $this->helper('Magento\Catalog\Helper\Output')->productAttribute($block->getProduct(), $block->getProduct()->getDescription(), 'description') ?>

1 Answer 1

0

I ended up getting this working but adding following to details.phtml

<div class="data item content" id="<?= /* @escapeNotVerified */ $alias ?>" data-role="content">
                    <?php if ($alias === 'description') { ?>
                        <h3 class="page-title"><span class="base"><?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getName())) ?></span></h3>
                                <h4><?= $block->escapeHtmlAttr($block->stripTags($block->getProduct()->getShortDescription())) ?></h4>
                            <?php } ?>

                    <?= /* @escapeNotVerified */ $html ?>
                </div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.