Question

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') ?>
Was it helpful?

Solution

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>
Licensed under: CC-BY-SA with attribution
Not affiliated with magento.stackexchange
scroll top