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