Skip to content

Conversation

@smoucka
Copy link
Contributor

@smoucka smoucka commented May 8, 2025

Description

This PR adds an extension attribute to the Products API data interface, both individual and bulk requests.

This uses the built-in Configurable resource's method getParentIdsByChild. Will return an empty array if the product is not associated with a parent.

Manual Testing Steps

  1. Update extension and make request to /index.php/rest/V1/products or /index.php/rest/V1/products/:sku route.
  2. Example response:
    "extension_attributes": {
        "website_ids": [
            1
        ],
        "category_links": [
            ...
        ],
        "stock_item": {
            ...
        },
        "kl_parent_ids": [
            2
        ]
    }

Pre-Submission Checklist:

  • You've updated the CHANGELOG following the steps here
  • Internal Only - If this is a release, please confirm the following:
    • The links in the changelog have been updated to point towards the new versions
    • The version has been incremented in the following places: module.xml and composer.json

NOTE: Please use the Changelogger cli tool to manage versioned file upgrades.

@smoucka smoucka requested a review from a team as a code owner May 8, 2025 14:50
@smoucka smoucka requested a review from cykolln May 8, 2025 14:50
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe a test?

@smoucka smoucka merged commit 07cd567 into master Aug 11, 2025
7 checks passed
@smoucka smoucka deleted the parent_ids_extension_attribute branch August 11, 2025 18:21
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.

4 participants