bigjoshua5 Posted May 20, 2015 Share Posted May 20, 2015 Hello folks, I have searched all over to try and find a way to call the product custom fields based on client, with no success. Every post that I've looked at explains how to display the custom field on the client template, but that's not what I'm trying to do. I hope this is the correct place to post this question, but I'm creating a module that has a form, and with that form I'd like to post all the custom field values that are assigned to a selected client. Here's what I have so far: function mymodule_output($vars) { $table = "tblclients"; $fields = "id,firstname,lastname,companyname,status"; $where = array("status"=>"Active"); $result = select_query($table,$fields,$where); echo '<table class="form" width="100%" border="0" cellspacing="2" cellpadding="3"> <tbody> <tr> <td width="130" class="fieldlabel">Client</td> <td><form id="client" action="" method="post"> <select name="cmd" onchange="submit()"> <option name="option" value="">Select Client</option>'; while ($data = mysql_fetch_array ($result)) { $id = $data["id"]; $firstname = $data["firstname"]; $lastname = $data["lastname"]; $companyname = $data["companyname"]; $status= $data["status"]; echo '<option name="option" value="'.$id.'">'.$lastname.', '.$firstname.' ('.$companyname.')</option>'; } echo ' </select> <input type="hidden" value="CHECK" /> </form></td> </tr> </tbody> </table> } This produces a dropdown menu with all the "Active" clients, and when you change the dropdown menu by selecting a client, it post the values in the form. However, I need to include in the post any values that have been entered into the custom fields with specific names (e.g. First Custom Field = Field Name: Key1, Type: Textbox Second Custom Field = Field Name: Key2, Type: Textbox) across all products assigned to the customer. Obviously this could include any number of values depending on the product and the amount of keys required for that product. Any help is greatly appreciated. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.