Skip to content

Conversation

@ede-somogyi-algolia
Copy link
Collaborator

@ede-somogyi-algolia ede-somogyi-algolia commented Dec 22, 2025

Reopened this pull request to target develop; the branch from the declined pull request contained a lot of extra code that was not needed here.

Added explanatory comment for the workaround.

Original description

Update: this may not be a code issue on the cartridge's side -- the proper values should be returned for local variation attributes with the code we’re using. Until this is fixed by SFCC, we can add our workaround, it won't hurt anything even when if it's eventually fixed (in that case the code proceeds on the ternary if's true branch, so the workaround code is never reached). The workaround extracts the same information as the original code would if it worked as intended.

Locally-defined size and color variation attribute values are currently not exported at all.

Variation attributes, like size or color, can be local, where the values are created for a specific product and cannot be used with other products (save from redefining them there) or shared (also called global or per-catalog variation attributes), where the variation attribute’s possible values are defined for the whole catalog, with any product being able to use these pre-defined values (example: common shoe sizes, common clothing sizes like S, M, L, etc.).

With the way the color and size attributes are currently retrieved in the code, these attributes are only returned if the master has a shared variation attribute.

The code works as intended for shared variation attributes, but in the case of a locally-defined variation attribute, colorAttribute and sizeAttribute both become null even if there is a value defined for size or color, so the ternary if’s false branch is executed, returning null.

Modified the code so that product.custom.size (local variation attribute) is returned if retrieving the shared attribute fails.

Please see SFCC-476 for more details.

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ede-somogyi-algolia ede-somogyi-algolia self-assigned this Dec 22, 2025
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