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

Extra Field to show on Email receipt only

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #21  
Old 11-01-2005, 02:03 PM
 
SellPro SellPro is offline
 

Newbie
  
Join Date: Oct 2005
Posts: 6
 

Default

I'm trying to achieve the same effect, but I'm having some trouble. Here is the code I'm using. I know that I need the value from the second extra field for each item, but this gives me a smarty error. It's trying to use $location as a smarty tag, I just want it to be a variable. Any help?

Code:
<? $result = mysql_query("SELECT * FROM `xcart_extra_field_values` WHERE `productid` =$product.productid and `fieldid` =2"); while($r=mysql_fetch_array($result)) { $location=$r["value"]; ?> <? echo $location ?> <? } ?>
__________________
Version 4.0.16
Reply With Quote
  #22  
Old 12-13-2005, 07:05 PM
 
DVDirect DVDirect is offline
 

Advanced Member
  
Join Date: May 2005
Posts: 35
 

Default

Hi Everyone,

I have added this code to my site and added the code from Shan

Quote:
if you want to add the extra fields to the html invoices you have to do it a bit different.........


Code:
{foreach from=$product.extra_fields key=field_name item=field}

{$field.field} : {$field.field_value}

{/foreach}

I have placed the above code in
/mail/html/order_data.tpl I hope this is the correct place.

Now my question is what is the code to include in a html email that calls this ectra field information. In my case it is extra field "6"

Any assistance would be greatly appreciated.

Regards,
Andrew
__________________
X-Cart v4.0.15
MMPro
EZy Checkout
Rewards Points
Heavily modified back end
Reply With Quote
  #23  
Old 12-18-2005, 09:06 PM
 
DVDirect DVDirect is offline
 

Advanced Member
  
Join Date: May 2005
Posts: 35
 

Default

FYI... v4.0.15

This is what you can add to your .tpl files to call the Extra Field Data:

In /customer/main/product.tpl you have the followiing calling the Extra Field Data:

Code:
{if $active_modules.Extra_Fields ne ""} {include file="modules/Extra_Fields/product.tpl"} {/if}

Included code in /modules/Extra_Fields/product.tpl

Code:
{* $Id: product.tpl,v 1.7 2004/05/28 12:21:07 max Exp $ *} {section name=field loop=$extra_fields} {if $extra_fields[field].active eq "Y" && $extra_fields[field].field_value} <TR><TD width="30%"> {$extra_fields[field].field} </TD> <TD> {$extra_fields[field].field_value} </TD> </TR> {/if} {/section}

This justs lists the Extra Data fields on the Product Detail Page.

So to get just the Extra Field you want use the Extra Field ROW#. In Admin you have Extra Field you can add... if the data is in the 3rd row then use '03' inplcase of [field] in the code below... you can use 01,02,03,04,05 etc for represented rows.

Extra field Title:
Code:
{$extra_fields[field].field} = {$extra_fields[03].field}

Extra Field Value:
Code:
{$extra_fields[field].field_value} = {$extra_fields[03].field_value}

The Other thing you can do is just qualify the Title to make sure that you are displaying the correct ROW incase you have changed the Title to something else.

Taken from above code in /modules/Extra_Fields/product.tpl

Extra Field Title to display only = Test Title

Code:
{section name=field loop=$extra_fields} {if $extra_fields[field].active eq "Y" && $extra_fields[field].field_value} {if $extra_fields[field].field eq "Test Title"} <TR><TD width="30%"> {$extra_fields[field].field} </TD> <TD> {$extra_fields[field].field_value} </TD> </TR> {/if} {/if} {/section}

Regards,
Marko
__________________
X-Cart v4.0.15
MMPro
EZy Checkout
Rewards Points
Heavily modified back end
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 09:46 AM.

   

 
X-Cart forums © 2001-2020