Jump to content
  • Checkout
  • Login
  • Get in touch


The e-commerce.

Product Extra Fields and Advanced Search


Recommended Posts

Hi All,


I have searched everywhere for this and I think I am missing something...


I installed the PEF v2_0j (#2202)contribution on my store. It was not a fresh install, so I did it manually. I also have the MorePics 6 (#1611) contribution installed.


I cannot seem to figure out how to get the fields to show up and work on the advanced search. I opened the advanced_search.php file in the folder "Extra_example_for_4_fields_in_search" that came with the contribution and took this code:


<td class="fieldKey"><?php echo ENTRY_RESPONSE; ?></td>
			<td class="fieldValue"><?php echo tep_draw_input_field('response'); ?><span class="main"> <?php echo RESPONSE; ?></span></td>
			<td class="fieldKey"><?php echo ENTRY_KONTRAST; ?></td>
			<td class="fieldValue"><?php echo tep_draw_input_field('kontrast'); ?><span class="main"> <?php echo KONTRAST; ?></span></td>
			<td class="fieldKey"><?php echo ENTRY_DVI; ?></td>
			<td class="fieldValue"><?php echo tep_draw_input_field('dvi'); ?><span class="main"> <?php echo DVI; ?></span></td>
			<td class="fieldKey"><?php echo ENTRY_ZOLL; ?></td>
			<td class="fieldValue"><?php echo tep_draw_input_field('zoll'); ?><span class="main"> <?php echo ZOLL; ?></span></td>


And put it in my advanced_search.php file where I want it to show up. The field names are just ones that he had in there (The "kontrast," "zoll" etc.) but I am sort of at a loss as to what to change them to. For example, I want one field to be for "Condition" and have a field for this in my MySQL database table for Product Extra fields, but I am not sure how to "tie it" to the above code (I am not a total amateur when it comes to php and MySQL, but close). I tried


<td class="fieldKey"><?php echo ENTRY_ZOLL; ?></td>
			<td class="fieldValue"><?php echo tep_draw_input_field('condition'); ?><span class="main"> <?php echo ZOLL; ?></span></td>


but if I put anything in the fields it gives me the "At least one of the fields in the search form must be entered" error.


I also tried adding condition at the top of the page here:


function check_form() {
 var error_message = "Errors have occured during the process of your form.\n\nPlease make the following corrections:\n\n";
 var error_found = false;
 var error_field;
 var pubdate = document.advanced_search.condition.value;
 var keywords = document.advanced_search.keywords.value;
 var dfrom = document.advanced_search.dfrom.value;
 var dto = document.advanced_search.dto.value;
 var pfrom = document.advanced_search.pfrom.value;
 var pto = document.advanced_search.pto.value;
 var pfrom_float;
 var pto_float;


but that was just a stab in the dark...I'm not really sure how that ties into the scheme of things either.


PEF works fine, shows up for all the products where I have something filled in, and doesn't if the field is blank.


I will post my other code if you need it (advanced_search_result.php.....?) but I'm not sure what would help and didn't want to post thousands of lines unless it is needed.


Any help on this would be GREATLY appreciated...I have been trying to figure it out for two days.


Best Regards,


Link to comment
Share on other sites

  • 2 weeks later...

Consider this to be a "misery loves company" bump.

I only wish I could help you. But what I'm trying has some similarities.


I'm attempting to put a couple of "advanced_search.php" search functions in the Allprods contribution. Drop boxes for category & manufacturer, I'm getting closer but it still doesn't work.

I posted a screen shot My try I since added the submit button.


<!-- my add in -->

		<td><?php echo tep_draw_form('advanced_search2', tep_href_link(FILENAME_ADVANCED_SEARCH_RESULT, '', 'NONSSL', false), 'get', 'onSubmit="return check_form(this);"') . tep_hide_session_id(); ?><table border="0" width="100%" cellspacing="0" cellpadding="2">
		  <tr><td class="fieldKey"><?php echo ENTRY_CATEGORIES; ?></td>
			<td class="fieldValue"><?php echo tep_draw_pull_down_menu('categories_id', tep_get_categories(array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES)))); ?></td><td class="fieldKey"><?php echo ENTRY_MANUFACTURERS; ?></td>
			<td class="fieldValue"><?php echo tep_draw_pull_down_menu('manufacturers_id', tep_get_manufacturers(array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS)))); ?></td>
</td><td><?php echo tep_image_submit('button_search.gif', IMAGE_BUTTON_SEARCH); ?></td>

	  <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
<!-- end add in -->

Any thoughts or help would be way cool.

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.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.

  • Create New...