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!
|
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. |
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!!
|
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...
|
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} |
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 |
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.
|
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 |
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 |
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:
|
Re: Calling an extra field on the invoice
Quote:
I have tried that but it dosn't output anything for some reason. |
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. |
Re: Calling an extra field on the invoice
Quote:
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 |
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:
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, |
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:
|
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 |
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:
|
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? |
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 |
Re: Calling an extra field on the invoice
anyone have an idea for 4.2? Please!!!
|
Re: Calling an extra field on the invoice (Bump)
Quote:
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! |
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. |
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.