Добавьте превью категорий в витрине
This plugin provides the ability to upload and manage a thumbnail image for categories, enhancing the visual representation of your catalog. By associating an image with each category, you can deliver a more engaging browsing experience and improve storefront navigation.
Install react-dropzone and multer
1npm install --save react-dropzone2npm install multerIf you are using Local storage for file uploads, you just have to set below configurations inside plugins array in your medusa-config.js file
1{2 resolve: "@linearcommerce/medusa-category-thumbnail",3 options: {4 provider: "local",5 },6}If you are using AWS S3 for file storage, you must have to install the following npm packages dependencies
Install aws-sdk/client-s3 and aws-sdk/s3-presigned-post
1npm install @aws-sdk/client-s32npm install @aws-sdk/s3-presigned-post1AWS_S3_ACCESS_KEY_ID=Your AWS Access Key ID2AWS_S3_ACCESS_SECRET=Your AWS Access Secret Key3AWS_S3_REGION=Your AWS Region4AWS_S3_BUCKET=Your AWS Bucket Name5AWS_S3_ENDPOINT=https://s3.amazonaws.com1plugins: [2 {3 resolve: '@linearcommerce/medusa-category-thumbnail',4 options: {5 provider: "s3",6 },7 },8],To use this plugin, you need to have the minimum versions of the following dependencies:
1"@medusajs/admin-sdk": "^2.8.2",2"@medusajs/cli": "^2.8.2",3"@medusajs/framework": "^2.8.2",4"@medusajs/icons": "^2.8.2",5"@medusajs/js-sdk": "^2.8.2",6"@medusajs/medusa": "^2.8.2",1yarn add @linearcommerce/medusa-category-thumbnail2
3-- OR -- 4
5npm i @linearcommerce/medusa-category-thumbnailnpx medusa db:migrate