Prestashop - 购物篮总价
又是我提出另一个 Prestashop 问题。
在我的模板中,我想在不使用那里的模块的情况下显示购物车(购物车)中的总价,只需在那里显示总价并链接到购物车...是否有一个函数,可以从系统?
gettotalprice
或者类似的东西?
it's me again with another Prestashop question.
In my template, I'd like to display total price in basket (cart) without using the module there, jsut simply display total price there and link to the basket ... is there a function, that will get this information from within the system?
gettotalprice
Or something like that?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果你使用 prestashop 1.5 版,你应该使用这个:
最好的问候
if you use the prestashop version 1.5 you should use this:
best regards
是的,有一个 SMARTY 函数,您可以在模板中使用它:
{$cart->getOrderTotal(true)}
,但它仅适用于 Prestashopv1 .5
,如下面的评论所述。上面的代码将显示含税的购物车总价。如果您不希望税费包含在总额中,请将参数从
true
更改为false
。对于 Prestashop
v1.5+
,您应该使用:Context::getContext()->cart->getOrderTotal(true);
Yes, there is and it's a SMARTY function which you can use in your templates:
{$cart->getOrderTotal(true)}
, though it only works up to Prestashopv1.5
, as noted in the comment below.The code above will display total cart price with tax. If you don't want tax to be included in your total, change the parameter from
true
tofalse
.For Prestashop
v1.5+
you should use:Context::getContext()->cart->getOrderTotal(true);