Jump to content

SORT BY price not working on ps 1.7


mohcineel

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 

Link to comment
Share on other sites

  • 2 weeks later...

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 

 

Link to comment
Share on other sites

  • 2 months later...

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.

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
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)
Link to comment
Share on other sites

  • 2 weeks later...

 

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
Link to comment
Share on other sites

  • 3 weeks later...
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 4
  • Thanks 4
Link to comment
Share on other sites

  • 4 weeks later...
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!!!!!🤩

  • Like 1
Link to comment
Share on other sites

  • 9 months later...

 

On 12/8/2019 at 5:49 PM, Erost said:

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!!!!!🤩

Prestashop 1.7.6.5 - it did not help  ((

any other advise?

Link to comment
Share on other sites

  • 1 month later...
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.

Hello, 

It did work out for me (PS 1.7.6.3 and facetedsearch 3.6.0)

Thanks !

Link to comment
Share on other sites

  • 4 weeks later...
  • 1 month later...
  • 3 months later...
On 12/8/2019 at 10:19 PM, Erost said:

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!!!!!🤩

Hello Erost,

I did first clear cache and do rebuild entire price index but it failed after 200 or something products.

so what to do in this case?

 

Thanks,

Link to comment
Share on other sites

  • 2 months later...

Hello everyone, I solve the issue!!! atfer giving up I finally found the issue, it turns out that I had disabled the default country so the index was not being contructed for that country, my advise to find the issue:

--try to rebuilt the index and check, if that doesn't work do the following:

1. activate the database log

2. reproduce the issue.

3. then check the last query about list of product.

4. Test the query and see if the result is empty

5. If so, you can check why it is empty, the related table is information_schema ps_layered_price_index

 

If the query result is not empty the issue is somewhere else in the template, theme or something.

Link to comment
Share on other sites

  • 6 months later...
On 7/25/2021 at 4:31 AM, Ana Maria Sierra said:

Hello everyone, I solve the issue!!! atfer giving up I finally found the issue, it turns out that I had disabled the default country so the index was not being contructed for that country, my advise to find the issue:

--try to rebuilt the index and check, if that doesn't work do the following:

1. activate the database log

2. reproduce the issue.

3. then check the last query about list of product.

4. Test the query and see if the result is empty

5. If so, you can check why it is empty, the related table is information_schema ps_layered_price_index

 

If the query result is not empty the issue is somewhere else in the template, theme or something.

This is exactly the same problem as mine. Thanks so much!

Link to comment
Share on other sites

  • 6 months later...

Though it's late I'd like to ask again.

"?order=product.price.[asc|desc]&from-xhr=" works fine in Edge and Firefox but NOT in chrome.
console.log output is:

updateProductListDOM :<div id="js-product-list">
  <div class="products">
      </div>

  
    <div class="row u-a-i-c">
  <div class="small col-lg-4">
    
      Showing 1-4 of 4 item(s)
    
  </div>

  <nav class="col-lg-8">
    
         
  </nav>

</div>
  

  <div class="visible--mobile text-right up">
    <a href="#header" class="btn btn-secondary">
      Back to top
      <i class="material-icons">&#xE316;</i>
    </a>
  </div>
</div>


I assume it's a JS problem. Any ideas?

Edited by Hehn-MB
Ajax Request (see edit history)
Link to comment
Share on other sites

  • 1 month later...
  • 4 months later...
  • 1 year later...

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...