Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function getFinalPrice($qty = null, $product)
- {
- .....
- $finalPrice += $this->getTotalBundleItemsPrice($product, $qty);
- ......
- }
- public function getTotalBundleItemsPrice($product, $qty = null)
- {
- $price = 0.0;
- if ($product->hasCustomOptions()) {
- $customOption = $product->getCustomOption('bundle_selection_ids');
- if ($customOption) {
- $selectionIds = unserialize($customOption->getValue());
- $selections = $product->getTypeInstance(true)->getSelectionsByIds($selectionIds, $product);
- $selections->addTierPriceData();
- Mage::dispatchEvent('prepare_catalog_product_collection_prices', array(
- 'collection' => $selections,
- 'store_id' => $product->getStoreId(),
- ));
- foreach ($selections->getItems() as $selection) {
- if ($selection->isSalable()) {
- $selectionQty = $product->getCustomOption('selection_qty_' . $selection->getSelectionId());
- if ($selectionQty) {
- $price += $this->getSelectionFinalTotalPrice($product, $selection, $qty,
- $selectionQty->getValue());
- }
- }
- }
- }
- }
- return $price;
- }
- public function getTotalBundleItemsPrice($product, $qty = null)
- }
- return $price;
Add Comment
Please, Sign In to add comment