Customer Search for productcode or productID
I would like to ennabled Customer Search for productcode and productID
Whats to do? |
I am not sure but what I actually do is I add the sku before the Title of item so I can enter it into the search when I add products. Example (sh-2170 Sexy Satin Bustier) then if I wanted to look up via Satin Bustier I could or if I just wanted to look by item number I could type sh-2170. I know it isn't an advanced searh as you want but it is how I do it.
|
:wink: Somtimes a low-tech solution is the way to go.
Glen |
You can say that again. Then you don't have to worry about every month when the new update comes out did they make a change that will kill your customizations.
|
Edit customer/search.php:
Code:
if ($store_language != $config["default_customer_language"] && $substring) { :!: Note this was done with 3.4.5 and was line 81 to line 92. This can also be extended and an optional $substring_sku could be added and the advanced search (or basic search) form could have a "product code/sku" field. :wink: |
Check this out:
http://forum.x-cart.com/viewtopic.php?t=5971&highlight= |
Nice to see a mod that does all words or any words. However that code still doesn't include:
Code:
OR $sql_tbl[products].productcode like '%$substring%' Which is what search the product code/sku field in the products table ;) I've also got a sorting mod that can be purchased off www.cartlab.net that makes the sorting of products in the search results. I guess I should update it and add the ability to search the product code as an added bonus. Anyhow, kudos! :wink: |
Oops 8O forgot you wanted the ProductID's as well, this will work but may return some results with the product ID if some products descriptions contain the product ID number, again this could be a seperate substring variable like $substring_id that could easily be added to the search form as an additional "Search for Product ID" field.
Code:
if ($store_language != $config["default_customer_language"] && $substring) { Same lines of code in 3.4.5 (81 to 92). |
I added the code to search.php so I should be able to search for product code now?
Do I have to add another form and tell it what to look up in advanced_search.tpl? Or was that code built to use the product_title form already there? EDIT Also I get this error when I apply the code: Warning: Division by zero in /usr/www/htdocs/saddlemen/test_site/xcart_test/customer/search.php on line 111 Here is my line 111: $total_nav_pages = ceil($total_products_in_search/$config["General"]["products_per_page"])+1; Any Suggestions? |
The code uses the same search field to search for either the product name, description, full description, code/sku, and ID.
What version are you trying to apply the code too? $total_products_in_search is returning zero, so the math is trying to divide by zero. hth. ;) |
All times are GMT -8. The time now is 08:17 AM. |
Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.