X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   add market price to order_data.tpl (https://forum.x-cart.com/showthread.php?t=43514)

CobaltCat 11-07-2008 09:05 PM

add market price to order_data.tpl
 
My client is using 4.1.6 and wants to have both the price AND the list price display on the printable invoice, unless the list price is set to 0. He gives discounts on full price items, but not sales items and wants to have a record of which items were sales items. I hope I'm explaining this clearly.

JWait 11-08-2008 06:41 AM

Re: add market price to order_data.tpl
 
You could try including the routine from products.tpl that determines whether to show the "market price" or not...
Code:

{if $products[product].taxed_price ne 0 or ($products[product].variantid && $products[product].variants_has_price)}
{if $products[product].list_price gt 0 and $products[product].taxed_price lt $products[product].list_price}
{math equation="100-(price/lprice)*100" price=$products[product].taxed_price lprice=$products[product].list_price format="%3.0f" assign=discount}
{if $discount gt 0}
&nbsp;<font class="MarketPrice">{$lng.lbl_market_price}: <s>
{include file="currency.tpl" value=$products[product].list_price}
</s></font>
{/if}
{/if}
{/if}

You may only need the part that begins at {if $discount gt 0} to the first {/if}. This isn't going to total the market price though in the even a customer buys more than one item.

I don't know if this will work or not, but it is someplace to start.

CobaltCat 11-08-2008 05:00 PM

Re: add market price to order_data.tpl
 
JWait -

Thanks for the info. I added

Code:

{if $discount gt 0}
<font class="MarketPrice">{$lng.lbl_market_price}: <s>
{include file="currency.tpl" value=$products[product].list_price}
</s>&nbsp;&nbsp;</font>
{/if}


to the html/order_data.tpl, so it looks like

Code:

<td align="right">{include file="currency.tpl" value=$product.display_price}&nbsp;&nbsp;<br />

{if $discount gt 0}
<font class="MarketPrice">{$lng.lbl_market_price}: <s>
{include file="currency.tpl" value=$products[product].list_price}
</s>&nbsp;&nbsp;</font>
{/if}

</td>


but it doesn't show anything on an invoice. I did clear the templates cache on the server.

Any ideas?

JWait 11-09-2008 03:42 AM

Re: add market price to order_data.tpl
 
Its possible that $products[product].list_price isn't a stored variable. Did you try inserting the entire routine to include the math?

CobaltCat 11-11-2008 11:57 AM

Re: add market price to order_data.tpl
 
I think I did. I tried:

Code:

<td align="right">{include file="currency.tpl" value=$product.display_price}&nbsp;&nbsp;<br />

{if $products[product].list_price gt 0 and $products[product].taxed_price lt $products[product].list_price}
{math equation="100-(price/lprice)*100" price=$products[product].taxed_price lprice=$products[product].list_price format="%3.0f" assign=discount}
{if $discount gt 0}
<font class="MarketPrice">{$lng.lbl_market_price}: <s>
{include file="currency.tpl" value=$products[product].list_price}
</s></font><br />
{/if}
{/if}
{if $active_modules.Special_Offers ne "" and $products[product].use_special_price ne ""}
<s>
{/if}

</td>



But nothing changed. Am I not grabbing enough of the code?

JWait 11-12-2008 04:04 AM

Re: add market price to order_data.tpl
 
It may not be grabbing some of the variables, meaning it isn't going to work without a lot of modification.

Julien Wittmer 11-26-2008 10:36 PM

Re: add market price to order_data.tpl
 
Hi,

I would like to add market price and % save on the order_data.tpl too.
Like you I can't make it to display the result. I did on other tpl with quiet the same code but on the order_data.tpl it is a big issue. I think it comes from not grabbing some var as JWAIT said it. Did you figured it out ? Can someone help us on this point ?

xtech 01-14-2013 02:11 AM

Re: add market price to order_data.tpl
 
Hello,
I want to display Market price and Discounted price and also Discount avail not in % in the invoice.How to achieve that?

Thanks.


All times are GMT -8. The time now is 04:35 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.