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>

cycloneuk 12-14-2008 09:04 AM

Re: Calling an extra field on the invoice
 
Quote:

Originally Posted by balinor
You need to change the value of 0 to the number of the field you want to display.


I have tried that but it dosn't output anything for some reason.

diode 01-07-2009 03:55 PM

Re: Calling an extra field on the invoice
 
I was able to get this working on 4.1.9

File location: skin1 > mail > html > order_data.tpl

You can display your extra fields using this code:

{$product.extra_fields.0.value}


where 0 is the id of the extra field. The first extra field for your store is 0, if you haven't deleted anything. Then count from there if necessary to display the correct one.

Motive 01-10-2009 07:33 AM

Re: Calling an extra field on the invoice
 
Quote:

Originally Posted by kube
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.


Kube, Balinor, Diode, It's a great lead for me. Thanks.

When you say

{$products.0.extra_fields.0.value} Sends out okay in email.

Would this equate to putting {$products.0.extra_fields.0.value} in the product loop in (4.1.9) mail/order_data.tpl ?

To test, I currently have
{section name=prod_num loop=$products}
{$products.0.extra_fields.0.value}
{$products.0.extra_fields.1.value}
{$products.1.extra_fields.0.value}
{$product.extra_fields.0.value}
{$product.extra_fields.1.value}
{$product.extra_fields.2.value}
... etc

In mail/order_data.tpl. Though the extra fields are set and appear in other pages, this section in the order notification email is blank.

Can you share how you got {$products.0.extra_fields.0.value} OR {$product.extra_fields.0.value} to show up in an email?

Many thanks,

-Michael

jaimwolfe 01-19-2009 02:01 PM

Re: Calling an extra field on the invoice
 
I have been following this and trying to get an extra field I have in my database to show up on the admin side under the order status page (where the customers order is shown. I have added the
Quote:

<td valign="top">{$lng.lbl_provider}</td> <td valign="top"> {$product.extra_fields.3.value}
to my skin1>main>order_info.tpl but as the others are stating, nothing populates for the value.

Basically I added a typicalprice extra field to program the typical price we pay for a product, and would like it to show when the customer places the order (on admin side only) so we know what our typical price is.

Thanks,

ChristineP 01-26-2009 07:37 AM

Re: Calling an extra field on the invoice
 
I tried this as well for v4.1.9, but it doesn't show the designated extra field. I've added {$product.extra_fields.0.value} to the mail/html/order_invoice.tpl. How did you get the extra field to work?

Christine

Quote:

Originally Posted by balinor
Figured it out, use this value to call extra fields on the invoice:

{$product.extra_fields.0.value}


Motive 02-04-2009 10:46 AM

Re: Calling an extra field on the invoice (Bump)
 
Balinor, Diode,

Any chance you can give us hints as to how you made it work?

-Michael

ChristineP 02-24-2009 05:17 AM

Re: Calling an extra field on the invoice (Bump)
 
Have you had any luck with getting the loop through to work for order_data.tpl?

Christine

Quote:

Originally Posted by Motive
Balinor, Diode,

Any chance you can give us hints as to how you made it work?

-Michael


WhiteDoveGifts 04-27-2009 09:52 AM

Re: Calling an extra field on the invoice
 
I would like to have this working as well but slightly different. I need be able to add a unique Invoicenumber manually to every order that have status "shipped".

So for initally placed orders I don't want to show the Invoicenumber. Right now I have created a label "lbl_invoicenumber" to order_invoice.tpl and it shows up but don't know how to proceed further...

Anyone knows how to manage that?

qrichou 12-03-2009 08:51 AM

Re: Calling an extra field on the invoice
 
Im trying to get this to work in 4.2 /skin1/mail/html/order_data.tpl with no luck. I have used {$product.extra_fields.6.value}. Did anyone get an answer on this?

Many Thanks

ARW VISIONS 07-21-2010 07:45 AM

Re: Calling an extra field on the invoice
 
anyone have an idea for 4.2? Please!!!

DogByteMan 10-06-2010 12:59 PM

Re: Calling an extra field on the invoice (Bump)
 
Quote:

Originally Posted by Motive
Balinor, Diode,

Any chance you can give us hints as to how you made it work?

-Michael


Guess not

Obviously, since this thread is referred to several times as a solution, you would think it would have a solution. Nope... Those who started it just left these poor folks (and me) hanging. Shame!

drudden 01-27-2011 12:07 PM

Re: Calling an extra field on the invoice
 
Balinor has always been very helpful on these forums, so I can't blame him for not being here all the time. I'm sure he's pretty busy just like the rest of us :)

Anyway, I got this working on the product details page so maybe the logic I used can help everyone else. Instead of using the fieldid, I used the id for the Array that appears in the Debug Consule. So I used this:

{$extra_fields.1.field_value}


BUT "1" is the id of the Array and NOT the fieldid.

amagri 02-07-2014 02:31 AM

Re: Calling an extra field on the invoice
 
I got this working in 4.6 as follows:
{$products[prod_num].extra_fields[0].value}


All times are GMT -8. The time now is 09:43 PM.

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