X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Calling an extra field on the invoice (https://forum.x-cart.com/showthread.php?t=39045)

balinor 04-13-2008 10:47 AM

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!

kube 04-14-2008 05:10 PM

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.

balinor 04-14-2008 05:34 PM

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!!

balinor 04-15-2008 04:19 AM

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...

balinor 04-15-2008 04:47 AM

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}

robertswww 04-16-2008 04:30 PM

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

balinor 04-16-2008 04:36 PM

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.

chamberinternet 05-17-2008 10:15 AM

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

Otis 07-08-2008 10:54 AM

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

Otis 07-09-2008 05:50 PM

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>


All times are GMT -8. The time now is 11:06 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.