View Single Post
  #13  
Old 09-07-2014, 06:26 AM
 
xtech xtech is offline
 

X-Adept
  
Join Date: Jun 2010
Posts: 605
 

Default Re: Display product extra field data on Invoice

Quote:
Originally Posted by tartaglia
So here is an update to this ticket for all who want to be able to display extra fields on the Invoice. This is currently working on X-Cart 4.5.4 and I have more than a few people ask me how to do it. My thanks to Qualiteam and the other posters on this thread for their assistance.

Create a NEW file: /skin/<yourskin>/modules/Extra_Fields/product_extra_fields_invoice.tpl

Code:
{foreach from=$product.extra_fields item=v} {if $v.service_name eq $xtrafieldservicename and $v.active eq "Y" and $v.value} <div> <span style="font-style: italic;">{$v.field}:&nbsp;{$v.value}</span> </div> {/if} {/foreach}

Then MODIFY the file: /skin/<yourskin>/mail/html/order_data.tpl
by placing the following new if statement code inside the loop:

Code:
{foreach from=$products item=product}

and after the if statement:

Code:
{if $active_modules.Gift_Registry} {include file="modules/Gift_Registry/product_event_invoice.tpl"} {/if}

Here is the code to be added.

Code:
{if $active_modules.Extra_Fields} {include file="modules/Extra_Fields/product_extra_fields_invoice.tpl" xtrafieldservicename="xfieldservicename1"} {include file="modules/Extra_Fields/product_extra_fields_invoice.tpl" xtrafieldservicename="xfieldservicename2"} {include file="modules/Extra_Fields/product_extra_fields_invoice.tpl" xtrafieldservicename="xfieldservicename3"} {/if}

Obviously you will need to replace the values "xfieldservicename1","xfieldservicename2","xfields ervicename2" with teh actual xtrafieldservicename from your database.

Hope this helps lots of folks, being able to add extra field data easily to lots of places inside X-cart would be a great built in feature for QT to add in the future. Examples include Cart page, Invoice (shown here), WishList page, New Arrivals Page, Product listing page, etc. Maybe if this post gets lots of attention "thanks", they will consider it.

Will it work on 4.6.1 Platinum? How to call this in cart and checkout page?
__________________
X-cart Platinum
4.6.1
Reboot template
Reply With Quote