如果你想在Magento中设置一个“特价”的商品,你必须设置一个“特价”。特殊价格使您可以在指定时间段内定义产品的折扣价格。
我的问题是如何在我的分层导航中添加链接,以显示我所有的“特价”/“特价”项目。
谢谢
发布于 2013-05-22 13:35:31
请查看以下url以执行此操作。
第31行近似处存在语法错误,因此
echo '<img src="'.$this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135);.'" width="135" height="135" alt=".$this->htmlEscape($this->getImageLabel($_product, 'small_image')).'" title="'.$this->htmlEscape($this->getImageLabel($_product, 'small_image')).'" />用下面的代码替换上面的行
echo '<img src="'.$this->helper('catalog/image')->init($_product, 'small_image')->resize(135, 135).'" width="135" height="135" alt="'.$this->htmlEscape($this->getImageLabel($_product, 'small_image')).'" title="'.$this->htmlEscape($this->getImageLabel($_product, 'small_image')).'" />发布于 2013-10-22 21:31:45
调用此函数:
public function getSpecialProduct(){
$sql = "SELECT
cp.*,
ea.*
FROM
catalog_category_product AS cp
INNER JOIN
catalog_product_entity_decimal AS pei ON
pei.entity_id=cp.product_id
AND
pei.attribute_id =76
AND
pei.value >0
NATURAL JOIN
eav_attribute AS ea
WHERE
ea.attribute_code='special_price'
group by
cp.product_id";
$data = Mage::getSingleton('core/resource') ->getConnection('core_read')->fetchAll($sql);
foreach($data as $row)
$arr[] = Mage::getModel('catalog/product')->setStoreId($storeId)->load($row['product_id']);
return $arr;
} https://stackoverflow.com/questions/16681373
复制相似问题