1

I have a code for getting abandoned cart details:

$quotes = Mage::getResourceModel('reports/quote_collection');
    foreach ($quotes as $quote) {
        $itemsCollection = $quote->getItemsCollection();
        foreach ($itemsCollection as $item) {
            //Getting item info
        }
    }

But how can I get item options(Color:Green, Size:L, etc..) ?

1 Answer 1

1

call $item->getOptions()

This will return an array for the options for the quote item. You could then do something like:

$options = array();
foreach($item->getOptions() as $option){
$options[$option->getLabel] = $option->getValue()
}

Note: $option->getValue() would return an ID instead of a label for drop down type custom options; so you may have to loop on $option->getValues() to be able to map an id to it's label.

1
  • thx, I'd already tried so... This code works on retrieving options for typical order. But in case of abandoned cart we get differ result: 72 => 72; 227 => 227
    – Serge
    Mar 12, 2015 at 13:15

Your Answer

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

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