Jump to content

How to call clients product custom fields


bigjoshua5

Recommended Posts

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.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated