我知道这可以在布局文件上使用 before
和 after
来完成,但是有人可以向我解释一下吗?比方说,我想将简短描述
放在“价格”下,或者只是换个地方。或者将price
放在SKU
所在的位置。我希望有人解释这是如何工作的以及我如何实现这一目标。
另外,是否可以按类别进行?
我非常感谢您的帮助。非常感谢。
最佳答案
要检查的第一个 phtml 文件可能是 yourtheme/template/catalog/product/view.phtml
。
如果您在该文件中执行 Ctrl+查找,您将找到这些属性的位置( short_description
、 price
等)。
例如你可以剪
<?php if ($_product->getShortDescription()):?>
<div class="short-description">
<div class="std"><?php echo $_helper->productAttribute($_product, nl2br($_product->getShortDescription()), 'short_description') ?></div>
</div>
<?php endif;?>
然后粘贴到<div class="price-info">...</div>
的末尾
(右键检查元素是你的 friend
我建议您还启用模板路径提示。转到 admin->system
,将当前配置范围更改为您的商店之一(靠近左上角),然后单击开发者(开发者在左下角)。然后在中间的 Debug 菜单中,将 Template Path Hints 更改为 Yes。这允许您查看哪些模板 phtml 文件服务于您前端的哪些部分。)
关于css - 更改产品页面上产品信息的顺序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31042099/