medusa-plugin-top-categories
v1.0.9
Published
Product categories with thumbnails and sorting by visits module for MedusaJS Admin-UI
Downloads
672
Maintainers
Readme
Product categories with thumbnails
Medusa admin UI modul with category thumbnail support, using metadata for store the information about thumbnail.
Medusa Website | Medusa Repository
Features
- Product category thumbnail
- Easy UI management of all product categories
Prerequisites
How to Install
1. Run the following command in the directory of the Medusa backend:
yarn add medusa-plugin-top-categories
2. In medusa-config.js
add the following configuration at the end of the plugins
array:
const plugins = [
// ...
{
resolve: `medusa-plugin-top-categories`,
options: {
enableUI: true,
},
},
];
Screenshots
Test the Plugin
Run the following command in the directory of the Medusa backend to run the backend:
yarn dev
In StoreFront project you can use the thumbnail by
category.metadata?.thumbnailImageUrl
Example:
import { getCategoriesList } from "@lib/data"
const { product_categories } = await getCategoriesList()
const thumbnails = productCategories.map((category) => (
<img
src={decodeURI((category.metadata?.thumbnailImageUrl as string) || "")}
alt={category.name}
/>
))