2

Magento: what is the definition of '$_product->unsFinalPrice()' ? Please explain me.

My issue is When I'm update the product price in admin panel, Price not getting updated in product listing page. But details page was fine. If I load the product Mage::getModel('catalog/product')->load($_product->getId()) was fine, But I don't want to load the product each time.

1
  • You need redindex from index management from admin
    – Amit Bera
    Commented Jul 16, 2015 at 7:46

2 Answers 2

1

The definition of $_product->unsFinalPrice() is to unset FinalPrice on product object.

This are magic methods that magento implements like this:

public function __call($method, $args)
{
    switch (substr($method, 0, 3)) {
        case 'get' :
            //Varien_Profiler::start('GETTER: '.get_class($this).'::'.$method);
            $key = $this->_underscore(substr($method,3));
            $data = $this->getData($key, isset($args[0]) ? $args[0] : null);
            //Varien_Profiler::stop('GETTER: '.get_class($this).'::'.$method);
            return $data;

        case 'set' :
            //Varien_Profiler::start('SETTER: '.get_class($this).'::'.$method);
            $key = $this->_underscore(substr($method,3));
            $result = $this->setData($key, isset($args[0]) ? $args[0] : null);
            //Varien_Profiler::stop('SETTER: '.get_class($this).'::'.$method);
            return $result;

        case 'uns' :
            //Varien_Profiler::start('UNS: '.get_class($this).'::'.$method);
            $key = $this->_underscore(substr($method,3));
            $result = $this->unsetData($key);
            //Varien_Profiler::stop('UNS: '.get_class($this).'::'.$method);
            return $result;

        case 'has' :
            //Varien_Profiler::start('HAS: '.get_class($this).'::'.$method);
            $key = $this->_underscore(substr($method,3));
            //Varien_Profiler::stop('HAS: '.get_class($this).'::'.$method);
            return isset($this->_data[$key]);
    }
    throw new Varien_Exception("Invalid method ".get_class($this)."::".$method."(".print_r($args,1).")");
}
0

You need re indexing from index management(basically Product Prices) from admin.That will resolved the issue in listing page.it magento basic.

If Catalog price rules then it may be affect on listing page price.You need to check that.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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