![]() |
Include search by SKU into basic search in v4
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"])) { after Code:
if (!empty($data["by_fulldescr"])) add Code:
if (!empty($data["by_productcode"])) skin1/customer/search.tpl after Code:
<INPUT type="hidden" name="posted_data[by_fulldescr]" value="Y"> add Code:
<INPUT type="hidden" name="posted_data[by_productcode]" value="Y"> skin1/customer/main/search_result.tpl after Code:
<TD width="5"><INPUT type="checkbox" name="posted_data[by_fulldescr]"{if $search_prefilled eq "" or $search_prefilled.by_fulldescr} checked{/if}></TD><TD nowrap>{$lng.lbl_det_description}</TD> add Code:
<TD width="5"><INPUT type="checkbox" name="posted_data[by_productcode]"{if $search_prefilled eq "" or $search_prefilled.by_productcode} checked{/if}></TD><TD nowrap>{$lng.lbl_sku}</TD> Enjoy :wink: |
Anyone used this on version 3.5._?
|
Quote:
It's completely different in v3.5. I believe there is a solution on this forum to do the same in v3.5. Check: http://forum.x-cart.com/viewtopic.php?t=5971 |
Thanks. I found a fix for this that Boomer had posted. Works great!
|
Is it possible to have TWO boxes on the main page? Search ProdID and Search SKU ??
|
I don't seem to find search.php in /customer? It is in the root directory and /includes, but different than this example.
Can you point me in the right direction, so that SKU can come up in the search and advanced? Thanks, Mike |
thanks for the mod :) worked perfectly 8)
|
Quote:
yeh use the one in includes ;) |
This is a great mod!!!!
Xcart should take note and realize this should be standard operating procedure. The mod does lack one thing. It will not bring up "variant skus" When using product variants, those skus don't work. No fear, I have an adjustment for the original poster. include/search.php After: Code:
if (!empty($data["by_fulldescr"])) Code:
if (!empty($data["by_productcode"])){ And all is peaceful in Xcart land once again ;) |
Fantastic mod, thank you =D>
|
All times are GMT -8. The time now is 11:27 PM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.