我怎样才能获得修改Magento的这个价格功能 [英] How can I get access to modify this price function in Magento

查看:103
本文介绍了我怎样才能获得修改Magento的这个价格功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我现在需要定制的折扣价我的购物车。我想通过自己的研究它,我意识到我可以修改 view.phtml item.phtml ,以显示正确的价格。但我并不满足,所以我的眼睛在这条线的code:

So I now need to customize the discounted price for my Shopping cart. I'd research it by myself and I realize i can modify the view.phtml and item.phtml in order to display the right price. But i am not satisfied, therefore my eyes on this line of code:

< PHP的echo $这个 - >帮手('结账') - > formatPrice($ _本期特价货品> getCalculationPrice())>

我presume此行code的功能就是打电话,从电话的地方结帐的辅助部分的价格,将其返回。我的问题是我怎么能访问到那里。

I presume this line of code's function is to call the price from somewhere call checkout in helper section and return it. My question is how can i get access to there.

感谢你了。

更新1: 我做了一些研究之后,航标给了我一些建议,然后我潜入文件 DATA.php ,发现他提到,其功能是:

UPDATE 1: I did some research after aton gave me some tips then i dive into the file DATA.php and found the function he mentioned which is:

public function formatPrice($price)
{
    return $this->getQuote()->getStore()->formatPrice($price);
}

但是,有没有什么办法可以下潜更深地陷入 $这个 - >的getQuote() - > getStore() - > formatPrice($价格);

再次感谢。

推荐答案

在你的价格上面提到的code从 $来临_本期特价货品> getCalculationPrice()

In the code you have mentioned above the price is coming from $_item->getCalculationPrice().

在code

< PHP的echo $这个 - >帮手('结账') - > formatPrice($ _本期特价货品> getCalculationPrice())>

只是根据你的店和其他的东西需要价格和格式它即增加了货币符号。

just takes the price and formats it i.e adds the currency symbol according to your store and other things.

在哪里 formatPrice 函数所在的导航到

If you want to know where is the formatPrice function resides navigate to

应用程序/ code /核心/法师/结帐/助手/ Data.php

app/code/core/Mage/checkout/Helper/Data.php

在这里你会看到该函数的认定中。

Here you will see the defination of that function.

希望这会有所帮助。

这篇关于我怎样才能获得修改Magento的这个价格功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆