Skip to content

Read product extensions off the shape Elastic Path returns - #443

Merged
field123 merged 1 commit into
masterfrom
fix/ep-commerce-extensions-path
Aug 20, 2026
Merged

Read product extensions off the shape Elastic Path returns#443
field123 merged 1 commit into
masterfrom
fix/ep-commerce-extensions-path

Conversation

@field123

Copy link
Copy Markdown
Collaborator

extractRawExtensions still looked for rawData.data.attributes.extensions, but 0.4.0 removed rawData — the type is the raw shape, so extensions sit on attributes (ADR-0002). It returned null for every live product, leaving $ctx.productExtensions empty and every extension binding blank on a real storefront.

Two things hid it. EPProductProvider substitutes MOCK_EXTENSION_TEMPLATES when the live map is empty in canvas, so Studio showed plausible placeholder labels; and the unit test asserted the removed shape, so it stayed green.

Now reads attributes.extensions first, then a bundle's rawData (which holds the product object, not an envelope — the old chain never matched that either), then the pre-0.4.0 envelope.

Found while migrating a production storefront export: the product had all 28 extension fields on the wire and the page rendered none of them. Needs to land in 0.4.0, which is still unpublished — npm serves 0.3.0.

extractRawExtensions still looked for `rawData.data.attributes.extensions`, but
0.4.0 removed rawData — the type is the raw shape, so extensions sit on
attributes. It returned null for every live product, leaving $ctx.productExtensions
empty and every extension binding blank on a real storefront.

The canvas hid it: EPProductProvider substitutes MOCK_EXTENSION_TEMPLATES when
the live map is empty, so Studio showed plausible placeholder labels. The unit
test hid it too, asserting the removed shape.

Reads attributes.extensions first, then a bundle's rawData (which holds the
product object, not an envelope), then the pre-0.4.0 envelope.
@field123
field123 merged commit c7e7f77 into master Aug 20, 2026
9 checks passed
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.

1 participant