Skip to content

Add meta to product options and values#2346

Merged
glennjacobs merged 1 commit into1.xfrom
product-option-meta
Dec 8, 2025
Merged

Add meta to product options and values#2346
glennjacobs merged 1 commit into1.xfrom
product-option-meta

Conversation

@glennjacobs
Copy link
Contributor

@glennjacobs glennjacobs commented Nov 12, 2025

This adds meta to Product Options & Product Option Values to support customisation, e.g. assigning hex colours.

It also updates the model annotations and corrects the name cast on ProductOptionValue (this might be considered a breaking change...)

TODO

  • Add docs PR, including upgrade guide entry

@github-project-automation github-project-automation bot moved this to Todo in Roadmap Nov 12, 2025
@glennjacobs glennjacobs marked this pull request as ready for review November 12, 2025 11:13
@glennjacobs glennjacobs requested a review from Copilot November 12, 2025 11:13
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds a meta field to both ProductOption and ProductOptionValue models to enable custom metadata storage (e.g., hex color values). Additionally, it updates the model annotations for accuracy and changes the cast type for ProductOptionValue's name field from AsCollection to AsArrayObject.

Key Changes:

  • Added nullable meta JSON fields to product_options and product_option_values tables
  • Changed ProductOptionValue::$name cast from AsCollection to AsArrayObject
  • Updated PHPDoc annotations to reflect actual cast types

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
packages/core/database/migrations/2025_11_12_005200_add_meta_to_product_options.php Migration adding meta JSONB columns to both tables
packages/core/src/Models/ProductOption.php Added meta cast and updated annotations to use AsArrayObject
packages/core/src/Models/ProductOptionValue.php Changed name cast to AsArrayObject, added meta cast, and updated annotations

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@glennjacobs glennjacobs merged commit 5718f5f into 1.x Dec 8, 2025
46 checks passed
@glennjacobs glennjacobs deleted the product-option-meta branch December 8, 2025 13:57
@github-project-automation github-project-automation bot moved this from Todo to Done in Roadmap Dec 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants