Distinguishing product variation types in REST API responses #47420
Replies: 3 comments
-
I'm in favor of this. I feel like not having the Also, not having the property might harm reusability of blocks, for example, if a block checks for the |
Beta Was this translation helpful? Give feedback.
-
If we can do this in a back-compat friendly manner (based on the description here and a very quick look at the linked PR, it seems we can) I think this will be a nice addition. |
Beta Was this translation helpful? Give feedback.
-
Closing this discussion as the functionality was merged in the above mentioned PR. |
Beta Was this translation helpful? Give feedback.
-
In a recent developer blog comment, a third party developer expressed the need to distinguish between product variation types.
Historically, we haven't included the
type
property for product variation REST API responses.After looking into this, I found that it is "easy" to add such support to the REST API. But, I don't know if there are reasons why this was never done and if it has hidden issues.
PR that implements support:
I'd love to get some feedback from both core devs (@woocommerce/proton and @woocommerce/mothra in particular) and third party devs on this PR (and the higher-level topic of distinguishing variation types), since while it is a very small code change, it could have big implications!
Beta Was this translation helpful? Give feedback.
All reactions