I have tried this, and other things, but can't get it to work. I added a field named "item_number" to my products table, and just want to make that searchable - I am running v1.3.8a
Thanks
Printable View
z3n,
I didn't get that, you meant you searched for a value stored in the field you added? and it didn't return that?Quote:
I have tried this, and other things, but can't get it to work.
Since it is simple and should work without any problem, I'm not able to guess what went wrong.
Please zip all the files in which you made changes with a comment and attach them here, I'll check it at my end.
Rajeev Sharma
I have managed to implement custom advanced search which search to and from (like price), I had to add some additions to th JS file also to stop the popup message causing an error....
My problem is I have alot of custom fields and I need to implement an if or case statement that will prevent all of my new fields showing up if they are not there(empty). I have customized the product listing page to do this, but the header_php (advanced search result page) file is set up differently.
in the product listing i have achieved it like this
case 'PRODUCT_LIST_D':
if ($listing->fields['products_D']=='0') {
//hide image column
$lc_text = '';
$lc_align = '';
$params= 'class="productListing-invis"';
} else {
$lc_text = '<div title="D (mm)">' . $listing->fields['products_D'] . '</div>';
$lc_align = 'right';
$params= 'class="productListing-heading"';
$zc_col_count_description++;}
break;
however it is stuctured completly differently in header_php
case 'PRODUCT_LIST_D':
$order_str .= "p.products_D";
break;
etc
Has anyone customized the advanced search result to do this? EG not show empty custom fields/columns.....
What I think I need to do is use the php unset function to take out fields from the array if the result has no value....
Below i am trying to take out AP
- Its not working
$define_list = array('PRODUCT_LIST_MODEL' => PRODUCT_LIST_MODEL,
'PRODUCT_LIST_NAME' => PRODUCT_LIST_NAME,
'PRODUCT_LIST_MANUFACTURER' => PRODUCT_LIST_MANUFACTURER,
'PRODUCT_LIST_PRICE' => PRODUCT_LIST_PRICE,
'PRODUCT_LIST_THREAD_M' => PRODUCT_LIST_THREAD_M,
'PRODUCT_LIST_D' => PRODUCT_LIST_D,
'PRODUCT_LIST_L' => PRODUCT_LIST_L,
'PRODUCT_LIST_H' => PRODUCT_LIST_H,
'PRODUCT_LIST_AP' => PRODUCT_LIST_AP,
'PRODUCT_LIST_QUANTITY' => PRODUCT_LIST_QUANTITY,
'PRODUCT_LIST_WEIGHT' => PRODUCT_LIST_WEIGHT,
'PRODUCT_LIST_IMAGE' => PRODUCT_LIST_IMAGE);
if ($listing->fields['AP']=='0')
{
unset($define_list ['PRODUCT_LIST_AP']);
}
- I think I need to change $listing->fields to something but dont know what - I know it is $product_info->fields on product info pages etc but dont know on this one. If there is a better way then, please let me know the solution...
Has anyone managed to get this to work?
I have added a UPC, ASIN, PID, SKU & Even a Vendor SKU product field to my Products Info Page using custom fields.
Can see it here
My customers can search and get exact match for UPC, ASIN, PID, SKU and other hidden fields that I am testing to further categorize product without creating categories.
Is this what you are trying to do?
I dont know if your question was addressed at me but I still would like any ideas regarding my situation.
I have successfully customized advanced search
http://www.fastenerforce.co.uk/
however the results page runs from the product listing template - which should display css-column collapse - it does in the product listing but the advanced search list columns arent registering it and displaying empty columns which is clunky......
Hi
I am also trying to amend the search function. I am working on a site that sells tyres. Tyres have certain characteristics that are used when searching for the tyres for your vehicle:
Width
Profile
Wheel Size
Load Index
Speed Rating
I have created a new table PRODUCTS_TYRES with products_id as the key and then products_width, products_profile, products_wheel_size, products_load_index, products_speed_rating as fields within the table.
I do not want to search on any of the traditional search variables as these are not required.
I believe that I have created the correct result array and that the array is sorted alphabetically. I have created the SELECT, FROM and WHERE strings.
However when I try the page, using just the width search term (I will add the code for the other fields once I know that is working correctly) I get an error message that "At least one of the fields in the search form must be entered".
Here is the page:
http://www.tyrexchange.co.uk/index.p...dvanced_search
Has anybody got any ideas that may help me as I have been scratching my head on this for two days now?
Thanks in advance
Mike
I had this problem, cant remember but think you add your fields at the top eg.
(isset($_GET['s_dfrom']) && !is_numeric($_GET['s_dfrom'])) &&
(isset($_GET['s_dto']) && !is_numeric($_GET['s_dto']))&&
think you add your code at the top. You could delete the message stack or add your own custom ones eg...
if (($L_D_check_error == false) && is_numeric($L_dto) && is_numeric($L_dfrom)) {
if ($L_dfrom >= $L_dto) {
$error = true;
$messageStack->add_session('search', " L (mm) From value should be less than L (mm) To value");
}
}
help!:wacko:
I've followed zvenson code from earlier in this thread but it doesn't seem to be working for me.
The biggest issue seems to be the extra table I have isn't be included in the sql query (I'm echoing it to the page for testing).
I have an extra table with a product_id which matches products table id's, each record has an extra field called p_added_make which is what I'm searching against.
USING(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c )
LEFT JOIN " . TABLE_ADDED_FIELDS. " pu
ON pu.products_id= p2c.products_id
LEFT JOIN " . TABLE_META_TAGS_PRODUCTS_DESCRIPTION . " mtpd
ON mtpd.products_id= p2c.products_id
AND mtpd.language_id = :languagesID";
on the site the extra table is not appearing in the query.
USING(manufacturers_id), z_table_products_description pd, z_table_categories c, z_table_products_to_categories p2c ) LEFT JOIN z_table_meta_tags_products_description mtpd ON mtpd.products_id= p2c.products_id AND mtpd.language_id = 1
the table prefix is correct (TABLE_ADDED_FIELDS) but am I missing something else.
Should there be something in the SELECT DISTINCT part of the query?