Skip to content

Add parent ids to Product extension attributes #328

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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?

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