Jump to content
mohcineel

SORT BY price not working on ps 1.7

Recommended Posts

Hello, i've just installed prestashop 1.7 on my server and added some products but when i select a categorie and use sort by price it gives a blank page with just the number of products, but the sort by name works, i parmetred the number of product per page to 80 .

this is the link to website

tachri.com 

Share this post


Link to post
Share on other sites

Hi,

I am experiencing the same thing and I noticed that if you disable the Faceted Search module, the sorting by price will work again.

let me know if it is the same for you.

I am still looking for a good solution as having the faceted search disabled is not a good option.

Thanks,

Slim 

 

Share this post


Link to post
Share on other sites

Hello,

as of FacetedSearch 3.2.1 you need to comment lines 333-335 in ps_facetedsearch/src/Adapter/MySQL.php:
 

//        if ($orderField === 'price') {
//            $orderField = $this->getOrderDirection() === 'asc' ? 'price_min' : 'price_max';
//        }

 

this change fixed it for me.

Share this post


Link to post
Share on other sites

 

 

Hi @karus,

 

You code works perfect, but not for multistore. Do you have any idea how to fix this?

 

Share this post


Link to post
Share on other sites
On 9/5/2019 at 11:44 PM, karus said:

Hello,

as of FacetedSearch 3.2.1 you need to comment lines 333-335 in ps_facetedsearch/src/Adapter/MySQL.php:
 


//        if ($orderField === 'price') {
//            $orderField = $this->getOrderDirection() === 'asc' ? 'price_min' : 'price_max';
//        }

 

this change fixed it for me.

I did it @karus , but won't work.

 

Result before and after:

https://imgur.com/xVALpM2

but with sorting with name it's ok:

https://imgur.com/Ad6K438

Edited by InfantryDev (see edit history)

Share this post


Link to post
Share on other sites

Module has been updated, probably that's the case. For 3.2.1 it is working also with multistore. I don't want to update because it may be harder to fix so I can't help you at this moment.

Share this post


Link to post
Share on other sites

Isn't it pathetic that on clean install of latest stable prestashop we can't sort products by price? How it's possible to release version with that bug and what's worse devs didn't fix it yet.

Share this post


Link to post
Share on other sites

Hello,

do you know if this is fixed now? I also have this issue with 1.7.6.1 and multistore..

 

regards

Share this post


Link to post
Share on other sites

 

On 9/27/2019 at 10:21 PM, karus said:

Module has been updated, probably that's the case. For 3.2.1 it is working also with multistore. I don't want to update because it may be harder to fix so I can't help you at this moment.

Hello,

I'm also having this problem. I reallty need both the sorting and the filters to be active, I don't want to disable them.

I also tried downgrading to 3.2.1, but your fix isn't working. Could you let us know the versions of PS? Maybe it also influences.

Thanks

  • Like 1

Share this post


Link to post
Share on other sites

I have a similar problem with Prestashop 1.7.6.1 and ps_facetedsearch 3.4.0
Enabling the module changes the order of the categories!
Does anyone know if this is a common error?

It's a new installation

  • Like 1

Share this post


Link to post
Share on other sites
On 6/11/2019 at 1:30 AM, mohcineel said:

Hello, i've just installed prestashop 1.7 on my server and added some products but when i select a categorie and use sort by price it gives a blank page with just the number of products, but the sort by name works, i parmetred the number of product per page to 80 .

Just go to modules manager faceted search -> rebuild price index...

priceindex.thumb.JPG.f2e776c9e23b196b9ce5df5462aeb2db.JPG

Best Regards

  • Like 1

Share this post


Link to post
Share on other sites
On 11/12/2019 at 5:13 AM, PCQUATRO said:

Just go to modules manager faceted search -> rebuild price index...

priceindex.thumb.JPG.f2e776c9e23b196b9ce5df5462aeb2db.JPG

Best Regards

As I see that nobody thanks you, in fact it is not a mistake if a bad indexation of product prices. Clear the cache before, so that you don't get an error, and after this reconstruct the price index.

Or add a cron for prices, names and references so, you can remember to reconstruct the indexes again and again.

Thank you very much PCQUATRO!!!!!🤩

Share this post


Link to post
Share on other sites
3 hours ago, Erost said:

Thank you very much PCQUATRO!!!!!🤩

I learn by helping others, so that´s my thank you :) anyway thank you for your thank you :) 

Best Regards

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More