View Single Post
  #14  
Old 05-28-2017, 07:18 AM
 
anandat anandat is offline
 

X-Adept
  
Join Date: Jan 2004
Posts: 914
 

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.
This mod works with 4.5.4 but it's not working with 4.7.7
Any one can help me please ?
__________________
X-Cart: 4.7.7 LIVE
Skin:Ultra by xcartmods.co.uk
X-cart Modules: | ACR, Rich Google Search, Customer Testimonials | Cloud Search, | Websitecm: CDSEO (2.1.9)
---------------
Server: Linux
php: 5.3
mysql: 5.0.89
----------------
Reply With Quote