Jump to content

Displaying total discount on cart page - PS 1.7


Recommended Posts

Hi,
I am currently working on a project and my client wants that current total discount is displayed on the cart page above the current total price. As I use $cart with print_r or var_dump there is no discount available like $cart.totals.discount. Could someone please give me some help or clue how to set this up

Link to comment
Share on other sites

  • 2 months later...
Posted (edited)

Hello @Carpe_diem,

To show the current total discount on the cart page above the total price, follow the below steps:

Step 1: First, locate the discount coupon generated in the PrestaShop back office.
Step 2: Next, replace the existing code with the following Smarty code instead of "$cart.totals.discount":

{if $cart.vouchers.added}
  {foreach from=$cart.vouchers.added item=voucher}
    <span class="label">Discount</span>
    <span>{$voucher.reduction_formatted}</span>
  {/foreach}
{/if}

By using this code, the total discounts will be printed on the cart page.
 

Edited by WebDesk Solution (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...