Dynamic Sort Options for SilverShop

I’m racking my brains on how to make a dynamic sort option that will show / hide the sort option, depending on whether the “Manufacturer” category the sorter is looking for ...

private static $sort_options = array(
    'Alphabetical' => 'URLSegment',
    'Lowest Price' => 'BasePrice'
);

Normally, the sorter gets parameters like this, but that doesn't seem to cut it for this task.

If anyone can give some advice or ideas on what I can try, that would be very helpful. What am I missing?

+4
source share
1 answer

It is best to override the getSorter method in ProductCategory_Controller and add additional logic there:

https://github.com/silvershop/silvershop-core/blob/master/code/product/ProductCategory.php#L202

+1

Source: https://habr.com/ru/post/1661670/


All Articles