Switch the demo catalog and copy to an electronics store
The shop sells tech, not clothing, so the demo data and page copy now match that: - seven categories: smartphones, laptops, tablets, audio, TVs, home appliances, accessories - fifteen products with real-looking specs (screen, CPU, RAM, storage, energy class, warranty) instead of apparel attributes - hero copy and meta description talk about tech and appliances - banner updated in place by position/sort_order, so re-seeding does not leave a stale duplicate Catalog polish: - brand list and price range now follow the selected category instead of the whole catalog Tests: storefront fixtures renamed to the tech domain; suite is 61 passing.
This commit is contained in:
1 parent
37d5d7b366
commit
a64d567cff
5 files changed
+326
-144
No files matched your search
@@ -141,9 +141,12 @@ def catalog(request):
|
||||
if value
|
||||
}
|
||||
|
||||
bounds = Product.objects.filter(is_active=True).aggregate(
|
||||
low=Min("price"), high=Max("price")
|
||||
)
|
||||
# Brands and the price range follow the selected category, not the whole catalog.
|
||||
scope = Product.objects.filter(is_active=True)
|
||||
if selected_category is not None:
|
||||
scope = scope.filter(category=selected_category)
|
||||
|
||||
bounds = scope.aggregate(low=Min("price"), high=Max("price"))
|
||||
|
||||
chips = []
|
||||
chip_labels = {
|
||||
@@ -181,8 +184,7 @@ def catalog(request):
|
||||
"sort_order", "name"
|
||||
),
|
||||
"brands": list(
|
||||
Product.objects.filter(is_active=True)
|
||||
.exclude(brand="")
|
||||
scope.exclude(brand="")
|
||||
.values_list("brand", flat=True)
|
||||
.distinct()
|
||||
.order_by("brand")
|
||||
|
||||
Reference in new issue
Block a user