3

I use this function to modify the price display on homepage. But I don't know how to get the value of attributes. Any ideas on the best way to do this? Thanks so much!

public function collectionFinalPrice($observer) {
    $collection = $observer->getEvent()->getCollection();
    foreach($collection as $_product){
    // $per = ???
    // $amount = ???
    $finalPrice = (1000+$amount)*$per;
    $_product->setMinimalPrice($finalPrice)
              ->setPrice($finalPrice)
              ->setFinalPrice($finalPrice);
    }
    return $this;
}
user2045
  • 831
  • 3
  • 16
  • 29
tuanptit
  • 339
  • 2
  • 5
  • 12

1 Answers1

2

tuanptit,i have see last question.You need to some clarification on current question and previous question.

  1. Magento is change the final price of product using different process example like Catalog Rules,trier price and special etc. SO any process may interrupt your final price calculation.

2.As you want to change the price of only for home then it too hard to change.That may be impossible from my point of view

Amit Bera
  • 77,456
  • 20
  • 123
  • 237
  • Thank you for your response. I want to change the price in everywhere, not only on homepage. I am a newbie in Magento, please help me – tuanptit Feb 10 '15 at 08:36