| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Extra Field to show on Email receipt only | ||||
|
|
Thread Tools | Search this Thread |
#11
|
|||||||||
|
|||||||||
?
Ok, when I use that code, I get an error complaining about the {/if}. Don't I need an openning {if} of some sort?
Is there any reason it should matter which file I'm putting this in? Like if I put it in order_data.tpl, versus an email.tpl? Thanks so much for all of your help.
__________________
-- Version 4.0.17 Gold Version 4.1 Gold Version 4.4 Gold |
|||||||||
#12
|
|||||||
|
|||||||
Well, this one was fun...
It seems that the extra field information is not saved with the order data when an order is placed or generated when the order is read back from the database. What I did was just pull the extra field information when the order is regenerated for display. A real fix would be to store the extra field data along with the order when it is saved in case the extra field data is changed at a later date. Oh well, maybe next time. To change this you will need to do the following: 1) Enable the Extra Fields module under the Administration area, Modules section. 2) Create your extra fields under the Products area, Extra Fields section 3) Then pick a product you want to test with and add some extra field data to it, and save it. 4) Change the file /include/func.php around line 2601 in function func_order_data, right after the code: Code:
add the following additional code: Code:
5) then, change the file /skin1/main/order_info.tpl around line 68 to see the extra field data on screen order displays: after the code: Code:
add this code: Code:
6) then, change the file /skin1/mail/order_data.tpl around line 23, look for the code: Code:
which is the end section for the code section {section name=prod_num loop=$products} and insert the following code right above it: Code:
7) Find an order or create a new order that has the product with the extra field on it and is should now display the new extra field data. I did not include an example on how to modify the html version of the invoice, but you should be able to take the code above and insert it into that file and make it work. Also, there is no checking to see whether the SHOW flag in the extra fields maintenance is on or off, but you can add or leave that out where needed. Hope this works for you....
__________________
X-Cart Gold: v4.0.17 |
|||||||
#13
|
|||||||||
|
|||||||||
hot damn!
That's fantastic, thanks so much. I hadn't imagined that it would be so complex.
Don't want to push my luck, but I have 2 more related questions: 1. how can I allow HTML in the extra fields? it appears to parse it out by default 2. how can I change the extra fields to a text box, instead of a single line field? I found the tpl file to edit in /modules/extra_fields, but when I change it, it does not show the existing text when I save or go back in to modify. It appears to be saving ok, just not refilling the form field Thanks again!
__________________
-- Version 4.0.17 Gold Version 4.1 Gold Version 4.4 Gold |
|||||||||
#14
|
|||||||||
|
|||||||||
oops
Spoke too soon. I found the answer to question number one here:
http://forum.x-cart.com/viewtopic.php?t=13801&highlight=extra+field+html Question two remains. I have Quote:
I know it's something dumb, but just can't figure it out. Something with 'value' I assume.
__________________
-- Version 4.0.17 Gold Version 4.1 Gold Version 4.4 Gold |
|||||||||
#15
|
|||||||||
|
|||||||||
finally
duh!
Stupid HTML mistake. Posting answer for future people. thanks to the two who helped! Quote:
__________________
-- Version 4.0.17 Gold Version 4.1 Gold Version 4.4 Gold |
|||||||||
#16
|
|||||||
|
|||||||
Moving this to the Custom Mods forum.
__________________
Padraic Ryan Ryan Design Studio Professional E-Commerce Development |
|||||||
#17
|
|||||||
|
|||||||
Hi dsparks:
It is a great mod you posted. But saving extra fields at the time of creating order does not work for me. I need to read the "realtime" extra field value at the time I print out invoice from order detail page. Could you please let me know if you know how to do it? I spent several hours and cannot get it working. Here is what I did: Copy and paste the following code from module/Extra_Fields/extra_fields.php into admin/order.php Code:
Then somewhere insde /mail/html/order_invoice.tpl, I paste following code from skin1/modules/Extra_Fields/product.tpl Code:
But when I print out, it shows Cost: No field value is not printed. I try using $product.extra_fields instead of $extra_fields and nothing prints out. I am newbie to x-cart still learning how to cut and paste codes. If you can please help me out with this.
__________________
X-Cart Gold Plus 4.5.5 Checkout ONE Checkout ONE DPM BCSE CIM Apache Linux |
|||||||
#18
|
|||||||
|
|||||||
Never mind. I learnt basic SQL and spent a couple hours to write my first sql query syntax and everything solved.
S-H-W-E-K-H-A-W
__________________
X-Cart Gold Plus 4.5.5 Checkout ONE Checkout ONE DPM BCSE CIM Apache Linux |
|||||||
#19
|
|||||||||
|
|||||||||
Quote:
if you want to add the extra fields to the html invoices you have to do it a bit different......... Code:
__________________
Looking for a reliable X-cart host ? You wont go wrong with either of these. EWD Hosting Hands On Hosting |
|||||||||
#20
|
|||||||
|
|||||||
okay here is my code but its for product.tpl i think it should work
{section name=field} {if $extra_fields[field].active eq "Y" && $extra_fields[field].field_value} {$extra_fields[XX].field_value} {/if} {/section} remember field id does vary and may not be as in the database there do try various combinations. also i need opinion of others on this, is there any risk showing like this or any improvement in the code. |
|||||||
|
|||
X-Cart forums © 2001-2020
|