Guest User

Untitled

a guest
Mar 22nd, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.36 KB | None | 0 0
  1. public function getFinalPrice($qty = null, $product)
  2. {
  3. .....
  4. $finalPrice += $this->getTotalBundleItemsPrice($product, $qty);
  5. ......
  6. }
  7.  
  8. public function getTotalBundleItemsPrice($product, $qty = null)
  9. {
  10. $price = 0.0;
  11. if ($product->hasCustomOptions()) {
  12. $customOption = $product->getCustomOption('bundle_selection_ids');
  13. if ($customOption) {
  14. $selectionIds = unserialize($customOption->getValue());
  15. $selections = $product->getTypeInstance(true)->getSelectionsByIds($selectionIds, $product);
  16. $selections->addTierPriceData();
  17. Mage::dispatchEvent('prepare_catalog_product_collection_prices', array(
  18. 'collection' => $selections,
  19. 'store_id' => $product->getStoreId(),
  20. ));
  21. foreach ($selections->getItems() as $selection) {
  22. if ($selection->isSalable()) {
  23. $selectionQty = $product->getCustomOption('selection_qty_' . $selection->getSelectionId());
  24. if ($selectionQty) {
  25. $price += $this->getSelectionFinalTotalPrice($product, $selection, $qty,
  26. $selectionQty->getValue());
  27. }
  28. }
  29. }
  30. }
  31. }
  32. return $price;
  33. }
  34.  
  35. public function getTotalBundleItemsPrice($product, $qty = null)
  36.  
  37. }
  38. return $price;
Add Comment
Please, Sign In to add comment