I need to get all the configurable items related to an item in the cart. For example, if the cart item is of a size “XL”, then I need to get all the other options like “S”, “M” and “L” together with their attributes.
I get all the cart items using the following method:
$items = $cart->getQuote()->getAllVisibleItems();
And then I try:
foreach( $items as $item ) {
foreach ($item->getOptions() as $option) {
// Here I need to get the attributes for each option but I'm not sure how to go about that
}
}
Is getOptions()
the way to go?
Thanks!