Skip to content
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

Add attribute data to ProductOption and ProductOptionValue #1736

Draft
wants to merge 9 commits into
base: 1.x
Choose a base branch
from

Conversation

adevade
Copy link
Contributor

@adevade adevade commented May 10, 2024

This PR adds attribute data to ProductOption and ProductOptionValue.

It will be useful for storing meta data related to a specific option (such as a description, or a link to a sizing chart) and to a specific option value (such as a hex value for a color, or a short description).

It hasn't been tested yet, and no UI has been added, since I didn't know if this would get accepted. It has previously been requested/discussed here: #1296

If you agree i can clean it up, test it and add a UI to the panel. Or feel free to push changes as necessary. 👍


Related

I also agree with the linked discussion that it would be useful to have a handle on ProductOptionValue for usage in query strings for example. What are your thoughts on this?

Copy link

vercel bot commented May 10, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
lunar-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 22, 2024 9:15am

@Saifallak
Copy link

such as a hex value for a color great addition, but anyway in the admin panel, can we choose field type of attributes?

@adevade
Copy link
Contributor Author

adevade commented Aug 22, 2024

Marking this as ready for review, even though there has to be some UI to be able to setup the extra fields in the admin panel.

@glennjacobs glennjacobs marked this pull request as draft August 22, 2024 14:25
@glennjacobs
Copy link
Contributor

@adevade I do think this would be a welcome addition. As you say, it needs the admin UI applying to this PR first before it could be considered for review.

The handle concept could be trickier to implement, but doable. It could be auto-generated based upon the value initially, with logic to avoid duplicates, e.g. "red" becomes "red-2" or something. And then under settings we could allow the handles to be manually edited.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants