Jump to content

Looking to add discounted price column in quantity discount table


CharlenePro

Recommended Posts

I want to add a column to show the unit price after discount in the quantity discount table. 

I tried to add two lines in product-discounts.tpl, but it didn't work. The price 

{if $product.quantity_discounts}
<section class="product-discounts mb-3">
    {block name='product_discount_table'}
      <table class="table table-bordered table-product-discounts">
        <thead>
        <tr>
          <th>{l s='Quantity' d='Shop.Theme.Catalog'}</th>
          <th>{$configuration.quantity_discount.label}</th>
          <th>{l s='Unit Price' d='Shop.Theme.Catalog'}</th>
          <th>{l s='You Save' d='Shop.Theme.Catalog'}</th>
        </tr>
        </thead>
        <tbody>
        {foreach from=$product.quantity_discounts item='quantity_discount' name='quantity_discounts'}
          <tr data-discount-type="{$quantity_discount.reduction_type}" data-discount="{$quantity_discount.real_value}" data-discount-quantity="{$quantity_discount.quantity}">
            <td>{$quantity_discount.quantity}</td>
            <td>{$quantity_discount.discount}</td>
            <td>{$productPrice-($productPrice*$quantity_discount.reduction)}</td>
            <td>{l s='%discount%' d='Shop.Theme.Catalog' sprintf=['%discount%' => $quantity_discount.save]}</td>
          </tr>
        {/foreach}
        </tbody>
      </table>
    {/block}
</section>
{/if}

 

And advise how to correct it?

Thanks!

 

01.JPG

Link to comment
Share on other sites

  • 11 months later...

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...