Jump to content

Total in shopping cart summary


ps2k11

Recommended Posts

Using Prestashop 1.7.4.2

I found this information to add total in shopping cart summary

<span class="label">Total (tax + shipping incl.)</span>
      <span class="value">{$currency.iso_code}{$currency.sign}{$cart.totals.total.amount+$cart.subtotals.tax.amount}</span> 

I use different languages, want translate the label Total (tax + shipping incl.) but not sure how to

in previous versions of prestashop the l s would add labels in translations but not version 1.7

Not sure why no total in cart summary, I guess customer have to use a calculator now

 

  • Like 1
Link to comment
Share on other sites

13 hours ago, ps2k11 said:

Using Prestashop 1.7.4.2

I found this information to add total in shopping cart summary

<span class="label">Total (tax + shipping incl.)</span>
      <span class="value">{$currency.iso_code}{$currency.sign}{$cart.totals.total.amount+$cart.subtotals.tax.amount}</span> 

I use different languages, want translate the label Total (tax + shipping incl.) but not sure how to

in previous versions of prestashop the l s would add labels in translations but not version 1.7

Not sure why no total in cart summary, I guess customer have to use a calculator now

 

 

follow as per Knowband suggested you then go to Backoffice international/translation. Select your theme and language to modify it in your language.

Link to comment
Share on other sites

  • 2 weeks later...

Hi,

Use in Prestashop 1.7.4.2 with two digits after the decimal point and the translations !!

- for cart-summary-totals.tpl

{block name='cart_summary_total'}
    <div class="cart-summary-line cart-total">
      <span class="label">{l s='Total (tax + shipping incl.)' d='Shop.Forms.Labels'}</span>
      <span class="value">{$cart.totals.total.amount + $cart.subtotals.tax.amount|string_format:"%.2f"} {$currency.sign}</span>
    </div>
 {/block}

-----------------------------------------------------

 - For order-confirmation-table.tpl

        <tr class="font-weight-bold">
          <td><span class="text-uppercase">{$totals.total.label}</span> {$labels.tax_short}</td>
          <td>{$totals.total.value}</td>
          </tr>
          <tr class="font-weight-bold">
          <td><span class="text-uppercase">{l s='Total' d='Shop.Forms.Labels'}</span></td>
          <td>{$totals.total.amount + $subtotals.tax.amount|string_format:"%.2f"} {$currency.sign}</td>
        </tr>
      </table>

----------------------------------------------------

- For cart_detailed_totals.tpl

{block name='cart_detailed_totals'}
<div class="cart-detailed-totals">

  <div class="card-block">
    {foreach from=$cart.subtotals item="subtotal"}
      {if $subtotal.value && $subtotal.type !== 'tax'}
        <div class="cart-summary-line" id="cart-subtotal-{$subtotal.type}">
          <span class="label{if 'products' === $subtotal.type} js-subtotal{/if}">
            {if 'products' == $subtotal.type}
              {$cart.summary_string}
            {else}
              {$subtotal.label}
            {/if}
          </span>
          <span class="value">{$subtotal.value}</span>
          {if $subtotal.type === 'shipping'}
              <div><small class="value">{hook h='displayCheckoutSubtotalDetails' subtotal=$subtotal}</small></div>
          {/if}
        </div>
      {/if}
    {/foreach}
  </div>

  {block name='cart_voucher'}
    {include file='checkout/_partials/cart-voucher.tpl'}
  {/block}

  <hr class="separator">

  <div class="card-block">
    <div class="cart-summary-line cart-total">
      <span class="label">{$cart.totals.total.label} {$cart.labels.tax_short}</span>
      <span class="value">{$cart.totals.total.value}</span>
    </div>

    <div class="cart-summary-line">
      <small class="label">{$cart.subtotals.tax.label}</small>
      <small class="value">{$cart.subtotals.tax.value}</small>
    </div>
    
    <div class="cart-summary-line cart-total">
      <span class="label">{l s='Total' d='Shop.Forms.Labels'}</span>
      <span class="value">{$cart.totals.total.amount + $cart.subtotals.tax.amount|string_format:"%.2f"} {$currency.sign}</span>
    </div>
  </div>

  <hr class="separator">
</div>
{/block}
 

Salut

 

Link to comment
Share on other sites

  • 1 month later...
  • 5 months later...
  • 3 weeks later...

Thank you for this solution. I have a problem though.

When i change language to english the euro icon goes to the front of the price in the rest of the page.  The only currency for the shop is euros. Is there a way to change to placement for english to front of the price and for Greek language to the back?

currency.jpg

Link to comment
Share on other sites

  • 4 weeks later...
  • 2 weeks later...

I have a Prestashop 1.7 multistore where I need to get the shipping cost from variable (instead of writing it in normal text) since the shipping cost varies a lot depending on chosen currency.

I want to be able to get this in the header, and on the index/homepage.


I currently use this in the header to get the shipping:
{$cart.subtotals.shipping.amount}
And that works fine, except for when the cart is empty or when the free shipping amount is triggered. :(

Is there a way to get the default shipping cost even when the cart is empty and such?

Link to comment
Share on other sites

  • 3 months later...
  • 1 month later...
  • 2 weeks later...

Hello,
My version of Prestashop 1.7.5.1 is making the changes described in
/ Themes / warehouse / templates / checkout / _partials /
No change is visible. Clearing cache doesn't help. I did it from the administration panel and from the ftp level.

Link to comment
Share on other sites

On 10/23/2019 at 2:18 PM, rmx333 said:

Hello,
My version of Prestashop 1.7.5.1 is making the changes described in
/ Themes / warehouse / templates / checkout / _partials /
No change is visible. Clearing cache doesn't help. I did it from the administration panel and from the ftp level.

 

I have also Wharehouse . I did from Plek in cart-summary-totals.tpl and works fine. I did the chage also in  order-confirmation-table.tpl but nothing visible. Is it different from FTP ?

Link to comment
Share on other sites

  • 8 months later...

Hello i try the following files :

cart-detailed-totals.tpl 2.58 kB · 46 downloads

cart-summary-totals.tpl 1.78 kB · 39 downloads

order-confirmation-table.tpl 5.15 kB · 37 downloads

i think they work perfectly but only one thing in the first step something like that on screen shoot

In other word i did not get the total amount included V.a.t.

in the second and third step everything is ok , shall anyone tell me how to get price with v.a.t. on chart?

 

Thanks

Regards

Maurice

 

screenvat.png

Link to comment
Share on other sites

  • 5 weeks later...
  • 1 year later...

 {$ cart.totals.total.amount + $ cart.subtotals.tax.amount | string_format: "%. 2f"} {$ currency.sign} 

 

replace for 

 

{$cart.totals.total_including_tax.value} 

 

the full div would be

  <div class = "cart-summary-line cart-total">
       <span class = "label"> {$ cart.totals.total_including_tax.label} </span>
       <span class = "value"> {$ cart.totals.total_including_tax.value} </span>
     </div>

Edited by msarmiento (see edit history)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...