[Skip to main content](#vessel-content)

#   manipulate search

##

- **[ronron](/forum/user/40399-ronron "View ronron's Profile")**
- [![ronron's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/bad_baby.jpg)](/forum/user/40399-ronron "View ronron's Profile") Topic Author
- [ Offline](/forum/user/40399-ronron)

Less More

- Posts: 490
- Thank you received: 2
-
-

10 years 2 weeks ago [\#253489](#253489) by [ronron](/forum/user/40399-ronron "View ronron's Profile")  *[manipulate search](/forum/45-filters-search/887134-manipulate-search#253489 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  how do i manipulate the searches? i want to add paid results into the searches.  maybe on top and bottom of the results.  thanks")* was created by *[ronron](/forum/user/40399-ronron "View ronron's Profile")*

-- HikaShop version -- : 2.6.3
-- Joomla version -- : 3.4.5
-- PHP version -- : 5.5
-- Error-message(debug-mod must be tuned on) -- : none

hi

how do i manipulate the searches? i want to add paid results into the searches.

maybe on top and bottom of the results.

thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4NzEzNC1tYW5pcHVsYXRlLXNlYXJjaD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

10 years 2 weeks ago [\#253492](#253492) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[manipulate search](/forum/45-filters-search/887134-manipulate-search#253492 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  how do i manipulate the searches? i want to add paid results into the searches.  maybe on top and bottom of the results.  thanks")*

Hi,

On the searches of the Joomla search module ?
In that case, the order of the results depends on the order of the different plugins. And for the results of HikaShop it's either ordered based on the latest modification date, the creation date, the number of hits of the page, or alphabetically.
If you want to change the order of the product results in the search module of Joomla, you would have to change the code: Code:

switch($ordering){ case 'alpha': $order = 'a.product_name ASC'; break; case 'newest': $order = 'a.product_modified DESC'; break; case 'oldest': $order = 'a.product_created ASC'; break; case 'popular': $order = 'a.product_hit DESC'; break; case 'category': default: $order = 'a.product_name DESC'; break; }

in the file plugins/search/hikashop_products/hikashop_products.php

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4NzEzNC1tYW5pcHVsYXRlLXNlYXJjaD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[ronron](/forum/user/40399-ronron "View ronron's Profile")**
- [![ronron's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/bad_baby.jpg)](/forum/user/40399-ronron "View ronron's Profile") Topic Author
- [ Offline](/forum/user/40399-ronron)

Less More

- Posts: 490
- Thank you received: 2
-
-

10 years 2 weeks ago [\#253541](#253541) by [ronron](/forum/user/40399-ronron "View ronron's Profile")  Replied by *[ronron](/forum/user/40399-ronron "View ronron's Profile")* on topic *[manipulate search](/forum/45-filters-search/887134-manipulate-search#253541 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  how do i manipulate the searches? i want to add paid results into the searches.  maybe on top and bottom of the results.  thanks")*

hi thanks

what about text filters?

how can i add random results on top and at the bottom of filter result?

example:

if i search "mobile phone" on the text filters the usual result will be

phone 1
phone 2
phone 2
phone 4

this is only an example. how can i add a preferred result like "preferred phone"? so it should look something like

**preferred phone**
phone 1
phone 2
phone 2
phone 4

the objective here is to add entries for paying customers to be on top of the search filter

thanks

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4NzEzNC1tYW5pcHVsYXRlLXNlYXJjaD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

10 years 2 weeks ago [\#253552](#253552) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[manipulate search](/forum/45-filters-search/887134-manipulate-search#253552 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  how do i manipulate the searches? i want to add paid results into the searches.  maybe on top and bottom of the results.  thanks")*

Hi,

In that case I see several solutions but they will require some development.
You could have a small plugin and implement the onBeforeProductListingLoad trigger to change the MySQL loading the products:
[ www.hikashop.com/support/documentation/6...reProductListingLoad](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#onBeforeProductListingLoad)
For example, by modifying the $order variable which contains the "ORDER BY ... ASC/DESC" part of the query loading the results so that you would also base yourself on a custom product field.
Or for a more complex solution, you could implement the onHikashopBeforeDisplayView trigger to append the data of such products that you would load yourself into the $view-&gt;rows array of the view displaying the results:
[ www.hikashop.com/support/documentation/6...hopBeforeDisplayView](https://www.hikashop.com/support/documentation/62-hikashop-developer-documentation.html#onHikashopBeforeDisplayView)
I would personally recommend the first approach which is much simpler and easier to implement.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4NzEzNC1tYW5pcHVsYXRlLXNlYXJjaD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[ronron](/forum/user/40399-ronron "View ronron's Profile")**
- [![ronron's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/gallery/bad_baby.jpg)](/forum/user/40399-ronron "View ronron's Profile") Topic Author
- [ Offline](/forum/user/40399-ronron)

Less More

- Posts: 490
- Thank you received: 2
-
-

10 years 5 days ago -  10 years 5 days ago [\#254799](#254799) by [ronron](/forum/user/40399-ronron "View ronron's Profile")  Replied by *[ronron](/forum/user/40399-ronron "View ronron's Profile")* on topic *[manipulate search](/forum/45-filters-search/887134-manipulate-search#254799 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  how do i manipulate the searches? i want to add paid results into the searches.  maybe on top and bottom of the results.  thanks")*

thank you

lets go with the easier one.

already so onBeforeCategoryListingLoad(&amp;$filters).

is there a guideline on how to do this safely? which file and where is the file asociated with this? any samples where i can start?

thanks so much

Last edit: 10 years 5 days ago by [ronron](/forum/user/40399-ronron "View ronron's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4NzEzNC1tYW5pcHVsYXRlLXNlYXJjaD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

- **[nicolas](/forum/user/63-nicolas "View nicolas's Profile")**
- [![nicolas's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar63.png?1793428657)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86555
- Thank you received: 14304
-
-

10 years 5 days ago [\#254823](#254823) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[manipulate search](/forum/45-filters-search/887134-manipulate-search#254823 "-- HikaShop version -- : 2.6.3 -- Joomla version -- : 3.4.5 -- PHP version -- : 5.5 -- Error-message(debug-mod must be tuned on) -- : none  hi  how do i manipulate the searches? i want to add paid results into the searches.  maybe on top and bottom of the results.  thanks")*

Hi,

You can see an example with this plugin:
[ www.hikashop.com/support/forum/4-how-to/...ale-date.html#128950](https://www.hikashop.com/support/forum/4-how-to/31934-start-a-end-sale-date.html#128950)

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtL2ZpbHRlcnMtc2VhcmNoLzg4NzEzNC1tYW5pcHVsYXRlLXNlYXJjaD90bXBsPW1hcmtkb3du) or [Create an account](/component/users/registration?Itemid=101) to join the conversation.

Board Categories HikaShop Install &amp; Update Product &amp; Category Display Content Creation Sales and Orders Orders management Reports &amp; Statistics Customers Checkout Payment Methods Shipping Methods Import &amp; Export (CSV, XLS…) Specific Features Affilation Taxes Wishlist Vote Carousel &amp; Slider Mass Actions Filters &amp; Search Discount &amp; Coupon Feature Request Integrations Showcase General Talk about HikaShop Development HikaShop 3.0 Beta Translation Commercial Jobs HikaShop Components HikaMarket Market: Feature requests Market: How to? Market: Bug Report HikaSerial General talk about HikaSerial Serial: Bug Report Serial: How to? Support en Français de HikaSerial (French Support) HikaSubscription HikaAuction Auction: Feature requests Auction: How to? Auction: Bug report Hikashop around the world Support en Français (French Support) Russian FAQ. Курс выживания с Hikashop. Частые вопросы и о Расширения Hikashop Наши сайты на Hikashop 日本語版サポート(Japanese Support) Thai German Archives Bug Report How to?

[](/forum/topics/feed/mode-topics?format=feed&type=rss)

Time to create page: 0.072 seconds

[Powered by](/forum/credits) [Kunena Forum](https://www.kunena.org)
