I created 2 new attribute and I want to use them to calculate price. I use this code but I don't know how to get the value of these attribute. Any ideas on the best way to do this? Thanks so much!
<?php
class GoIvvy_PriceFormula_Model_Observer
{
public function calculateFinalPrice($observer)
{
$_product = $observer->getEvent()->getProduct();
// $mount = ???
// $per = ???
$finalPrice = (100+$mount)*$per;
$_product->setFinalPrice($finalPrice);
return $this;
}
public function collectionFinalPrice($observer)
{
$collection = $observer->getEvent()->getCollection();
foreach($collection as $_product){
// $mount = ???
// $per = ???
$finalPrice = (100+$mount)*$per;
$_product->setMinimalPrice($finalPrice)
->setPrice($finalPrice)
->setFinalPrice($finalPrice);
}
return $this;
}
}