- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 3.8k
 
WIP - feat(medusa,product,core-flows,types): product options redesign (server-side) #13817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
WIP - feat(medusa,product,core-flows,types): product options redesign (server-side) #13817
Conversation
          🦋 Changeset detectedLatest commit: f32e5d3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 74 packages
 Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR  | 
    
| 
           The latest updates on your projects. Learn more about Vercel for GitHub. 8 Skipped Deployments
  | 
    
| 
           Hey Will, one thing i noticed is if the pivot entity is not defined between product and product option, additional columns can't be added to the pivot table, like for example the rank field, to be able to specify for a given product, the order you want its options to show.  | 
    
          
 The rank field will be on   | 
    
This is the SERVER-SIDE part of the PR. The client-side PR can be found here. To test via snapshot, it will be easier to fo it from the client-side PR, since it is based on this one.
WHAT
This PR handles an important and heavily requested redesign in the Core. For context, the relationship between
ProductandProductOptionscurrently is 1-many. We want to change that to a many-many relationship, which will allow linking multipleProductsto the sameProductOption. This will be useful to implement filters on the storefront for example.HOW

Here is an image of the redesign:
To clarify, the pivot table between
product_option_valueand the other pivot table will be used to enable linking only a subset of theProdutOptionValuesto aProduct. For example, aProductOptionnamedColorcould have 10 colors defined, and I might have aProductthat only exists in 5 colors. In that case, to avoid making manyColoroptions, the user will have the ability to only choose the colors they want for that productIn this PR, you will find:
I will leave comments in the PR to make the review a bit easier
WHAT IS LEFT
I decided to put the stuff I needed to have a "functional" frontend, but there are still things that are missing that I will address in another PR