prestarocket-agence / classic-rocket

Classic Rocket is a rework of "classic theme". It has been built keeping in mind : performance, accessibility and SEO.
https://demoprestashop.prestarocket.com/
Other
230 stars 127 forks source link

Fix sort order selector when default order is not included on the page #184

Closed Hlavtox closed 2 years ago

Hlavtox commented 4 years ago

This PR fixes a bug, when there is a different sort order selected on initial load than the one currently in use.

How to reproduce the bug

  1. Go to Prestashop settins and set default sorting in category to "quantity".
  2. Enable and setup faceted search.
  3. Go to FO to some category.
  4. You will see that products are sorted by quantity, but there is Relevance/Position selected in a selectbox.
prestarocket commented 4 years ago

@Hlavtox it s also a bug on classic default theme ?

Hlavtox commented 4 years ago

@prestarocket No, they have a different way of displaying this dropdown.

prestarocket commented 4 years ago

ok thx, i will test your PR tomorrow

Hlavtox commented 4 years ago

@prestarocket Thanks!

Maybe we could do it by this variable - _{if $listing.sort_selected}{$listing.sortselected}{else}{l s='Select' d='Shop.Theme.Actions'}{/if}

Look how they done it in the original file - https://github.com/PrestaShop/PrestaShop/blob/develop/themes/classic/templates/catalog/_partials/sort-orders.tpl

Hlavtox commented 4 years ago

@prestarocket I changed the logic completely, I used the provided varible, now it's just one condition. Check it plz :-)