I tried, Attribute name is net_details

 $quoteItem = $observer->getEvent()->getQuoteItem();
 $details = json_encode($net_details);

In quote item table value gets stored in product_type = configurable of respective products

My requirement is to store the value where product_type = simple

1 Answer 1

foreach ($cart->getQuote()->getAllVisibleItems() as $item) {
    $productId = $item->getProduct()->getId();
    if ($option = $item->getOptionByCode('simple_product')) {
        $productId = $option->getProduct()->getId();
    $productIds[] = $productId;
  • What if there are mixers of Simple and Configrable?
    – Avesh Naik
    Oct 29, 2020 at 7:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.