如何在 Magento 的元描述中附加 sku。?
How to append sku in meta description in Magento.?
我想使用 php 代码在 Magento 的元描述中附加 sku。谁能帮我解决这个问题。
<?php
//set empty title
$title = '';
if ($_product = Mage::registry('current_product'))
{
$title = $_product->getName();
$pos = stripos($title);
if($pos === false )
{
$title = $this->getTitle();
}
?>
<meta name="description" content="<?php echo $title?>.Wide range of shipping destinations. Call us now for more info about our products: 01202 600596. Contact us to discuss our returns policy"/>
经过大量深入研究后,我找到了解决方案并且工作正常。
<?php
//set empty title
$title = '';
if ($_product = Mage::registry('current_product'))
{
$title = $_product->getName();
$sku = $_product->getSku();
$pos = stripos($title, $sku);
if($pos === false )
{
//no sku already - append now
$title.= ' - ' . $sku;
}
}
else
{
$title = $this->getTitle();
}
?>
<meta name="description" content="<?php echo $title?>.Wide range of shipping destinations. Call us now for more info about our products: 01202 600596. Contact us to discuss our returns policy"/>
Export products (System>Import/Export) 并为您提供 csv 结构。您可以删除所有列,但保留 sku、商店和元描述。将你想要的数据放入csv。将其保存为 UTF-8(不要使用 MS excel!)并导入(System>Import/Export)替换现有数据。请确保您首先在开发站点上尝试此操作,并在导入前使用 'check data' 函数确保一切正确。祝你好运。
我想使用 php 代码在 Magento 的元描述中附加 sku。谁能帮我解决这个问题。
<?php
//set empty title
$title = '';
if ($_product = Mage::registry('current_product'))
{
$title = $_product->getName();
$pos = stripos($title);
if($pos === false )
{
$title = $this->getTitle();
}
?>
<meta name="description" content="<?php echo $title?>.Wide range of shipping destinations. Call us now for more info about our products: 01202 600596. Contact us to discuss our returns policy"/>
经过大量深入研究后,我找到了解决方案并且工作正常。
<?php
//set empty title
$title = '';
if ($_product = Mage::registry('current_product'))
{
$title = $_product->getName();
$sku = $_product->getSku();
$pos = stripos($title, $sku);
if($pos === false )
{
//no sku already - append now
$title.= ' - ' . $sku;
}
}
else
{
$title = $this->getTitle();
}
?>
<meta name="description" content="<?php echo $title?>.Wide range of shipping destinations. Call us now for more info about our products: 01202 600596. Contact us to discuss our returns policy"/>
Export products (System>Import/Export) 并为您提供 csv 结构。您可以删除所有列,但保留 sku、商店和元描述。将你想要的数据放入csv。将其保存为 UTF-8(不要使用 MS excel!)并导入(System>Import/Export)替换现有数据。请确保您首先在开发站点上尝试此操作,并在导入前使用 'check data' 函数确保一切正确。祝你好运。