Website Updates: Key Developments Today
What developments have taken place today?
This commit significantly refactors brand filtering logic for category detail pages, moving from relying on previously selected brands to dynamically retrieving all distinct brands for the current category and its descendants using Elasticsearch. A new helper function, SliceContainsString
, was added to facilitate this process. The system now also includes the count of each brand within search results, providing users with a clearer understanding of product availability by brand. Furthermore, a caching layer utilizing Redis has been introduced and integrated into core services for improved data retrieval efficiency. This involves creating a new appcache
package, implementing RedisCache
, and updating the registry to leverage the cache. Finally, several category detail pages have been updated to incorporate filter options for brands and minimum discount levels, enhancing user control over product search results.
The changes to category display on the homepage are important because they streamline product listing by utilizing a CSS grid layout with three columns for better organization and responsiveness. This enhances visual appeal and improves the overall user experience.
These updates to the website’s header and footer templates represent a significant design improvement, replacing older HTML structures with modern, responsive templates generated through Go templates. The new templates incorporate styling elements like dark backgrounds, centered content, hover effects on links, and rounded corners for pagination, contributing to a more polished and professional user interface.
The modifications related to determining ancestor categories are crucial for data transformation accuracy. By directly retrieving category IDs and paths from the database repository – rather than relying on potentially outdated or incorrect category paths – the system ensures that product counts are calculated correctly and consistently. The inclusion of error handling during ID parsing adds a layer of robustness, preventing processing interruptions due to invalid input.
The update to product details display, specifically conditional brand name rendering based on availability, improves clarity by presenting only relevant information to the user. The fallback image mechanism ensures that a placeholder is displayed when the actual product image link is unavailable, maintaining a consistent visual experience.
The changes concerning category filtering and URL construction provide users with enhanced control over their search results. The addition of filter options for brands and minimum discount levels allows for more targeted searches, while dynamically generated URLs ensure that filters are preserved across page navigations. These features contribute significantly to improved usability and user satisfaction.
Finally, the modifications to the category listing template’s sorting functionality introduce a SortOptionViewModel
struct and associated logic for selecting and applying sort options via URL parameters. This allows users to easily customize the order in which products are displayed, further tailoring their browsing experience.
website updates brand filtering caching responsive design url generation