Cart Quote, .
$cart- > getItems():
public function getItems()
{
return $this->getQuote()->getAllVisibleItems();
}
- Quote. , : getAllVisibleItems() getAllItems()?
:
public function getAllItems()
{
$items = array();
foreach ($this->getItemsCollection() as $item) {
if (!$item->isDeleted()) {
$items[] = $item;
}
}
return $items;
}
public function getAllVisibleItems()
{
$items = array();
foreach ($this->getItemsCollection() as $item) {
if (!$item->isDeleted() && !$item->getParentItemId()) {
$items[] = $item;
}
}
return $items;
}
: getAllVisibleItems() :
!$item->getParentItemId()
, ( , , ). , getAllItems().
?
:
$productCollection = $cart->getQuote()->getItemsCollection();