Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

add market price to order_data.tpl

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 11-07-2008, 09:05 PM
  CobaltCat's Avatar 
CobaltCat CobaltCat is offline
 

Senior Member
  
Join Date: Jul 2003
Location: Southern Orygun
Posts: 153
 

Default 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.
__________________
Thanks -
CobaltCat

I would love to change the world, but they won't give me the source code.
Reply With Quote
  #2  
Old 11-08-2008, 06:41 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default 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.
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #3  
Old 11-08-2008, 05:00 PM
  CobaltCat's Avatar 
CobaltCat CobaltCat is offline
 

Senior Member
  
Join Date: Jul 2003
Location: Southern Orygun
Posts: 153
 

Default 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?
__________________
Thanks -
CobaltCat

I would love to change the world, but they won't give me the source code.
Reply With Quote
  #4  
Old 11-09-2008, 03:42 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default 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?
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #5  
Old 11-11-2008, 11:57 AM
  CobaltCat's Avatar 
CobaltCat CobaltCat is offline
 

Senior Member
  
Join Date: Jul 2003
Location: Southern Orygun
Posts: 153
 

Default 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?
__________________
Thanks -
CobaltCat

I would love to change the world, but they won't give me the source code.
Reply With Quote
  #6  
Old 11-12-2008, 04:04 AM
  JWait's Avatar 
JWait JWait is offline
 

X-Man
  
Join Date: Nov 2005
Location: California
Posts: 2,440
 

Default 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.
__________________
Two Separate X-Cart Stores
Version 4.4.4 Gold - X-AOM - Vivid Dreams Aquamarine (modified) - Linux
Mods - Newest Products - View All -, and a few others. Numerous upgrades from 4.0.x series.
Integrated with Stone Edge Order Manager + POS

Version 4.1.12 Gold (fresh install) - X-AOM - Linux
Mods - XCSEO free
Reply With Quote
  #7  
Old 11-26-2008, 10:36 PM
 
Julien Wittmer Julien Wittmer is offline
 

Newbie
  
Join Date: Aug 2006
Posts: 4
 

Default 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 ?
__________________
Version 4.1.2
Reply With Quote
  #8  
Old 01-14-2013, 02:11 AM
 
xtech xtech is offline
 

X-Adept
  
Join Date: Jun 2010
Posts: 605
 

Default 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.
__________________
X-cart Platinum
4.6.1
Reboot template
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


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

   

 
X-Cart forums © 2001-2020