![]() |
This works
I have been using this mod with great success. I found that if user searches for sku in advanced search no result is found. could advance search use diff. page?
|
Search Variants in 4.0.10 Code
This is a great mod. I just changed the code to work with 4.0.10. include/search.php now finds variants in a search. Can someone check this to see if it's correct? It does work for me:
include/search.php find Code:
if (empty($data["by_title"]) && empty($data["by_shortdescr"]) && empty($data["by_fulldescr"]) && empty($data["extra_fields"])) { Code:
if (empty($data["by_title"]) && empty($data["by_shortdescr"]) && empty($data["by_fulldescr"]) && empty($data["by_productcode"]) && empty($data["extra_fields"])) { Code:
if (!empty($data["by_fulldescr"])) { Code:
if (!empty($data["by_fulldescr"])) { I don't know PHP and wouldn't even call myself a developer. Just a lowly store owner who wants a "search" that works. Can anyone out there tell me if this is correct or what should be modified? It works fine for me and finds variants in a search, but it was trial and error as the original and subsequent code on this post weren't compatible w/ 4.0.10 - categories didn't show up in search (admin). If you use this, be sure to backup - I only said it works for me, but maybe it could be checked by someone? Thanks, Mike |
mffowler
I typed in the numbers of the sku but not the letters "sku" and it worked great! :D |
Great mod! works for me! (see version below)
|
Tried and failed to do this.
I am one of those who would rather buy a mod. I not a programmer and dont want to be, I run a business and I am short on time, can anyone recommend a mod that searches by sku, I have 20000 products and on our website xcart 4.13 and the search is crap.
Recommendations please. I think this cart is great and simple. Got 20,000 products and 7,000 cats and only being using it for 4 days. MOD IN SEARCH PLEASE. Or if someone wants to write one even better let me know the cost. Bill Gray |
Re: Tried and failed to do this.
Quote:
The notes here will help you do this or if you need it done for you then hire someone to go under the hood and do the coding |
Great Mod, took 5 minutes if that... Thanks alot for posting it!!
|
I implemented the mod, as well as the changes in the replies (to work for all SKUs, including variants), and it doesn't show any results for any product SKUs.
I am running the version is my sig. |
Seems like all you have to do is add the input box to the search form.
Code:
<INPUT type="hidden" name="posted_data[by_productcode]" value="Y" /> |
Re: Include search by SKU into basic search in v4
[quote="27stars"]Hi there,
v4 has some nice features and some not-finished business. Why would x-men include search by SKU/product code in advanced search when this is one of the main search fields people are looking for rpoducts in a lot of industries (auto, computers and etc? Here is the simple mod to search by sku from the main search box: search.php change: Code:
if (empty($data["by_title"]) && empty($data["by_shortdescr"]) && empty($data["by_fulldescr"]) && empty($data["extra_fields"])) { to Code:
if (empty($data["by_title"]) && empty($data["by_shortdescr"]) && empty($data["by_fulldescr"]) && empty($data["by_productcode"]) && empty($data["extra_fields"])) { I have version 4.0.17 and the search.php code is different. Is ther an update to this mod? Here is my code: # # $Id: search.php,v 1.2.2.3 2005/01/14 12:07:30 max Exp $ # require "./auth.php"; define("GET_ALL_CATEGORIES", true); require $xcart_dir."/include/categories.php"; if($active_modules["Manufacturers"]) include $xcart_dir."/modules/Manufacturers/customer_manufacturers.php"; $tmp=strstr($QUERY_STRING, "$XCART_SESSION_NAME="); if (!empty($tmp)) $QUERY_STRING=ereg_replace("$XCART_SESSION_NAME=([0-9a-zA-Z]*)", "", $QUERY_STRING); if(!empty($active_modules['SnS_connector']) && $REQUEST_METHOD == 'POST') { if($simple_search == 'Y') { func_generate_sns_action("SiteSearch"); } else { func_generate_sns_action("AdvancedSearch"); } } x_session_register("search_data"); $search_data["products"]["forsale"] = "Y"; include $xcart_dir."/include/search.php"; if (!empty($QUERY_STRING)) { $location[] = array(func_get_langvar_by_name("lbl_search_results "), ""); $smarty->assign("main","search"); } else { $location[] = array(func_get_langvar_by_name("lbl_advanced_searc h"), ""); $smarty->assign("main","advanced_search"); } # Assign the current location line $smarty->assign("location", $location); func_display("customer/home.tpl",$smarty); ?> Thanks! |
All times are GMT -8. The time now is 07:23 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.