alexcat Posted November 5, 2011 Share Posted November 5, 2011 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 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 More sharing options...
olea Posted November 6, 2011 Share Posted November 6, 2011 I propose the FO Quantity&Declinasions Prices module. It is configurable to display prices of simple or declined products, as well as quantity prices in product page Link to comment Share on other sites More sharing options...
alexcat Posted November 10, 2011 Author Share Posted November 10, 2011 40 euros for only replace 1 variable in 2 lines??? Link to comment Share on other sites More sharing options...
olea Posted November 10, 2011 Share Posted November 10, 2011 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 More sharing options...
johens Posted November 17, 2011 Share Posted November 17, 2011 Dear alexcat! Tried it? http://www.presto-ch...-discounts.html Worked good on PS 1.4.5.1 (default skin) but don't worked on prestashop_new skin. Don't found the problem why not works. /sorry for my bad english/ Link to comment Share on other sites More sharing options...
bsdll Posted January 10, 2012 Share Posted January 10, 2012 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. 2 Link to comment Share on other sites More sharing options...
wayne Posted January 10, 2012 Share Posted January 10, 2012 You should get this module : Quantity Discounts v1.2.1 you can get it from http://www.presto-changeo.com/ It's Awesome, This is what it looks like on my site. see below: 1 Link to comment Share on other sites More sharing options...
fats2005 Posted August 30, 2013 Share Posted August 30, 2013 (edited) Thanks bsdll, the code works well with a currency, but with multi-currency has a issue. The thing is the disccount need to be converted before the make the math operation Do you have any idea of how to do that? Edited September 2, 2013 by fats2005 (see edit history) Link to comment Share on other sites More sharing options...
PrestaShark Posted August 27, 2014 Share Posted August 27, 2014 (edited) Bump!Any idea how to reverse view of this? From Buy 20 for $66.00 eachBuy 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 August 28, 2014 by PrestaShark (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now