小编use*_*269的帖子

在magento head.phtml中回显产品属性

我试图通过使用自定义属性在Magento中为产品设置我自己的自定义规范链接但我无法在head.phtml文件中获取该属性.这就是我到目前为止所拥有的.请有人帮忙吗?

<?php if (Mage::registry('current_product')) : ?>
<?php $customcanonical = Mage::registry(‘current_product’)->getData(‘canonical_link’); ?>
<link rel="canonical" content="<?php echo $customcanonical ?>" />
<?php endif; ?>
Run Code Online (Sandbox Code Playgroud)

其中canonical_link是我的自定义属性

magento canonical-link magento-1.7

4
推荐指数
1
解决办法
2084
查看次数

标签 统计

canonical-link ×1

magento ×1

magento-1.7 ×1