swathi shetty Posted April 29, 2019 Share Posted April 29, 2019 BestSeller module of prestashop showing random and incorrect products in bestseller block on the homepage whereas it shows the correct bestsellers when we directly click on the link for bestselling in the bestsales product page Need help please soon. Link to comment Share on other sites More sharing options...
Nishith Nesdiya Posted April 29, 2019 Share Posted April 29, 2019 Hi.. which PS version you use ? Thanks Link to comment Share on other sites More sharing options...
swathi shetty Posted April 29, 2019 Author Share Posted April 29, 2019 prestashop 1.7.4.3 Thanks in advance Link to comment Share on other sites More sharing options...
swathi shetty Posted April 30, 2019 Author Share Posted April 30, 2019 hello.. someone please help!! Link to comment Share on other sites More sharing options...
Nishith Nesdiya Posted April 30, 2019 Share Posted April 30, 2019 (edited) Hi.. can you share your store url ? because default prestashop best seller module working fine for me Thanks Edited April 30, 2019 by Nishith (see edit history) Link to comment Share on other sites More sharing options...
swathi shetty Posted April 30, 2019 Author Share Posted April 30, 2019 www.sway.qa thanks Link to comment Share on other sites More sharing options...
swathi shetty Posted April 30, 2019 Author Share Posted April 30, 2019 now when i get the bestselling products in homepage it appears in random order as i have selected order by->price in descending order. but i want the homepage products to be displayed based on highest sales . can you help me with how to edit it Link to comment Share on other sites More sharing options...
Nishith Nesdiya Posted May 1, 2019 Share Posted May 1, 2019 Hi.. Goto your module/ps_bestsellers/ps_bestsellers.php Approx line number 230 find this code $query->setSortOrder(SortOrder::random()); To $query->setSortOrder(new SortOrder('product', 'sales', 'desc')); Not testing code but i hope work for you Thanks 1 Link to comment Share on other sites More sharing options...
SalDan Posted March 8, 2021 Share Posted March 8, 2021 On 1/5/2019 at 14:43, Nishith said: Ciao .. Vai al tuo modulo / ps_bestsellers / ps_bestsellers.php Circa il numero di riga 230 trova questo codice $ query-> setSortOrder (SortOrder :: random ()); A $ query-> setSortOrder (new SortOrder ('product', 'sales', 'desc')); Non sto testando il codice ma spero di lavorare per te Grazie Ciao, ho un problema con il random dei prodotti piu venduti cerco di spiegarmi al meglio quando i clienti effettuano un ordine il prodotto venduto si va a posizionare per ultimo non per primo e dato che ho impostato solo la visualizzazione di 4 prodotti non si cambiano e restano sempre i soliti. Ho modificato ps_bestsellers.php con questo $ query-> setSortOrder (new SortOrder); e mi funziona bene per la mia richiesta solo che mi comporta problemi nel BO quando vado a modificare un prodotto o aggiungere un new prodotto mi da errore "impossibile aggiornare impostazione" tutto questo a causa di questa modifica "rilevata con la modalita degug" mi puoi aiutare grazie anticipatamente Salvatore Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now