Wow, I managed to make the extra column on the admin/customers.php.
To my own surprise it even works!
Wow, I managed to make the extra column on the admin/customers.php.
To my own surprise it even works!
Glad to hear you were able to add the column! Let us know if you need anything else.
Hello, I have implimented this plugin and it works well. My issue is this. I am using T-Hub with Zen Cart and of course the extra fields information does not import into T-Hub and therefor not into Quickbooks as well. The T-hub people seem as thougbh they are willing to modify t-hub but it is up to me to figure out were the information is beeing located. Can you tell me, were in the database tables the Extra filed information is placed so I can further my dialog with T-hub? Thank you
Extra field data is kept in the customers table along with all the other customer info. They are labeled customers_extrafield, customers_extrafield2, and so on.
Thank you!
Very first post, running zen cart 1.5. Installed the module and it seems to work, I can see the value in the data base using phpmyadmin. It is shown as customers_extrafield and varchar (32). It is a 15 character field in format NNN.NNN.NNN.NNN. so everything seems to have worked. Which is great.
My backoffice vendor has supplied a .php file that creates an orderpacket that is sent to me to process the order. There is a field I can use in this packet UDF01 to send this value to my backend system but I can't seem to get the value to the packet. Here is what the code looks like,
$sessID = zen_session_id();
//Begin Packet -----------------------------------------------------------------------------
$in = "1007|WID=" . $sessID .
"|LID=" . substr($order->customer['email_address'], 0, 80) .
...snip...
"|OID=" . $oID .
"|CN=" . substr($order->billing['company'], 0, 40) .
"|FN=" . substr($order->billing['firstname'], 0, 40) .
"|LN=" . substr($order->billing['lastname'], 0, 40) .
"|BA1=" . substr($order->billing['street_address'], 0, 40) .
"|BA2=" . substr($order->billing['suburb'], 0, 40) .
...snip....
"|EM=" . substr($order->customer['email_address'], 0, 80) .
So I added this code, since it was in the same customer table as the email address I thought I would copy the email mapping ....
"|UDF01=" . substr($order->customer['extrafield'], 0, 25) .
The packet shows the UDF01 but it is blank so my code must not be quite right in getting the value mapped.
I am pretty technical but not a PHP programmer or a sql data base expert. Any help would be greatly appreciated.
Hi stevehdp, It's tough for me to troubleshoot without being hands-on with your code. However, I think you'll find some very useful nuggets of code in the /admin/customers.php file from the module download package. Just search for "extrafield" and you'll find comments for every change made in the file. You will likely find the sq_data_array and extrafield display code the most helpful for your needs. Good luck!
Great Mod thank you, but I need a bit of help please.
I have created an extra field with 2 radio buttons on the account registration page titled "account type", where people select what account type they want to register for. Options are: wholesale account or retail account. This works well and the customer's selection values show on the client info page in admin.
However, I want the chosen field value to also be displayed in a column in the customer list view as well, so that I can see at a glance who has selected wholesale account or retail account during the sign-up process.
I have managed to get a new column appearing in the customer list view titled "Account Type", but I can't seem to get the coding right to get the selected extra field value to appear in the new column. I've tried various permutations of the code in customer.php, to no avail..
Please advise what code to add to customer.php to get the selected values to appear in this column?
Last edited by enigma666666; 17 Jun 2013 at 12:27 AM.
The code I added to customer.php:
<td class="dataTableHeadingContent" align="left" valign="top">
<?php echo (($_GET['list_order']=='extrafield-asc' or $_GET['list_order']=='extrafield-desc') ? '<span class="SortOrderHeader">' . TABLE_HEADING_EXTRAFIELD . '</span>' : TABLE_HEADING_EXTRAFIELD); ?><br>
<a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=extrafield-asc', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='extrafield-asc' ? '<span class="SortOrderHeader">Asc</span>' : '<span class="SortOrderHeaderLink">Asc</b>'); ?></a>
<a href="<?php echo zen_href_link(basename($PHP_SELF) . '?list_order=extrafield-desc', '', 'NONSSL'); ?>"><?php echo ($_GET['list_order']=='extrafield-desc' ? '<span class="SortOrderHeader">Desc</span>' : '<span class="SortOrderHeaderLink">Desc</b>'); ?></a>
</td>
But obviously this is not enough/correct to display the values the customer selected.
@enigma, I suggest searching for extrafield within the customers.php file. You will see all of the display code used to show the field on the individual customer page, which is commented throughout the file to make it easier to find. From there, you can figure what needs to be copied to your new column.
Bookmarks