I am trying to pull configurable products option and price on product detail page on seprate section. on radio button. I've used below code to get detail of options but i can retrive price of options.
$blockObj = $block->getLayout()->createBlock('Magento\ConfigurableProduct\Block\Product\View\Type\Configurable'); $_attributes = $blockObj->decorateArray($blockObj->getAllowAttributes()); foreach ($_attributes as $_attribute): ?> <?php foreach ($_attribute->getData('options') as $option): ?> // option detail here <?php endforeach; ?> <?php endforeach; ?>
I've also try to get product id of options but i can get in above data. anyone have idea. how to get it? Note: I've used objectmanager for testing now. I'll use class to use once my code will be ready