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;
}
  • Why don't you use Promotions -> Catalog Price Rules to modify your products prices? – tecjam Feb 10 '15 at 9:43
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

  • 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 8:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.