How to get parent product data from parent id for configurable productsHow to get available sizes from configurable product using SOAP?Update table data for configurable productUpdate simple products with parent configurable product priceHow to get a configurable parent product from catalog in Magento2?How to get parent product id in magento 2?Magento 2 - Configurable product - Get parent product ID from child product IDGet Price For Configurable Product Magento 2Get product Category from Parent Product using SQL queryMagento 2 get Parent products id in admin create productsConfigurable Product - Get child product id

Are one time pads still secure when using randomly generated words as the pad?

Leaving job close to major deadlines

In the US, can a former president run again?

Why things float in space, though there is always gravity of our star is present

What is the most suitable position for a bishop here?

How do you transpose samples in cents?

Math symbols in math operators

Is there any way to revive my Sim?

Help with coding a matrix

Is there any possible way to get these hearts as Adult Link?

Why there is a red color in right side?

How much steel armor can you wear and still be able to swim?

Are intrusions within a foreign embassy considered an act of war?

If the mass of the Earth is decreasing by sending debris in space, does its angular momentum also decrease?

How to make all magic-casting innate, but still rare?

I found a password with hashcat but it doesn't work

Definition of 'vrit'

Why is it easier to balance a non-moving bike standing up than sitting down?

My student in one course asks for paid tutoring in another course. Appropriate?

How to write a nice frame challenge?

What is that ceiling compartment of a Boeing 737?

「捨ててしまう」why is there two て’s used here?

reverse a call to mmap()

Are there examples of rowers who also fought?



How to get parent product data from parent id for configurable products


How to get available sizes from configurable product using SOAP?Update table data for configurable productUpdate simple products with parent configurable product priceHow to get a configurable parent product from catalog in Magento2?How to get parent product id in magento 2?Magento 2 - Configurable product - Get parent product ID from child product IDGet Price For Configurable Product Magento 2Get product Category from Parent Product using SQL queryMagento 2 get Parent products id in admin create productsConfigurable Product - Get child product id






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















I want to get parent product data for configurable products.



I have parent id



How do I get it?










share|improve this question
























  • As a parent configurable product you can get the children simple products. Likewise as a child simple product you can get the parent. Do you want to do either of these?

    – Dominic Xigen
    Jun 11 at 0:44











  • then load the product data based on id use ProductRepositoryInterface and call getById function

    – mohith
    Jun 11 at 4:54


















0















I want to get parent product data for configurable products.



I have parent id



How do I get it?










share|improve this question
























  • As a parent configurable product you can get the children simple products. Likewise as a child simple product you can get the parent. Do you want to do either of these?

    – Dominic Xigen
    Jun 11 at 0:44











  • then load the product data based on id use ProductRepositoryInterface and call getById function

    – mohith
    Jun 11 at 4:54














0












0








0








I want to get parent product data for configurable products.



I have parent id



How do I get it?










share|improve this question
















I want to get parent product data for configurable products.



I have parent id



How do I get it?







magento2 configurable-product






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jun 11 at 6:13







Smita Kagwade

















asked Jun 10 at 21:04









Smita KagwadeSmita Kagwade

37513




37513












  • As a parent configurable product you can get the children simple products. Likewise as a child simple product you can get the parent. Do you want to do either of these?

    – Dominic Xigen
    Jun 11 at 0:44











  • then load the product data based on id use ProductRepositoryInterface and call getById function

    – mohith
    Jun 11 at 4:54


















  • As a parent configurable product you can get the children simple products. Likewise as a child simple product you can get the parent. Do you want to do either of these?

    – Dominic Xigen
    Jun 11 at 0:44











  • then load the product data based on id use ProductRepositoryInterface and call getById function

    – mohith
    Jun 11 at 4:54

















As a parent configurable product you can get the children simple products. Likewise as a child simple product you can get the parent. Do you want to do either of these?

– Dominic Xigen
Jun 11 at 0:44





As a parent configurable product you can get the children simple products. Likewise as a child simple product you can get the parent. Do you want to do either of these?

– Dominic Xigen
Jun 11 at 0:44













then load the product data based on id use ProductRepositoryInterface and call getById function

– mohith
Jun 11 at 4:54






then load the product data based on id use ProductRepositoryInterface and call getById function

– mohith
Jun 11 at 4:54











1 Answer
1






active

oldest

votes


















0














I Got the solution



 use MagentoCatalogModelProductRepository;
use MagentoConfigurableProductModelProductTypeConfigurable;


Then in construct function use



public function __construct(ProductRepository $_productloader,Configurable $configurable) 
$this->configurable=$configurable;
$this->_productloader=$_productloader;



get parent product id by product id



 $productId='get your product id'

$parentId=$this->configurable->getParentIdsByChild($productId);


$parentId gives an array



then get parent product data by



$parentProductData=$this->_productloader->getById($parentId[0]);



This worked for me.






share|improve this answer























  • I had comment the same thing above

    – mohith
    Jun 11 at 10:13












Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f277877%2fhow-to-get-parent-product-data-from-parent-id-for-configurable-products%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














I Got the solution



 use MagentoCatalogModelProductRepository;
use MagentoConfigurableProductModelProductTypeConfigurable;


Then in construct function use



public function __construct(ProductRepository $_productloader,Configurable $configurable) 
$this->configurable=$configurable;
$this->_productloader=$_productloader;



get parent product id by product id



 $productId='get your product id'

$parentId=$this->configurable->getParentIdsByChild($productId);


$parentId gives an array



then get parent product data by



$parentProductData=$this->_productloader->getById($parentId[0]);



This worked for me.






share|improve this answer























  • I had comment the same thing above

    – mohith
    Jun 11 at 10:13
















0














I Got the solution



 use MagentoCatalogModelProductRepository;
use MagentoConfigurableProductModelProductTypeConfigurable;


Then in construct function use



public function __construct(ProductRepository $_productloader,Configurable $configurable) 
$this->configurable=$configurable;
$this->_productloader=$_productloader;



get parent product id by product id



 $productId='get your product id'

$parentId=$this->configurable->getParentIdsByChild($productId);


$parentId gives an array



then get parent product data by



$parentProductData=$this->_productloader->getById($parentId[0]);



This worked for me.






share|improve this answer























  • I had comment the same thing above

    – mohith
    Jun 11 at 10:13














0












0








0







I Got the solution



 use MagentoCatalogModelProductRepository;
use MagentoConfigurableProductModelProductTypeConfigurable;


Then in construct function use



public function __construct(ProductRepository $_productloader,Configurable $configurable) 
$this->configurable=$configurable;
$this->_productloader=$_productloader;



get parent product id by product id



 $productId='get your product id'

$parentId=$this->configurable->getParentIdsByChild($productId);


$parentId gives an array



then get parent product data by



$parentProductData=$this->_productloader->getById($parentId[0]);



This worked for me.






share|improve this answer













I Got the solution



 use MagentoCatalogModelProductRepository;
use MagentoConfigurableProductModelProductTypeConfigurable;


Then in construct function use



public function __construct(ProductRepository $_productloader,Configurable $configurable) 
$this->configurable=$configurable;
$this->_productloader=$_productloader;



get parent product id by product id



 $productId='get your product id'

$parentId=$this->configurable->getParentIdsByChild($productId);


$parentId gives an array



then get parent product data by



$parentProductData=$this->_productloader->getById($parentId[0]);



This worked for me.







share|improve this answer












share|improve this answer



share|improve this answer










answered Jun 11 at 6:37









Smita KagwadeSmita Kagwade

37513




37513












  • I had comment the same thing above

    – mohith
    Jun 11 at 10:13


















  • I had comment the same thing above

    – mohith
    Jun 11 at 10:13

















I had comment the same thing above

– mohith
Jun 11 at 10:13






I had comment the same thing above

– mohith
Jun 11 at 10:13


















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f277877%2fhow-to-get-parent-product-data-from-parent-id-for-configurable-products%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Grendel Contents Story Scholarship Depictions Notes References Navigation menu10.1093/notesj/gjn112Berserkeree

Area configuration aggregation error after install Porto themeMagento 2.1 CE Installed but front/backend not loading/workingCSS not loading on page within Magento 2 pageCannot install module in Magento 2no commands defined in the “setup” namespace. in Magento2Magento 2: Static files are present but shows 404Why do i have to always run the commands to clean cache in Magento 2.1.8?Failure reason: 'Unable to unserialize value.'Error 500 after magento migrationIn production mode the site does not loadMagento 2 : Error 500 after installing

Middle Expansion Olielle Resaix Definition: Uttering songs of triumph shouting with joy triumphant exulting Sejunction Journal 붙다 달 고급 품목 외출 The stretch trades the screeching tin. Definition: The act of speaking with a drawl a drawl Cough Sand Definition: An uproar a quarrel a noisy outbreak Shake Iron Publicize Horse House Baby 사과 Resaix Flaggy Jelly Temporary Unequaled Puppet A drop in the bucket Shrew 성격 회원 성질 미팅 The burn frames the tacky quality. Materialistic The smoke reduces the way. Yammoe Nondescript Cheek 얼굴 배 약하다 날리다 타다 The illegal country shows the iron. Help Rule Drearien Smoke Teaching Meaty Wasp Abraham Lincoln Jaws 진심 수리하다 Size Cork Idea Convert Think Lark John Lennon 거울 청소 군 추천하다 아이스크림