Note that there are some explanatory texts on larger screens.

plurals
  1. POMagento: how to get the price of a product with catalog rules applied
    primarykey
    data
    text
    <p>I'm developing a script (external to Magento, not a module) which aims to output a text list of all available products, their prices and some other attributes. However, catalog price rules don't seem to be applied to product prices. If I use any of the following:</p> <pre><code>$_product-&gt;getPrice() $_product-&gt;getFinalPrice() </code></pre> <p>I get the normal price (without rules being applied).</p> <p>If I use:</p> <pre><code>$_product-&gt;getSpecialPrice() </code></pre> <p>I get <strong>null</strong> unless the product actually has a special price inserted in the product itself (i.e. if special price is not related with catalog rules).</p> <p>I also tried </p> <pre><code>Mage::getModel('catalogrule/rule')-&gt;calcProductPriceRule($product,$product-&gt;getPrice()) </code></pre> <p>as suggested in the answer given by Fabian Blechschmidt, but interestingly it returns the normal price only if the product is affected by any catalog rule, returning <strong>null</strong> otherwise.</p> <p>There was a similar question in <a href="https://stackoverflow.com/questions/9684964/how-can-get-final-price-with-applied-price-rule-in-magento">StackOverflow</a> and <a href="http://www.magentocommerce.com/boards/viewthread/210839/#t398210" rel="nofollow noreferrer">Magento Forums</a> some time ago, but the provided answer (which is to insert the code bellow) doesn't work for me (returned prices remain the same).</p> <pre><code>Mage::app()-&gt;loadAreaPart(Mage_Core_Model_App_Area::AREA_FRONTEND,Mage_Core_Model_App_Area::PART_EVENTS); </code></pre> <p>Does anybody have an idea of how to achieve this?</p> <p>I'm using Magento 1.6.2.0. Thanks in advance.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload