Martin
Martin

Reputation: 362

Prestashop - basket total price

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?

Upvotes: 5

Views: 7695

Answers (2)

Matthew Morek
Matthew Morek

Reputation: 2834

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 Prestashop v1.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 to false.

For Prestashop v1.5+ you should use: Context::getContext()->cart->getOrderTotal(true);

Upvotes: 3

moein kh
moein kh

Reputation: 479

if you use the prestashop version 1.5 you should use this:

  Context::getContext()->cart->getOrderTotal(true);

best regards

Upvotes: 4

Related Questions