- Messaggi: 3
- Ringraziamenti ricevuti 0
Randomly results
- RafaelLuna
- Autore della discussione
- Offline
- Nuovo Utente
Less
Di più
10 Anni 1 Mese fa #1989
da RafaelLuna
Randomly results è stato creato da RafaelLuna
Hi,
Is there a way to make the result pages show by "Random" on productfinder?
I saw on another post that it is possible in custom properties
I thank you in advance for your attention to the present request.
Is there a way to make the result pages show by "Random" on productfinder?
I saw on another post that it is possible in custom properties
I thank you in advance for your attention to the present request.
Si prega Accesso o Crea un account a partecipare alla conversazione.
- andrea_4g
- Offline
- Amministratore
Less
Di più
- Messaggi: 1122
- Ringraziamenti ricevuti 163
10 Anni 1 Mese fa - 10 Anni 1 Mese fa #1991
da andrea_4g
Risposta da andrea_4g al topic Randomly results
Having the results randomly sorted defies the purpose of productfinder, that is to have results sorted by score with the most recommended items on top.
Could you please elaborate more?
Could you please elaborate more?
Ultima Modifica 10 Anni 1 Mese fa da andrea_4g.
Si prega Accesso o Crea un account a partecipare alla conversazione.
- RafaelLuna
- Autore della discussione
- Offline
- Nuovo Utente
Less
Di più
- Messaggi: 3
- Ringraziamenti ricevuti 0
10 Anni 1 Mese fa #1992
da RafaelLuna
Risposta da RafaelLuna al topic Randomly results
Hi Andrea, Thanks for your quick response.
I'm using productfinder to make a kind of "custom searcher". Let me explain, what i want to do is a little website where you can find recipes. It would be great that you could get only one recipe for each search.
Please excuse my limited English
I'm using productfinder to make a kind of "custom searcher". Let me explain, what i want to do is a little website where you can find recipes. It would be great that you could get only one recipe for each search.
Please excuse my limited English
Si prega Accesso o Crea un account a partecipare alla conversazione.
- andrea_4g
- Offline
- Amministratore
Less
Di più
- Messaggi: 1122
- Ringraziamenti ricevuti 163
10 Anni 1 Mese fa - 10 Anni 1 Mese fa #1995
da andrea_4g
Risposta da andrea_4g al topic Randomly results
There's a way, but it requires a tiny little modification to the code.
First you need to set questionnares parameters properly.
- Edit your questionnaire *menu item*.
- Set "Results limit" = 1
- Set "Primary order" = Score
This way the questionnaire will sort the results placing the ones with the highest scores at the top, and it will return only 1 result.
Then the add the following line of code to file components/com_productfinder/connectors/articles.php, at line 314
So that the bottom of that function looks like this:
First you need to set questionnares parameters properly.
- Edit your questionnaire *menu item*.
- Set "Results limit" = 1
- Set "Primary order" = Score
This way the questionnaire will sort the results placing the ones with the highest scores at the top, and it will return only 1 result.
Then the add the following line of code to file components/com_productfinder/connectors/articles.php, at line 314
Code:
$order = ' RAND()';
So that the bottom of that function looks like this:
Code:
...
case 'hits':
$order = 'pfitem_hits DESC';
break;
}
$order = ' RAND()';
return $order;
}
Ultima Modifica 10 Anni 1 Mese fa da andrea_4g.
Si prega Accesso o Crea un account a partecipare alla conversazione.
- RafaelLuna
- Autore della discussione
- Offline
- Nuovo Utente
Less
Di più
- Messaggi: 3
- Ringraziamenti ricevuti 0
10 Anni 1 Mese fa #2002
da RafaelLuna
Risposta da RafaelLuna al topic Randomly results
Thanks Andrea, working fine now.
Si prega Accesso o Crea un account a partecipare alla conversazione.
Tempo creazione pagina: 0.170 secondi