File tree Expand file tree Collapse file tree 3 files changed +12
-3
lines changed
app/(main)/[category]/[subcategory]
modules/categories/templates Expand file tree Collapse file tree 3 files changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ export async function generateMetadata({ params }: Props): Promise<Metadata> {
21
21
22
22
return {
23
23
title : `${ category . name } | Acme Store` ,
24
- description : `${ category . name } collection ` ,
24
+ description : `${ category . name } category ` ,
25
25
}
26
26
}
27
27
Original file line number Diff line number Diff line change @@ -260,15 +260,18 @@ export async function getCategoryByHandle(handle: string) {
260
260
DEBUG && console . log ( "PRODUCT_MODULE_DISABLED" )
261
261
const data = await medusaRequest ( "GET" , "/product-categories" , {
262
262
query : {
263
- handle : handle ,
263
+ handle,
264
264
} ,
265
265
} )
266
266
. then ( ( res ) => res . body )
267
267
. catch ( ( err ) => {
268
268
throw err
269
269
} )
270
270
271
- return data
271
+ return {
272
+ product_categories : data . product_categories ,
273
+ parent : data . product_categories [ 0 ] . parent_category ,
274
+ }
272
275
}
273
276
274
277
/**
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ type CategoryTemplateProps = {
18
18
handle : string
19
19
name : string
20
20
id : string
21
+ description ?: string
21
22
category_children ?: {
22
23
name : string
23
24
handle : string
@@ -92,6 +93,11 @@ const CategoryTemplate: React.FC<CategoryTemplateProps> = ({
92
93
) }
93
94
< h1 > { category . name } </ h1 >
94
95
</ div >
96
+ { category . description && (
97
+ < div className = "mb-8 text-base-regular" >
98
+ < p > { category . description } </ p >
99
+ </ div >
100
+ ) }
95
101
{ category . category_children && (
96
102
< div className = "mb-8 text-base-large" >
97
103
< ul className = "grid grid-cols-1 gap-2" >
You can’t perform that action at this time.
0 commit comments