Magento Change Product Page Titles to Include Attributes

后端 未结 5 2062
难免孤独
难免孤独 2020-12-15 01:43

I have 2 custom attributes I\'d like to add to the </code> tags on product pages. They are \'brand\' and \'subtitle\'.</p> <p>My page title would end up <script async src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script> <ins class="adsbygoogle" style="display:block" data-ad-client="ca-pub-5408099190056760" data-ad-slot="7305827575" data-ad-format="auto" data-full-width-responsive="true"></ins> <script> (adsbygoogle = window.adsbygoogle || []).push({}); </script> </div> </div> <div class="fly-panel detail-box" id="flyReply"> <fieldset class="layui-elem-field layui-field-title" style="text-align: center;"> <legend>5条回答</legend> </fieldset> <ul class="jieda" id="jieda"> <li data-id="111" class="jieda-daan"> <a name="item-1111111111"></a> <div class="detail-about detail-about-reply"> <a class="fly-avatar" href=""> <img src="https://www.e-learn.cn/qa/data/avatar/000/00/00/small_000000026.jpg" alt=" 星月不相逢 "> </a> <div class="fly-detail-user"> <a href="" class="fly-link"> <cite> 星月不相逢</cite> </a> <span>(楼主)</span> </div> <div class="detail-hits"> <span>2020-12-15 02:04</span> </div> </div> <div class="detail-body jieda-body photos"> <p> <p>Assuming that you only want to change the product title on the catalog view page</p> <p>In app/design/frontend/default/{your theme Folder}/template/page/html/head.phtml you could </p> <pre><code><?php if ($_product = Mage::registry('current_product')) { ?> <title><?php echo $_product->getData('xyz') . ' ' . $_product->getName(); ?> <?php echo $this->getTitle() ?>

See Get Attribute Name And Value Magento

提交回复
热议问题