Skip to content

Conversation

creative-andrew
Copy link
Contributor

@creative-andrew creative-andrew commented Nov 23, 2022

🚨Please review the guidelines for contributing to this repository.

  • Make sure you are making a pull request against the develop branch (left side). Also you should start your branch off our develop.
  • Make sure you are requesting to pull request from a topic/feature/bugfix/devops branch (right side). Don't pull request from your master!
  • Have you ensured/updated that CLI tests to extend coverage to any new logic. Learn how to modify the tests here.

What does this implement/fix? Explain your changes.

The raw product price variation comes as null while querying them as a public user (not authenticated).
There is a capability check that was added on #213 while addressing sensitive data being exposed to not authenticated users. Nevertheless, the raw prices for variation shouldn't have been included.

The raw prices for other product object types (Simple product, Variable product, etc.) work fine without being authenticated. Not sure why this behaviour is applied only for the variation prices: https://github.com/wp-graphql/wp-graphql-woocommerce/blob/develop/includes/model/class-product.php#L361

For sake of persistency, it should be added to the other object types or removed from the variation.

Does this close any currently open issues?

Product variation raw prices not visible for public users (not authenticated)

Where has this been tested?

**WooGraphQL Version: 0.11.2
**WPGraphQL Version: 1.12.2
**WordPress Version: 6.11
**WooCommerce Version: 7.1.0

@AVert
Copy link
Contributor

AVert commented Nov 23, 2022

Awesome work! Thanks a lot!

@kidunot89 kidunot89 force-pushed the fix/variations-price-public-users-andres branch from a7698f4 to c26ecf6 Compare December 7, 2022 22:17
@kidunot89 kidunot89 merged commit ba14f1c into wp-graphql:develop Dec 7, 2022
@kidunot89 kidunot89 added the enhancement New feature or request label Dec 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants