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

utils.api.product.getById( ) returns different attribute keys than default page context. #116

Open
harnerdesigns opened this issue Feb 12, 2020 · 0 comments

Comments

@harnerdesigns
Copy link

When you look at ?debug=context a product is returned as the following object with cherry picked attributes:

 {
        "id": <ID>,
        "sku": "<SKU>",
        "name": "<NAME>",
        ...
        "image": {
          "data": "<URL>",
          "alt": "<ALT>"
        },
}

But query the same product with utils.api.product.getById( ) and it returns

 {
        "id": <ID>,
        "sku": "<SKU>",
        "title": "<NAME>",
        ...
        "main_image": {
          "data": "<URL>",
          "alt": "<ALT>"
        },
}

My goal was to have one component that I could use both in the API call, and using the regular page context. Is there a reason these attributes are returned differently?

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

No branches or pull requests

1 participant