@Frosticek
In some of your themes, like
Veronika you're using a function from the
List Seller Items plugin, that gives us the ability to view the seller items inside the
Search section, like in the below screenshot.
This is pretty awesome, as in theory, you can view and sort the user items based on categories, price etc.
Now the problem appears when you use that plugin on other themes (and even Veronika) and you try to actually sort those items.
For example, when I click on view
Only items with picture, the search returns ALL items with pictures and not the ones from the actual seller.
It happens because of the following:
- First time you view the user items, the query is: mysite/search/seller_post,5
- When you try to view the user items with pictures for example, the query turns into: mysite/search/sOrder,dt_pub_date/sShowAs,gallery/iOrderType,desc/bPic,1
This will return all items with pictures, and not just the ones from the seller.
To make it work properly, the script should return:
mysite/search/sOrder,dt_pub_date/sShowAs,gallery/iOrderType,desc/bPic,1/seller_post,5- In case of
Veronika:
veronika.mb-themes.com/search/sOrder,dt_pub_date/iOrderType,desc/bPic,1/seller_post,5The question is, how do I do that?
How do I keep the user id in the search query?
In the plugin, the code that handles this is:
function display_search($params = null){
if ($params == null) {
return false ;
}
foreach ($params as $key => $value) {
if ($value != '') {
// We may want to have param-specific searches
switch ($key) {
case 'seller_post':
Search::newInstance()->addConditions(sprintf("%st_item.fk_i_user_id = %d ", DB_TABLE_PREFIX, $value)) ;
break ;
}
}
}
}
Any ideas?
Thanks!