/** * @return array */ public function getItems() { $items = parent::getItems(); foreach ($items as $item) { /** * recalculate the item selection qty using the subscription item multiplier * if the qty of the subscription is less than one. * This allows for quantities smaller than the bundle item fixed quantity */ if (!$item->hasData('selection_qty_isset') && $this->qtyMultiplier < 1) { $item->setData('selection_qty_isset', true); $item->setData('selection_qty', floatval($item->getData('selection_qty')) * $this->qtyMultiplier); } } return $items; }
/** * Append selection to options * stripBefore - indicates to reload * appendAll - indicates do we need to filter by saleable and required custom options * * @param Mage_Bundle_Model_Resource_Selection_Collection $selectionsCollection * @param bool $stripBefore * @param bool $appendAll * @return array */ public function appendSelections($selectionsCollection, $stripBefore = false, $appendAll = true) { if ($stripBefore) { $this->_stripSelections(); } if (!$this->_selectionsAppended) { foreach ($selectionsCollection->getItems() as $key => $_selection) { if ($_option = $this->getItemById($_selection->getOptionId())) { if ($appendAll || $_selection->isSalable() && !$_selection->getRequiredOptions()) { $_selection->setOption($_option); $_option->addSelection($_selection); } else { $selectionsCollection->removeItemByKey($key); } } } $this->_selectionsAppended = true; } return $this->getItems(); }