![]() |
Displaying product savings in $ amount instead of % percent
Is there a way that I can show my customers how much they are saving in dollar amount rather that the standard way xcart displays it in percentage.
I found this code that generates the percentage amount in customer/main/products_tpl Code:
>{if $products[product].list_price gt 0 and $products[product].price lt $products[product].list_price}, save {$discount}%{/if} How can I change this to display in dollar amount? |
change:
Code:
{if $products[product].list_price gt 0} to: Code:
{if $products[product].list_price gt 0} |
Thanks Funkydunk.....Works like a charm!
|
:wink: Nice one!
|
Here's my code in customer/products.tpl
Code:
{math equation="(lprice-price)" price=$products[product].price lprice=$products[product].list_price assign=discount} Code:
="(lprice-price)" price=$products[product].price lprice=$products[product].list_price assign=discount} Code:
You save <u>{include file="currency.tpl" value=$discount}</u> Same effect, slightly different code. :) |
almost :)
yours will do the math equation even if there is no difference in price. Effectively that could slow the site down by, oooh probably in the order of .1 microsecond :LOL |
I wasnt able to get either one of these fixes working for 3.4.10
Any update here? the code Im currently using is below. Naturally I would like it to show $ instead of % as the topic of this forum indicates. Code:
{if $product.price ne 0}{include file="currency.tpl" value=$product.price}{include file="customer/main/alter_currency_value.tpl" alter_currency_value=$product.price}{if $config.Taxes.use_vat eq "Y" and $product.vat gt "0"}, {$lng.lbl_including_vat} {$product.vat}%{/if} |
oh my. that was far too easy.
Quote:
that's all i need |
Is it possible to have this post moved to "Custom Mods & Templates"? This is one I had definitely forgot about and if looking for it I would have started in the "Custom Mods & Templates" area of the forum.
Thanks, Glen |
Error in Code?
Quote:
I couldn't get FunkyDunk's mod to work until I changed the line above to this: Quote:
I kept getting $0.00 because it was subtracting lprice from itself. Please note I know nothing about coding so I may be wrong here, but it seems to work with the change I made. Randy X-Cart 3.5.3[/quote] |
All times are GMT -8. The time now is 05:43 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.