- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Using REST api, get parent (configurable item) of a child
Given a SKU or entity_id, can you get the parent of an item if this is a variant of a configurable product?
another way of asking this question would be:
There is an endpoint .../products/:sku/children to get the children of a configurable product, but is there a way to get the inverse of this operation?
Any help is much appreciated.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Using REST api, get parent (configurable item) of a child
There is no such Web API, but you can make a simple Web API wrapper for the existing PHP API: \Magento\Catalog\Model\Product\Type\AbstractType::getParentIdsByChild()
How to get the parents (configurable) products for a child (simple) one? https://mage2.pro/t/1599
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Using REST api, get parent (configurable item) of a child
Hi,
I'm looking for the same function to use in block class and then display in template file.
Find parent sku (configurable item) from child and just echo in template file.