Comments (4)
Problem is that you extended product with Medusa product repository and not plugin product repository. Try to extend your repository and model using medusa-custom-attributes.
import { Product } from "../models/product";
import { dataSource } from "@medusajs/medusa/dist/loaders/database";
// Import from plugin
import { ProductRepository as MedusaProductRepository } from "medusa-custom-attributes/dist/repositories/product";
export const ProductRepository = dataSource.getRepository(Product).extend(
Object.assign(MedusaProductRepository, {
customFunction(): void {
// TODO add custom implementation
return
}
}),
);
export default ProductRepository;
from medusa-custom-attributes.
You can see my code here, Im reusing some functionalities from another marketplace code
https://github.com/alexandrosk/medusa-marketplace
And as you mentioned already it overrides through loaders (but I commented it out)
from medusa-custom-attributes.
Wow that solved, still learning Medusa, thanks! was great help man!
from medusa-custom-attributes.
I would love a demo with nextjs filters working as well, since its a bit hard to follow the guide on Medium as it seems its using a previous version, but either way you're doing astonish work thanks man!
from medusa-custom-attributes.
Related Issues (15)
- CSV Export / Import support? HOT 9
- Error: attributes must be an object HOT 1
- Error: productCategoryRepo.getFreeTextSearchResultsAndCount is not a function HOT 1
- Invalid data error HOT 10
- I have admin API error on product list page HOT 1
- Enhancement Suggestion: Optimize Product Information Retrieval by Revising Data Relations HOT 2
- Filter by category HOT 1
- All products + variants disappeared after enabling plugin HOT 5
- An error occurred while processing product.updated: TypeError: Cannot read properties of undefined (reading 'relations') HOT 3
- Error: "an unknown value was passed to the validate function" for single, multi & boolean types HOT 5
- custom_attributes dropped from response when passing expand options HOT 3
- API Documentation HOT 1
- error An unexpected error occurred: "could not find a copy of @medusajs/medusa to link HOT 7
- Issue with integration with default storefront || ReferenceError: useAttributes is not defined HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from medusa-custom-attributes.