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

#   pagination perdue en aleatoire

##

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile") Topic Author
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2697
- Thank you received: 74
-
-

10 years 5 months ago -  10 years 5 months ago [\#240357](#240357) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  *[pagination perdue en aleatoire](/forum/5-support-en-francais-french-support-/884565-pagination-perdue-en-aleatoire#240357 "-- HikaShop version -- : 263 -- Joomla version -- : 351  Bonjour  si je passe une liste de produit (qui normalement a 4 pages) en tri aléatoire la pagination disparait  savez vous pourquoi ?  merci")* was created by *[erickb](/forum/user/4069-erickb "View erickb's Profile")*

-- HikaShop version -- : 263
-- Joomla version -- : 351

Bonjour

si je passe une liste de produit (qui normalement a 4 pages) en tri aléatoire la pagination disparait

savez vous pourquoi ?

merci

Last edit: 10 years 5 months ago by [erickb](/forum/user/4069-erickb "View erickb's Profile").

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODg0NTY1LXBhZ2luYXRpb24tcGVyZHVlLWVuLWFsZWF0b2lyZT90bXBsPW1hcmtkb3du) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86293
- Thank you received: 14271
-
-

10 years 5 months ago [\#240365](#240365) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[pagination perdue en aleatoire](/forum/5-support-en-francais-french-support-/884565-pagination-perdue-en-aleatoire#240365 "-- HikaShop version -- : 263 -- Joomla version -- : 351  Bonjour  si je passe une liste de produit (qui normalement a 4 pages) en tri aléatoire la pagination disparait  savez vous pourquoi ?  merci")*

Bonjour,

Oui. Lorsque vous passez un listing en tri aléatoire, à chaque fois que vous affichez la page, la requête MySQL recalcule aléatoirement l'ordre des éléments. Mettre plusieurs pages n'aurait aucun sens dans ce cas vu que les produits seraient de toute façon choisis aléatoirement sur chaque page et il serait possible de retrouver plusieurs fois certains produits, et certains autres produits aucune fois, en regardant chaque page une fois.

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

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile") Topic Author
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2697
- Thank you received: 74
-
-

10 years 5 months ago [\#240396](#240396) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[pagination perdue en aleatoire](/forum/5-support-en-francais-french-support-/884565-pagination-perdue-en-aleatoire#240396 "-- HikaShop version -- : 263 -- Joomla version -- : 351  Bonjour  si je passe une liste de produit (qui normalement a 4 pages) en tri aléatoire la pagination disparait  savez vous pourquoi ?  merci")*

pour le client ca a du sens d'avoir la sensation de plusieurs page de produits, on pense qu'il y en a 80 ou 100 alors que là on croit qu'il y en a juste que 20
il n'y a pas d'option pour laisser quand meme la pagination ?

merci

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODg0NTY1LXBhZ2luYXRpb24tcGVyZHVlLWVuLWFsZWF0b2lyZT90bXBsPW1hcmtkb3du) 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)](/forum/user/63-nicolas "View nicolas's Profile")
- [ Offline](/forum/user/63-nicolas)

Less More

- Posts: 86293
- Thank you received: 14271
-
-

10 years 5 months ago [\#240408](#240408) by [nicolas](/forum/user/63-nicolas "View nicolas's Profile")  Replied by *[nicolas](/forum/user/63-nicolas "View nicolas's Profile")* on topic *[pagination perdue en aleatoire](/forum/5-support-en-francais-french-support-/884565-pagination-perdue-en-aleatoire#240408 "-- HikaShop version -- : 263 -- Joomla version -- : 351  Bonjour  si je passe une liste de produit (qui normalement a 4 pages) en tri aléatoire la pagination disparait  savez vous pourquoi ?  merci")*

Pas d'option non, car je trouvais ça illogique.
C'est géré par ce code: Code:

if(!$this-&gt;params-&gt;get('random')){ $this-&gt;params-&gt;set('show_limit',1); }

dans components/com_hikashop/views/product/view.html.php
Donc je suppose qu'un Code:

if($this-&gt;params-&gt;get('random')){ $this-&gt;params-&gt;set('show_limit',1); }

au début du fichier "listing" de la vue "product" via le menu Affichage&gt;vues devrait permettre cela.

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

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile") Topic Author
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2697
- Thank you received: 74
-
-

10 years 5 months ago -  10 years 5 months ago [\#240509](#240509) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[pagination perdue en aleatoire](/forum/5-support-en-francais-french-support-/884565-pagination-perdue-en-aleatoire#240509 "-- HikaShop version -- : 263 -- Joomla version -- : 351  Bonjour  si je passe une liste de produit (qui normalement a 4 pages) en tri aléatoire la pagination disparait  savez vous pourquoi ?  merci")*

oui c'est vrai que c'est plus logique mais mon client le demande

merci pour le code

l'ideal serait un tri aleatoire des ID et paginer apres en ayant les id differents en memoire

Last edit: 10 years 5 months ago by [erickb](/forum/user/4069-erickb "View erickb's Profile").

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

10 years 5 months ago [\#240575](#240575) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[pagination perdue en aleatoire](/forum/5-support-en-francais-french-support-/884565-pagination-perdue-en-aleatoire#240575 "-- HikaShop version -- : 263 -- Joomla version -- : 351  Bonjour  si je passe une liste de produit (qui normalement a 4 pages) en tri aléatoire la pagination disparait  savez vous pourquoi ?  merci")*

Bonjour,

Heu... non.
Quand un listing peut contenir plusieurs milliers de produits et avoir des centaine d'utilisateur on ne s'amuse pas à faire de l'aléatoire stocké en mémoire du serveur. Et je n'ose même pas imaginer la requête SQL qui doit forcer un order ou alors charger tous les produits pour les ordonner "à la main".
C'est suicidaire.

Cordialement,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

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

- **[erickb](/forum/user/4069-erickb "View erickb's Profile")**
- [![erickb's Avatar](https://www.hikashop.com/media/kunena/core/svg/person.svg)](/forum/user/4069-erickb "View erickb's Profile") Topic Author
- [ Offline](/forum/user/4069-erickb)

Less More

- Posts: 2697
- Thank you received: 74
-
-

10 years 5 months ago -  10 years 5 months ago [\#240585](#240585) by [erickb](/forum/user/4069-erickb "View erickb's Profile")  Replied by *[erickb](/forum/user/4069-erickb "View erickb's Profile")* on topic *[pagination perdue en aleatoire](/forum/5-support-en-francais-french-support-/884565-pagination-perdue-en-aleatoire#240585 "-- HikaShop version -- : 263 -- Joomla version -- : 351  Bonjour  si je passe une liste de produit (qui normalement a 4 pages) en tri aléatoire la pagination disparait  savez vous pourquoi ?  merci")*

il suffit d'une colonne en plus dans la table des produits product_rand , et de mettre a jour cette colonne (a définir comment et quand)
et la solution est tout simplement résolue

un truc du genre UPDATE #__hikashop_product SET product_rand = FLOOR(500000 * RAND()) + 1;

Last edit: 10 years 5 months ago by [erickb](/forum/user/4069-erickb "View erickb's Profile").

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

- **[Jerome](/forum/user/80-jerome "View Jerome's Profile")**
- [![Jerome's Avatar](https://www.hikashop.com/media/kunena/avatars/resized/size144/users/avatar80.png)](/forum/user/80-jerome "View Jerome's Profile")
- [ Offline](/forum/user/80-jerome)
- HikaShop core developer

Less More

- Posts: 26394
- Thank you received: 4078
-
- [](http://obsi.dev)
-

10 years 5 months ago [\#240590](#240590) by [Jerome](/forum/user/80-jerome "View Jerome's Profile")  Replied by *[Jerome](/forum/user/80-jerome "View Jerome's Profile")* on topic *[pagination perdue en aleatoire](/forum/5-support-en-francais-french-support-/884565-pagination-perdue-en-aleatoire#240590 "-- HikaShop version -- : 263 -- Joomla version -- : 351  Bonjour  si je passe une liste de produit (qui normalement a 4 pages) en tri aléatoire la pagination disparait  savez vous pourquoi ?  merci")*

Bonjour,

Tout à fait ce n'est plus de l'aléatoire ![:)](/media/kunena/emoticons/8.png ":)")
C'est un ordre définit et statique qui a été généré aléatoirement une seule fois.

Cordialement,

---

Jerome - Obsidev.com
HikaMarket &amp; HikaSerial developer / HikaShop core dev team.

Please [Log in](/login?return=aHR0cHM6Ly93d3cuaGlrYXNob3AuY29tL2ZvcnVtLzUtc3VwcG9ydC1lbi1mcmFuY2Fpcy1mcmVuY2gtc3VwcG9ydC0vODg0NTY1LXBhZ2luYXRpb24tcGVyZHVlLWVuLWFsZWF0b2lyZT90bXBsPW1hcmtkb3du) 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.111 seconds

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

[](#top)
