Jump to content

Add a "Sortable" to Product Combinations


Ray UK

Recommended Posts

Posted (edited)

Is there a way to add a "'sortable' => true" to this column.  It's annoying that when adding a new option, regardless of the name, it's always added to the bottom with no way of sorting them. (I'm using the experimental product page if that makes a difference)

SortOrderNorthWestEcigs.png.2fa3dc481258b6b2ea89abc8212ccb8c.png

Edited by Ray UK (see edit history)
Link to comment
Share on other sites

13 hours ago, Ray UK said:

Is there a way to add a "'sortable' => true" to this column.  It's annoying that when adding a new option, regardless of the name, it's always added to the bottom with no way of sorting them. (I'm using the experimental product page if that makes a difference)

SortOrderNorthWestEcigs.png.2fa3dc481258b6b2ea89abc8212ccb8c.png

The file below allows you to set the default sorting option. Currently, it shows as id_product_attribute as ASC.

https://github.com/PrestaShop/PrestaShop/blob/8.2.1/src/Core/Search/Filters/ProductCombinationFilters.php#L96

  • Like 1
Link to comment
Share on other sites

Hi and thanks for your reply.

This has helped me somewhat achieve a better sort option. I have changed that value to 'reference' as I can't work out the title for the "Combination" column (It isnt 'combination' or 'name') and have added a sortable value in the "Reference" field.

 The "'sortable' => true" on that column in the template which builds that page would be a much better option.  I guess that the majority of users would find that useful, much more useful than the default sort on an id which means absolutely nothing.

Thanks for you help.

Link to comment
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...