View Single Post
  #1  
Old 08-15-2003, 10:49 AM
 
rodneyw rodneyw is offline
 

Senior Member
  
Join Date: Mar 2003
Posts: 162
 

Default Provider Search/Display for productcode instead of productID

looking at it now it looks simple but it has drove me mad. Just incase anyone else can use this here it is. Ability to search products through provider by productcode. Display results uses productcode as well.

It is working on 3.4.4 and I think I have documented everything I did. If I need to repost complete code for the files let me know.
------------------------------------------------------------------

PHP File: provider/search.php
Around line 79
Change This Line:
Code:
$productid_condition = ($search_productid==""?"":"AND ($sql_tbl[products].productid='$search_productid') ");
To:
Code:
$productcode_condition = ($search_productcode==""?"":"AND ($sql_tbl[products].productcode='$search_productcode') ");

Around Line 87
Change This Line:
Code:
$productid_condition = ($search_productid==""?"":"AND ($sql_tbl[products].productid='$search_productid') ");
To:
Code:
$search_query = "1 ".$category_condition.$substring_condition.$provider_condition.$productcode_condition;

TEMPLATE File: skin1/main/search_results.tpl
Around Line 10
Change This Line:
Code:
<INPUT type=text name=search_productid size=6 value="{$smarty.get.search_productid}">
To:
Code:
<INPUT type=text name=search_productcode size=6 value="{$smarty.get.search_productcode}">


TEMPLATE File: skin1/main/products.tpl
Around Line 17
Change This Line:
Code:
<td width=1%>#{$products[cat_num].productid}</td>
To:
Code:
<td width=1%>#{$products[cat_num].productcode}</td>


Hope this helps someone
Reply With Quote