Skip to content
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

Expose attribute mapping rule values using WCProductAdapter #2366

Conversation

jorgemd24
Copy link
Contributor

@jorgemd24 jorgemd24 commented Apr 11, 2024

Changes proposed in this Pull Request:

Part of #2146

This is an alternative for #2351.

Rather than moving the attribute logic from WCProductAdapter into the AttributeManager, we're now crating an instance of WCProductAdapter to retrieve all aggregated attribute values from particular products. Similar to the other PR, we'll use these attribute values to expose them in the WC REST Product endpoints. For additional context, refer to #2351.

Screenshots:

Detailed test instructions:

  1. Go to GLA -> Attribute -> Create some rules.
  2. Make the following request GET wc/v3/products?gla_syncable=1 or GET wc/v3/products/YOUR_PRODUCT_ID?gla_syncable=1
  3. See that the response contains a new property named: gla_attributes with the correct values.

image

  1. Update the products by adding a GLA Attribute. This attribute should take precedence over any mapping rule applied to the same attribute.

image

  1. Remove the query parameter gla_syncable=1 and the response should not contain gla_attributes.
  2. Repeat the steps for a variation product using the following endpoint: wc/v3/products/PARENT_ID/variations/VARIATION_ID?gla_syncable=1

Additional details:

Changelog entry

@github-actions github-actions bot added the changelog: update Big changes to something that wasn't broken. label Apr 11, 2024
@jorgemd24 jorgemd24 self-assigned this Apr 11, 2024
@jorgemd24 jorgemd24 marked this pull request as ready for review April 12, 2024 14:47
@jorgemd24 jorgemd24 requested review from puntope and a team April 12, 2024 14:47
Copy link
Contributor

@puntope puntope left a comment

Choose a reason for hiding this comment

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

Thanks for adapting the PR to reduce code duplication.

It is working as expected for me. ✅

@jorgemd24 jorgemd24 changed the base branch from feature/google-api-project-phase-2 to feature/google-api-project April 15, 2024 17:34
@jorgemd24 jorgemd24 merged commit 689273c into feature/google-api-project Apr 15, 2024
8 of 13 checks passed
@jorgemd24 jorgemd24 deleted the update/expose-attribute-mapping-rule-values branch April 15, 2024 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog: update Big changes to something that wasn't broken.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants