Who do I use search condition pid

In /include/common/search_products.php, I see a search criteria I would like to use


$search_data['search_product_id'] = empty($pid) ? '' : $pid;



with ?target=products&mode=search&pid=20

This one allows me to search by product_id and works fine.




$search_data['search_product_ids'] = empty($pids) ? '' : $pids;



with ?target=products&mode=search&pids=20,21

How do you use this one? I tried this one, but I get this error.


Warning: array_map() [function.array-map]: Argument #2 should be an array in /home/topoffic/public_html/include/common/search_products.php on line 201

Warning: implode() [function.implode]: Invalid arguments passed in /home/topoffic/public_html/include/common/search_products.php on line 201




Here’s the code block at 201


if (!empty($search_data['search_product_ids']) || !empty($search_data['search_category_ids'])) {
$search_condition .= ' AND (';
// Product IDs search condition for SQL query
if (!empty($search_data['search_product_ids'])) {
$search_condition .= " products.product_id IN ('".implode("','",array_map('intval', $search_data['search_product_ids']))."') ";
}




My goal is to be able to construct a url like ?pids=20,21 and have the results be those two products .



Thanks

I just realized I posted this question about a month ago



[url]http://forum.cs-cart.com/showthread.php?t=9216&highlight=pids[/url]



But I did get any response.



Would begging help?



[url]404页面

Here’s my solution:



You can make it work by modifying this line of code



$search_condition .= " products.product_id IN ('".implode("','",array_map('intval', $search_data['search_product_ids']))."') ";
to this



$search_condition .= " products.product_id IN ('".implode("','",array_map('intval', explode(",",$search_data['search_product_ids'])))."') ";




I can’t exactly say what this will change, but I don’t see anything that it would.

Yes!



mdekok3000,



Thanks a million, you have truly been a great help to me.



Happy Holidays.