I have a custom script located in the root of magento and here i takle all the product prices and create a csv with those values.
I have a problem with the product price when I tried apply a discount rule.
Even in the fronted, it show me the correct price, i mean the price after discount, in my csv i can't take this price.
When I applied a discount rule, in csv i recive the normal price.
This is my code for taking the discounted price:
foreach($collection as $product) {
//load product by id
$product = Mage::getModel('catalog/product')->load($product->getId());
//take tier price
$existingTierPrice = $product->tier_price;
**//get promo_price**
$promo_price = Mage::getModel('catalogrule/rule')->calcProductPriceRule($product,$product->getPrice());
if(!$promo_price && $netto_price =='No'){
$special_price = $_specialPrice = $product->getFinalPrice();
}elseif($netto_price =='No' && $promo_price){
$special_price = $promo_price;
}else{
$special_price = NULL;
}
$netto_price it's to No.
Does anyone know why i can't take this discounted price?
Best Answer
//We use to get product price like