1
0 Comments

E-Commerce filters implemented

I finally implemented e-commerce filters in the shop, it was a bit more tedious than anticipated.

The Infrastructure wasn't a real problem with the Specification Pattern implemented and was fun too implement. Although an Expression Tree bug in the code took a while to fix (an and/or condition replaced all my expression variables and this caused errors in using deep expressions).

The translation from the URL to input was also pretty fluent. Everything is immediatly submitted in a HTML GET form, if a filter is changed.

The thing that took a while was the full implementation of the filters. Eg. Like some design decisions i made:

  • Eliminate the count on the amount of products that the filter would produce

  • Don't show the filter on mobile, but people on mobile can delete the applied filters

  • How to show the applied filters ( I first thought about showing it in the row on it's original place, then in the start. At the end, i decided to implement it on the original place + a seperate section with Applied filters)

  • The filters are currently not changed by the current url( eg. It will always show the full amount of products to have the most complete list as possible). Although it's trivial to implement it like this.

  • How to group the filter types, currently i have 4 types :

    • Attribute filters
    • Attribute Range Filters
    • Price range filters
    • Tag filters

All in all, it went rather well. But i had some delays because of backpain problems ( old ski accident) in combination with a full-time job.

, Founder of Icon for Shop't
Shop't
on June 18, 2020