Jump to content

[SOLVED] Block layered features sort


Recommended Posts

  • 2 weeks later...
  • 1 month later...

How can i change the layered block features sort by the value of the feature and not by the id?

 

If i have:

 

11mm

12mm and i make one new feature 10mm this will appear afther 12, i whant to appear in front of 11

 

TXS

 

Hi,

 

 

To sort features by name:

In blocklayered.php find

$sqlQuery['group'] = 'GROUP BY fv.id_feature_value ';

 

Replace with

$sqlQuery['group'] = 'GROUP BY fv.id_feature_value
 ORDER BY fvl.`value`, fl.`name` ASC';

 

And it works )

That's for prestashop 1.4.7 and block layered 1.8

I guess it'll work for 1.4.6.2 also

Link to comment
Share on other sites

Hi,

 

 

To sort features by name:

In blocklayered.php find

$sqlQuery['group'] = 'GROUP BY fv.id_feature_value ';

 

Replace with

$sqlQuery['group'] = 'GROUP BY fv.id_feature_value
 ORDER BY fvl.`value`, fl.`name` ASC';

 

And it works )

That's for prestashop 1.4.7 and block layered 1.8

I guess it'll work for 1.4.6.2 also

Txs, works fine
Link to comment
Share on other sites

I just made the update to version 1.4.7.2 block layered

v1.8.2 and the modification are not working, if u find the solution when u make the update pls. post here.\

 

 

TXS

 

Well, I have v1.8.2 blocklayered and prestashop 1.4.7.0 and it works fine

lines 2633,2644 of blocklayered.php.

 

 

$sql_query['group'] = 'GROUP BY fv.id_feature_value

ORDER BY fvl.`value`, fl.`name` ASC';

Link to comment
Share on other sites

Well, I have v1.8.2 blocklayered and prestashop 1.4.7.0 and it works fine

lines 2633,2644 of blocklayered.php.

 

 

$sql_query['group'] = 'GROUP BY fv.id_feature_value

ORDER BY fvl.`value`, fl.`name` ASC';

 

Now its working, TXS

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...
  • 2 years later...
×
×
  • Create New...