Jump to content

Quantity discounts, display final prices in place of the quantity of discounts


Recommended Posts

Hello, i think that the default display for quantity discount isn't very useful, because the people wants to know the final price.

 

So i would like to know how i could replace the variable of every discount for the variable of the differents final prices.

 

To make this the lines -{$quantity_discount.value|floatval}% and

-{convertPrice price=$quantity_discount.value|floatval} should be replaced for the variable of the final prices from quantity discounts, but i don't know which variables are.

 

Thanks in advance

 

descuentosporcantidades.jpg

 

The default code located in product.tpl code is this

 

 

{if $quantity_discounts}

<!-- quantity discount -->

<ul class="idTabs">

<li><a style="cursor: pointer">{l s='Quantity discount'}</a></li>

</ul>

<div id="quantityDiscount">

<table class="std">

<tr>

{foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'}

<th>{$quantity_discount.quantity|intval}

{if $quantity_discount.quantity|intval > 1}

{l s='quantities'}

{else}

{l s='quantity'}

{/if}

</th>

{/foreach}

</tr>

<tr>

{foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'}

<td>

{if $quantity_discount.id_discount_type|intval == 1}

-{$quantity_discount.value|floatval}%

{else}

-{convertPrice price=$quantity_discount.value|floatval}

{/if}

</td>

{/foreach}

</tr>

</table>

</div>

{/if}

Link to comment
Share on other sites

If you look the screenshots of the module, it doesn't simply replace 2 lines.

 

It displays quantity prices of basic product, but also a table with quantity prices for each product combination

Several parameters are availbale in the configuration pane to decide which prices to display and where

Link to comment
Share on other sites

  • 1 month later...

This is what I modified the code to:

 

{if $quantity_discounts}

<!-- quantity discount -->

<ul class="idTabs">

<li><a style="cursor: pointer" class="selected">{l s='Quantity discount'}</a></li>

</ul><div id="quantityDiscount">

<table class="std">

{foreach from=$quantity_discounts item='quantity_discount' name='quantity_discounts'}

<tr>

<td>Buy {$quantity_discount.quantity|intval}

{if $quantity_discount.price != 0 OR $quantity_discount.reduction_type == 'amount'}

{math equation="pprice - disc" pprice=$productPrice disc=$quantity_discount.real_value assign=price_break}

for {convertPrice price=$price_break} each

{else}

save {$quantity_discount.real_value|floatval}%

{/if}

</td>

</tr>

{/foreach}

</table>

</div>

 

To produce a table:

 

Buy 20 for $66.00 each

Buy 10 for $82.50 each

 

I like that format much better.

 

The key is to break it out from 2 loops into 1 loop, so it's not columns.

 

The formula works out the final price and then the line below prints it.

  • Like 2
Link to comment
Share on other sites

  • 1 year later...
  • 11 months later...

Bump!
Any idea how to reverse view of this?

From

Buy 20 for $66.00 each
Buy 10 for $82.50 each

 

To

Buy 10 for $82.50 each

Buy 20 for $66.00 each
 

Because i have something like this:

Basic price: $90

Buy 20 for $66.00 each

Buy 10 for $82.50 each

and its not good to view...

 

Thanks!

 

Solved by

http://www.prestashop.com/forums/topic/194506-quantity-discount-sort-order/?do=findComment&comment=1056638

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