Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

So I am working on \app\code\core\Mage\Checkout\Helper\Data.php at the moment. And I am trying to call a variable but it doesn't seem It's working.

UPDATE 1 I have been able to pass the variable by method like this, but I need to declare the product ID manually, is there anything allows the method get the product id base on the product i added into cart?

$_productId = Mage::registry('current_product')->getId(); 

is not working in my case.

My test as below:

      public function formatPrice($price)
{


    $_productId = 463089; // need to call the current product by the enter the ID manually 
    $_product = Mage::getModel('catalog/product')->load($_productId);
    $oldPrice = $_product->getFinalPrice(); //should be the original product price



    return $this->getQuote()->getStore()->formatPrice($oldPrice);


}

The result after i refresh my page : enter image description here

everything turns to 670

Many thanks

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.