Good afternoon guys! I wonder if it is possible and what is the file (path) to change getFinalPrice ()
function in magento, because I need to add some fixed calculations about the product.
Thank you!
magento-1.8
Good afternoon guys! I wonder if it is possible and what is the file (path) to change getFinalPrice ()
function in magento, because I need to add some fixed calculations about the product.
Thank you!
Best Answer
The function is in the Price Model for the product type - for the bundle for example in
app/code/core/Mage/Bundle/Model/Product/Price.php
And provides you with a nice event that you can use:
In your observer for
catalog_product_get_final_price
just useIf you need to get the current final price use
$product->getData('final_price')
as$product->getFinalPrice()
would create an infinite loop.