The product listing also allows the user to change how many items they want to see per row: 1, 2 or 3.
I wanted to add the ability to remember this information between page visits. In this case, a query string wasn’t going to cut it, as the user might leave the site and come back again at which point the information is lost.
Instead, I opted to store this information in
local storage, so when the user visited the product listing page, I checked to see if the value had been set in
local storage and used this information to set the listing layout.