| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
STILL NEED HELP Getting an added field to show up | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||||
|
|||||||||
STILL NEED HELP Getting an added field to show up
I have the "How Did You Hear About Us" mod from this post: http://forum.x-cart.com/viewtopic.php?t=2931 and need to have the field displayed in the order details viewed in the admin.
I added this to the main/history_order.tpl: Code:
What am I missing??? Any help is greatly appreciated.
__________________
-Ken X-Cart User / Developer Since April 2003 (Varying versions, multiple client sites, 3.x through 4.4.x) www.pointbweb.com |
|||||||||
#2
|
|||||||
|
|||||||
Is the data getting saved to the database?
__________________
ex x-cart guru |
|||||||
#3
|
|||||||||
|
|||||||||
Yep - the data is in there. I tested other fields from the array i.e. $customer.language and that spits out ok. Some other fields would not output either though. Is there some smarty> assign thing I need?
__________________
-Ken X-Cart User / Developer Since April 2003 (Varying versions, multiple client sites, 3.x through 4.4.x) www.pointbweb.com |
|||||||||
#4
|
|||||||
|
|||||||
So you changed the code to add this new piece to the database not the parts that are normally there. Did you also create the new table in the database itself? Have you also gone in and verified that the data is actually in the dataase using you MySQL admin?
__________________
Kanyon71 http://www.web-wizards.com For hosting solutions that fully support X-Cart! Mention the forums for a discounted package! |
|||||||
#5
|
|||||||||
|
|||||||||
It is a field added to the Customers table and it all works fine as far as inputting data from the registration form and pulling it back up when editing the profile, but I need it to show up in the orders history in the admin area.
__________________
-Ken X-Cart User / Developer Since April 2003 (Varying versions, multiple client sites, 3.x through 4.4.x) www.pointbweb.com |
|||||||||
#6
|
|||||||
|
|||||||
ASSIGN the value to the variable
Smarty needs to have the value of the variable "hear" assigned to it -- it can't look it up directly.
You need something like $mail_smarty->assign("hear",$customer.hear); in the code that CALLS the history_order.tpl template then in the template, {$hear} will echo the value passed to it. Without passing a value, $hear is undefined (and likely empty), which is why you don't see its value in the output. Does this help?
__________________
X-Cart Gold 3.4.4; X-Affiliate 3.4.4; PHP 4.3.2; MySQL 4.0.15-standard; Apache 1.3.28; Red Hat Linux 7.1 |
|||||||
#7
|
|||||||||
|
|||||||||
Close, but no cigar. I tried several variations of that and still no data. What I would really like is an understanding of what is happening programmatically when you pull up the order details in the admin. I see a trail of the following relevant php files:
func.php - used to get the $userdata - it looks like it pulls the entire customers table into $userdata: Code:
Then history_order.php: Code:
Code:
Code:
To reiterate: xcart_customers.hear is the field in the customers table I need to show. It has data in it. The variables $customer.fax and $customer.email show up fine and it looks like they are just pulled from the userdata array in func.php from the SQL query that pulls all fields from the table and assigned through this (I think) in the history_order.php file: Code:
__________________
-Ken X-Cart User / Developer Since April 2003 (Varying versions, multiple client sites, 3.x through 4.4.x) www.pointbweb.com |
|||||||||
#8
|
|||||||||
|
|||||||||
Any ideas from the gurus??
__________________
-Ken X-Cart User / Developer Since April 2003 (Varying versions, multiple client sites, 3.x through 4.4.x) www.pointbweb.com |
|||||||||
|
|||
X-Cart forums © 2001-2020
|