本文共 552 字,大约阅读时间需要 1 分钟。
1
产品详细信息页面得到当前产品默认商店的的商品名称 ---NAME,和链接
$storeId = Mage::app()->getStore()->getId();
if($storeId!=1){ $product = Mage::getModel('catalog/product') ->setStoreId(1) ->load($_product->getId()); $stringpos = $product->getProductUrl(); $pos = strrpos($stringpos,"?"); $stringpos =substr($stringpos,0,$pos); $productname = $product->getName();echo "<a href='".$stringpos.$productname."'>".$productname."</a>"
}2
产品分类页面得到当前分类ID:
$layer = Mage::getSingleton(‘catalog/layer’);
$_category = $layer->getCurrentCategory(); $currentCategoryId= $_category->getId();
转载地址:http://zccli.baihongyu.com/