문제

I want to get selected associated product information from configurable product after an checkout_cart_add_after triggered. I'll look after it in mean time,if any helps would be appreciable.

도움이 되었습니까?

해결책

Add below code in your observer file

$item = $observer->getQuoteItem();

$product = $item->getProduct();
$typeId = $product->getTypeId();
if ($typeId == \Magento\ConfigurableProduct\Model\Product\Type\Configurable::TYPE_CODE) {

    $attributes = $product->getTypeInstance()->getSelectedAttributesInfo($product);
}
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 magento.stackexchange
scroll top