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

Calling an extra field on the invoice

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-13-2008, 10:47 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Calling an extra field on the invoice

Quick one that I can't seem to track down in the forum - client wants to add an extra field to the invoice. Just calling the extra field code as you would in the products template or product template doesn't cut it, as I'm sure I have to add extra fields to the order array. Can someone direct me to the spot, or even better, get me a chunk of code? Thanks!
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #2  
Old 04-14-2008, 05:10 PM
  kube's Avatar 
kube kube is offline
 

X-Adept
  
Join Date: Sep 2005
Location: London: a small place East of Wales
Posts: 529
 

Default Re: Calling an extra field on the invoice

Hi Balinor,

I might have got this totally wrong so I do apologise.

For 4.1.9 it appears it is there under the orders_data array which contains $order and $products, for instance...

{$products.0.extra_fields.0.value}

Sends out okay in email. I don't think I've modified it anywhere?

func_order_data($orderid) is the function called and it appears in func.order.php

Hope this helps.
__________________
Doms
kube v4.1.9
Reply With Quote
  #3  
Old 04-14-2008, 05:34 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Calling an extra field on the invoice

Thanks Kube, you are correct, that gets called without any modification necessary! Just couldn't get the right syntax I guess. Thanks for the help!!
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #4  
Old 04-15-2008, 04:19 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Calling an extra field on the invoice

Well, this is close, but what ends up happening is that on orders with multiple products it simply repeats the first value down the list. Need to play around with it a bit more I guess...
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 04-15-2008, 04:47 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Calling an extra field on the invoice

Figured it out, use this value to call extra fields on the invoice:

{$product.extra_fields.0.value}
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #6  
Old 04-16-2008, 04:30 PM
 
robertswww robertswww is offline
 

X-Adept
  
Join Date: Jul 2003
Posts: 586
 

Default Re: Calling an extra field on the invoice

Hi Balinor,

I first tried {$products.0.extra_fields.0.value} to call the Extra Field, but like you said, if a customer buys several products, the first Extra Field called is repeated for each product.

I then tried {$product.extra_fields.0.value} but that just comes up empty with no extra field values showing... can you verify the syntax and/or offer any other suggestions?

Thanks,

Robert
__________________
X-cart 4.1.10
Reply With Quote
  #7  
Old 04-16-2008, 04:36 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Calling an extra field on the invoice

You need to change the value of 0 to the number of the field you want to display.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #8  
Old 05-17-2008, 10:15 AM
  chamberinternet's Avatar 
chamberinternet chamberinternet is offline
 

X-Wizard
  
Join Date: Sep 2005
Location: Lancashire, UK
Posts: 1,470
 

Default Re: Calling an extra field on the invoice

Can the extra fields be also outputted within the Checkout page for each product?

I'm unable to locate the extra fields values within the Smarty Debug Window ...

Shafiq
__________________
Developing in 4.7.x now (Dipping into v5 - Slowly!)
Have used 4.1.x, 4.2.x, 4.4.x, 4.5.x, 4.6.x & 4.7.x
Multiple Instances of X-Cart
MySQL 5.6.37
CentOS 7.4


Chamber Internet
- Lancashire, United Kingdom
http://www.chamberelancs.co.uk
Reply With Quote
  #9  
Old 07-08-2008, 10:54 AM
 
Otis Otis is offline
 

Newbie
  
Join Date: Feb 2007
Posts: 8
 

Default Re: Calling an extra field on the invoice

is there anyway someone could post a little code (a little hand holding ) to show this...

i just want to check an extra field for any of the products on the invoice and if it is checked (true) to display the label that on the invoice...basically a special order mod in a way...

any help with coming up with this is appreciated...i just want some leads to come up with this...the above is not cutting it for this noob....

thanks
__________________
4.5.2
Reply With Quote
  #10  
Old 07-09-2008, 05:50 PM
 
Otis Otis is offline
 

Newbie
  
Join Date: Feb 2007
Posts: 8
 

Default Re: Calling an extra field on the invoice

well...i'll ask again...who knows...

i put this in the /main/order_info.tpl
i copied the provider info and changed it to this...
should this add the extra field indicated to the invoice???
it shows the label but no value for the extra field...am i missing something...this is the only change i have done, except of adding the extra field...i have changed the # on the extra_field from 0 to 5...no luck...
Quote:
<tr>
<td valign="top">{$lng.lbl_provider}</td>
<td valign="top">
{$product.extra_fields.3.value}
</td>
</tr>
__________________
4.5.2
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 03:58 AM.

   

 
X-Cart forums © 2001-2020