如果没有特价,我想以特价或正常价格获得定制标签。我只能以特价获得自定义标签,但对于价格我不能,我不知道从哪里开始,也许还有其他如果。如果只有价格得到价格,如果特价得到特价,我需要帮助来构建选择。
<?php
// Get the Special Price
$specialprice = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialPrice() >= 500;
// Get price
$price = Mage::getModel('catalog/product')->load($_product->getId())->getPrice()>= 500;
// Get the Special Price FROM date
$specialPriceFromDate = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialFromDate();
// Get the Special Price TO date
$specialPriceToDate = Mage::getModel('catalog/product')->load($_product->getId())->getSpecialToDate();
// Get Current date
$today = time();
if ($specialprice):
if($today >= strtotime( $specialPriceFromDate) && $today <= strtotime($specialPriceToDate) || $today >= strtotime( $specialPriceFromDate) && is_null($specialPriceToDate)):
?>
<img src="picture/shipping.png" align="right" width="120" height="30" class="onsaleicon" />
<?php
endif;
endif;
?>
添加解决方案:
<?php
$specialprice = Mage::getModel('catalog/product')->load($_product->getId())->getFinalPrice();
if ($specialprice >= 500):
?>
<img src="picture/shipping.png" align="right" width="120" height="30" class="onsaleicon" />
<?php
endif;
?