PageRenderTime 48ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/app/code/core/Mage/Bundle/Model/Product/Price.php

https://bitbucket.org/claudiu_marginean/magento-hg-mirror
PHP | 691 lines | 405 code | 76 blank | 210 comment | 117 complexity | 1ea6ed90e73e5169f19246ad323bb435 MD5 | raw file
Possible License(s): CC-BY-SA-3.0, LGPL-2.1, GPL-2.0, WTFPL
  1. <?php
  2. /**
  3. * Magento
  4. *
  5. * NOTICE OF LICENSE
  6. *
  7. * This source file is subject to the Open Software License (OSL 3.0)
  8. * that is bundled with this package in the file LICENSE.txt.
  9. * It is also available through the world-wide-web at this URL:
  10. * http://opensource.org/licenses/osl-3.0.php
  11. * If you did not receive a copy of the license and are unable to
  12. * obtain it through the world-wide-web, please send an email
  13. * to license@magentocommerce.com so we can send you a copy immediately.
  14. *
  15. * DISCLAIMER
  16. *
  17. * Do not edit or add to this file if you wish to upgrade Magento to newer
  18. * versions in the future. If you wish to customize Magento for your
  19. * needs please refer to http://www.magentocommerce.com for more information.
  20. *
  21. * @category Mage
  22. * @package Mage_Bundle
  23. * @copyright Copyright (c) 2010 Magento Inc. (http://www.magentocommerce.com)
  24. * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
  25. */
  26. /**
  27. * Bundle Price Model
  28. *
  29. * @category Mage
  30. * @package Mage_Bundle
  31. * @author Magento Core Team <core@magentocommerce.com>
  32. */
  33. class Mage_Bundle_Model_Product_Price extends Mage_Catalog_Model_Product_Type_Price
  34. {
  35. const PRICE_TYPE_FIXED = 1;
  36. const PRICE_TYPE_DYNAMIC = 0;
  37. /**
  38. * Flag wich indicates - is min/max prices have been calculated by index
  39. *
  40. * @var bool
  41. */
  42. protected $_isPricesCalculatedByIndex;
  43. /**
  44. * Is min/max prices have been calculated by index
  45. *
  46. * @return bool
  47. */
  48. public function getIsPricesCalculatedByIndex()
  49. {
  50. return $this->_isPricesCalculatedByIndex;
  51. }
  52. /**
  53. * Return product base price
  54. *
  55. * @return string
  56. */
  57. public function getPrice($product)
  58. {
  59. if ($product->getPriceType() == self::PRICE_TYPE_FIXED) {
  60. return $product->getData('price');
  61. } else {
  62. return 0;
  63. }
  64. }
  65. /**
  66. * Get product final price
  67. *
  68. * @param double $qty
  69. * @param Mage_Catalog_Model_Product $product
  70. * @return double
  71. */
  72. public function getFinalPrice($qty=null, $product)
  73. {
  74. if (is_null($qty) && !is_null($product->getCalculatedFinalPrice())) {
  75. return $product->getCalculatedFinalPrice();
  76. }
  77. $finalPrice = $product->getPrice();
  78. $basePrice = $finalPrice;
  79. /**
  80. * Just product with fixed price calculation has price
  81. */
  82. if ($finalPrice) {
  83. $tierPrice = $this->_applyTierPrice($product, $qty, $finalPrice);
  84. $specialPrice = $this->_applySpecialPrice($product, $finalPrice);
  85. $finalPrice = min(array($tierPrice, $specialPrice));
  86. $product->setFinalPrice($finalPrice);
  87. Mage::dispatchEvent('catalog_product_get_final_price', array('product'=>$product));
  88. $finalPrice = $product->getData('final_price');
  89. }
  90. $basePrice = $finalPrice;
  91. if ($product->hasCustomOptions()) {
  92. $customOption = $product->getCustomOption('bundle_option_ids');
  93. $customOption = $product->getCustomOption('bundle_selection_ids');
  94. $selectionIds = unserialize($customOption->getValue());
  95. $selections = $product->getTypeInstance(true)->getSelectionsByIds($selectionIds, $product);
  96. $selections->addTierPriceData();
  97. Mage::dispatchEvent('prepare_catalog_product_collection_prices', array(
  98. 'collection' => $selections,
  99. 'store_id' => $product->getStoreId(),
  100. ));
  101. foreach ($selections->getItems() as $selection) {
  102. if ($selection->isSalable()) {
  103. $selectionQty = $product->getCustomOption('selection_qty_' . $selection->getSelectionId());
  104. if ($selectionQty) {
  105. $finalPrice = $finalPrice + $this->getSelectionFinalPrice($product, $selection, $qty, $selectionQty->getValue());
  106. }
  107. }
  108. }
  109. } else {
  110. // if ($options = $this->getOptions($product)) {
  111. // /* some strange thing
  112. // foreach ($options as $option) {
  113. // $selectionCount = count($option->getSelections());
  114. // if ($selectionCount) {
  115. // foreach ($option->getSelections() as $selection) {
  116. // if ($selection->isSalable() && ($selection->getIsDefault() || ($option->getRequired() &&)) {
  117. // $finalPrice = $finalPrice + $this->getSelectionPrice($product, $selection);
  118. // }
  119. // }
  120. // }
  121. // }
  122. // */
  123. // }
  124. }
  125. $finalPrice = $finalPrice + $this->_applyOptionsPrice($product, $qty, $basePrice) - $basePrice;
  126. $product->setFinalPrice($finalPrice);
  127. return max(0, $product->getData('final_price'));
  128. }
  129. public function getChildFinalPrice($product, $productQty, $childProduct, $childProductQty)
  130. {
  131. return $this->getSelectionFinalPrice($product, $childProduct, $productQty, $childProductQty, false);
  132. }
  133. /**
  134. * Retrieve Price
  135. *
  136. * @param unknown_type $product
  137. * @param unknown_type $which
  138. * @return unknown
  139. */
  140. public function getPrices($product, $which = null)
  141. {
  142. return $this->getPricesDependingOnTax($product, $which);
  143. }
  144. /**
  145. * Retrieve Prices depending on tax
  146. *
  147. * @param unknown_type $product
  148. * @param unknown_type $which
  149. * @return unknown
  150. */
  151. public function getPricesDependingOnTax($product, $which = null, $includeTax = null)
  152. {
  153. // check calculated price index
  154. if ($product->getData('min_price') &&
  155. $product->getData('max_price')) {
  156. $minimalPrice = Mage::helper('tax')->getPrice($product, $product->getData('min_price'), $includeTax);
  157. $maximalPrice = Mage::helper('tax')->getPrice($product, $product->getData('max_price'), $includeTax);
  158. $this->_isPricesCalculatedByIndex = true;
  159. } else {
  160. /**
  161. * Check if product price is fixed
  162. */
  163. $finalPrice = $product->getFinalPrice();
  164. if ($product->getPriceType() == self::PRICE_TYPE_FIXED) {
  165. $minimalPrice = $maximalPrice = Mage::helper('tax')->getPrice($product, $finalPrice, $includeTax);
  166. } else { // PRICE_TYPE_DYNAMIC
  167. $minimalPrice = $maximalPrice = 0;
  168. }
  169. $options = $this->getOptions($product);
  170. $minPriceFounded = false;
  171. if ($options) {
  172. foreach ($options as $option) {
  173. /* @var $option Mage_Bundle_Model_Option */
  174. $selections = $option->getSelections();
  175. if ($selections) {
  176. $selectionMinimalPrices = array();
  177. $selectionMaximalPrices = array();
  178. foreach ($option->getSelections() as $selection) {
  179. /* @var $selection Mage_Bundle_Model_Selection */
  180. if (!$selection->isSalable()) {
  181. /**
  182. * @todo CatalogInventory Show out of stock Products
  183. */
  184. continue;
  185. }
  186. $qty = $selection->getSelectionQty();
  187. if ($selection->getSelectionCanChangeQty() && !$option->isMultiSelection()) {
  188. $qty = min(1, $qty);
  189. }
  190. $selectionMinimalPrices[] = Mage::helper('tax')->getPrice($selection, $this->getSelectionFinalPrice($product, $selection, 1, $qty), $includeTax);
  191. $selectionMaximalPrices[] = Mage::helper('tax')->getPrice($selection, $this->getSelectionFinalPrice($product, $selection, 1), $includeTax);
  192. }
  193. if (count($selectionMinimalPrices)) {
  194. $selMinPrice = min($selectionMinimalPrices);
  195. if ($option->getRequired()) {
  196. $minimalPrice += $selMinPrice;
  197. $minPriceFounded = true;
  198. } elseif (true !== $minPriceFounded) {
  199. $selMinPrice += $minimalPrice;
  200. $minPriceFounded = false === $minPriceFounded ? $selMinPrice : min($minPriceFounded, $selMinPrice);
  201. }
  202. if ($option->isMultiSelection()) {
  203. $maximalPrice += array_sum($selectionMaximalPrices);
  204. } else {
  205. $maximalPrice += max($selectionMaximalPrices);
  206. }
  207. }
  208. }
  209. }
  210. }
  211. // condition is TRUE when all product options are NOT required
  212. if (! is_bool($minPriceFounded)) {
  213. $minimalPrice = $minPriceFounded;
  214. }
  215. $customOptions = $product->getOptions();
  216. if ($product->getPriceType() == self::PRICE_TYPE_FIXED && $customOptions) {
  217. foreach ($customOptions as $customOption) {
  218. /* @var $customOption Mage_Catalog_Model_Product_Option */
  219. $values = $customOption->getValues();
  220. if ($values) {
  221. $prices = array();
  222. foreach ($values as $value) {
  223. /* @var $value Mage_Catalog_Model_Product_Option_Value */
  224. $valuePrice = $value->getPrice(true);
  225. $prices[] = $valuePrice;
  226. }
  227. if (count($prices)) {
  228. if ($customOption->getIsRequire()) {
  229. $minimalPrice += Mage::helper('tax')->getPrice($product, min($prices), $includeTax);
  230. }
  231. $multiTypes = array(
  232. //Mage_Catalog_Model_Product_Option::OPTION_TYPE_DROP_DOWN,
  233. Mage_Catalog_Model_Product_Option::OPTION_TYPE_CHECKBOX,
  234. Mage_Catalog_Model_Product_Option::OPTION_TYPE_MULTIPLE
  235. );
  236. if (in_array($customOption->getType(), $multiTypes)) {
  237. $maximalValue = array_sum($prices);
  238. } else {
  239. $maximalValue = max($prices);
  240. }
  241. $maximalPrice += Mage::helper('tax')->getPrice($product, $maximalValue, $includeTax);
  242. }
  243. } else {
  244. $valuePrice = $customOption->getPrice(true);
  245. if ($customOption->getIsRequire()) {
  246. $minimalPrice += Mage::helper('tax')->getPrice($product, $valuePrice, $includeTax);
  247. }
  248. $maximalPrice += Mage::helper('tax')->getPrice($product, $valuePrice, $includeTax);
  249. }
  250. }
  251. }
  252. $this->_isPricesCalculatedByIndex = false;
  253. }
  254. if ($which == 'max') {
  255. return $maximalPrice;
  256. } else if ($which == 'min') {
  257. return $minimalPrice;
  258. }
  259. return array($minimalPrice, $maximalPrice);
  260. }
  261. /**
  262. * Calculate Minimal price of bundle (counting all required options)
  263. *
  264. * @param Mage_Catalog_Model_Product $product
  265. * @return decimal
  266. */
  267. public function getMinimalPrice($product)
  268. {
  269. return $this->getPrices($product, 'min');
  270. }
  271. /**
  272. * Calculate maximal price of bundle
  273. *
  274. * @param Mage_Catalog_Model_Product $product
  275. * @return decimal
  276. */
  277. public function getMaximalPrice($product)
  278. {
  279. return $this->getPrices($product, 'max');
  280. }
  281. /**
  282. * Get Options with attached Selections collection
  283. *
  284. * @param Mage_Catalog_Model_Product $product
  285. * @return Mage_Bundle_Model_Mysql4_Option_Collection
  286. */
  287. public function getOptions($product)
  288. {
  289. $product->getTypeInstance(true)
  290. ->setStoreFilter($product->getStoreId(), $product);
  291. $optionCollection = $product->getTypeInstance(true)
  292. ->getOptionsCollection($product);
  293. $selectionCollection = $product->getTypeInstance(true)
  294. ->getSelectionsCollection(
  295. $product->getTypeInstance(true)->getOptionsIds($product),
  296. $product
  297. );
  298. return $optionCollection->appendSelections($selectionCollection, false, false);
  299. }
  300. /**
  301. * Calculate price of selection
  302. *
  303. * @param Mage_Catalog_Model_Product $bundleProduct
  304. * @param Mage_Catalog_Model_Product $selectionProduct
  305. * @param decimal $selectionQty
  306. * @return decimal
  307. */
  308. public function getSelectionPrice($bundleProduct, $selectionProduct, $selectionQty = null, $multiplyQty = true)
  309. {
  310. if (is_null($selectionQty)) {
  311. $selectionQty = $selectionProduct->getSelectionQty();
  312. }
  313. if ($bundleProduct->getPriceType() == self::PRICE_TYPE_DYNAMIC) {
  314. if ($multiplyQty) {
  315. $selectionPrice = $selectionProduct->getFinalPrice($selectionQty) * $selectionQty;
  316. } else {
  317. $selectionPrice = $selectionProduct->getFinalPrice($selectionQty);
  318. }
  319. return $selectionPrice;
  320. } else {
  321. if ($selectionProduct->getSelectionPriceType()) { // percent
  322. return $bundleProduct->getPrice() * ($selectionProduct->getSelectionPriceValue() / 100) * $selectionQty;
  323. } else {
  324. return $selectionProduct->getSelectionPriceValue() * $selectionQty;
  325. }
  326. }
  327. }
  328. /**
  329. * Calculate selection price for front view (with applied special of bundle)
  330. *
  331. * @param Mage_Catalog_Model_Product $bundleProduct
  332. * @param Mage_Catalog_Model_Product $selectionProduct
  333. * @param decimal
  334. * @return decimal
  335. */
  336. public function getSelectionPreFinalPrice($bundleProduct, $selectionProduct, $qty = null)
  337. {
  338. return $this->_applySpecialPrice($bundleProduct, $this->getSelectionPrice($bundleProduct, $selectionProduct, $qty));
  339. }
  340. /**
  341. * Calculate final price of selection
  342. *
  343. * @param Mage_Catalog_Model_Product $bundleProduct
  344. * @param Mage_Catalog_Model_Product $selectionProduct
  345. * @param decimal $bundleQty
  346. * @param decimal $selectionQty
  347. * @return decimal
  348. */
  349. public function getSelectionFinalPrice($bundleProduct, $selectionProduct, $bundleQty, $selectionQty = null, $multiplyQty = true)
  350. {
  351. $selectionPrice = $this->getSelectionPrice($bundleProduct, $selectionProduct, $selectionQty, $multiplyQty);
  352. // apply bundle tier price
  353. $tierPrice = $this->_applyTierPrice($bundleProduct, $bundleQty, $selectionPrice);
  354. // apply bundle special price
  355. $specialPrice = $this->_applySpecialPrice($bundleProduct, $selectionPrice);
  356. return min(array($tierPrice, $specialPrice));
  357. }
  358. /**
  359. * Apply tier price for bundle
  360. *
  361. * @param Mage_Catalog_Model_Product $product
  362. * @param decimal $qty
  363. * @param decimal $finalPrice
  364. * @return decimal
  365. */
  366. protected function _applyTierPrice($product, $qty, $finalPrice)
  367. {
  368. if (is_null($qty)) {
  369. return $finalPrice;
  370. }
  371. $tierPrice = $product->getTierPrice($qty);
  372. if (is_numeric($tierPrice)) {
  373. $tierPrice = $finalPrice - ($finalPrice * ($tierPrice / 100));
  374. $finalPrice = min($finalPrice, $tierPrice);
  375. }
  376. return $finalPrice;
  377. }
  378. /**
  379. * Get product tier price by qty
  380. *
  381. * @param decimal $qty
  382. * @param Mage_Catalog_Model_Product $product
  383. * @return decimal
  384. */
  385. public function getTierPrice($qty=null, $product)
  386. {
  387. $allGroups = Mage_Customer_Model_Group::CUST_GROUP_ALL;
  388. $prices = $product->getData('tier_price');
  389. if (is_null($prices)) {
  390. if ($attribute = $product->getResource()->getAttribute('tier_price')) {
  391. $attribute->getBackend()->afterLoad($product);
  392. $prices = $product->getData('tier_price');
  393. }
  394. }
  395. if (is_null($prices) || !is_array($prices)) {
  396. if (!is_null($qty)) {
  397. return $product->getPrice();
  398. }
  399. return array(array(
  400. 'price' => $product->getPrice(),
  401. 'website_price' => $product->getPrice(),
  402. 'price_qty' => 1,
  403. 'cust_group' => $allGroups,
  404. ));
  405. }
  406. $custGroup = $this->_getCustomerGroupId($product);
  407. if ($qty) {
  408. $prevQty = 1;
  409. $prevPrice = 0;
  410. $prevGroup = $allGroups;
  411. foreach ($prices as $price) {
  412. if ($price['cust_group']!=$custGroup && $price['cust_group']!=$allGroups) {
  413. // tier not for current customer group nor is for all groups
  414. continue;
  415. }
  416. if ($qty < $price['price_qty']) {
  417. // tier is higher than product qty
  418. continue;
  419. }
  420. if ($price['price_qty'] < $prevQty) {
  421. // higher tier qty already found
  422. continue;
  423. }
  424. if ($price['price_qty'] == $prevQty && $prevGroup != $allGroups && $price['cust_group'] == $allGroups) {
  425. // found tier qty is same as current tier qty but current tier group is ALL_GROUPS
  426. continue;
  427. }
  428. if ($price['website_price'] > $prevPrice) {
  429. $prevPrice = $price['website_price'];
  430. $prevQty = $price['price_qty'];
  431. $prevGroup = $price['cust_group'];
  432. }
  433. }
  434. return $prevPrice;
  435. } else {
  436. $qtyCache = array();
  437. foreach ($prices as $i => $price) {
  438. if ($price['cust_group'] != $custGroup && $price['cust_group'] != $allGroups) {
  439. unset($prices[$i]);
  440. } else if (isset($qtyCache[$price['price_qty']])) {
  441. $j = $qtyCache[$price['price_qty']];
  442. if ($prices[$j]['website_price'] < $price['website_price']) {
  443. unset($prices[$j]);
  444. $qtyCache[$price['price_qty']] = $i;
  445. } else {
  446. unset($prices[$i]);
  447. }
  448. } else {
  449. $qtyCache[$price['price_qty']] = $i;
  450. }
  451. }
  452. }
  453. return ($prices) ? $prices : array();
  454. }
  455. /**
  456. * Calculate product price based on special price data and price rules
  457. *
  458. * @param float $basePrice
  459. * @param float $specialPrice
  460. * @param string $specialPriceFrom
  461. * @param string $specialPriceTo
  462. * @param float|null|false $rulePrice
  463. * @param mixed $wId
  464. * @param mixed $gId
  465. * @param null|int $productId
  466. * @return float
  467. */
  468. public static function calculatePrice($basePrice, $specialPrice, $specialPriceFrom, $specialPriceTo, $rulePrice = false, $wId = null, $gId = null, $productId = null)
  469. {
  470. $resource = Mage::getResourceSingleton('bundle/bundle');
  471. $selectionResource = Mage::getResourceSingleton('bundle/selection');
  472. $productPriceTypeId = Mage::getSingleton('eav/entity_attribute')->getIdByCode('catalog_product', 'price_type');
  473. if ($wId instanceof Mage_Core_Model_Store) {
  474. $store = $wId->getId();
  475. $wId = $wId->getWebsiteId();
  476. } else {
  477. $store = Mage::app()->getStore($wId)->getId();
  478. $wId = Mage::app()->getStore($wId)->getWebsiteId();
  479. //$store = Mage::app()->getWebsite($wId)->getDefaultGroup()->getDefaultStoreId();
  480. }
  481. if (!$gId) {
  482. $gId = Mage::getSingleton('customer/session')->getCustomerGroupId();
  483. } else if ($gId instanceof Mage_Customer_Model_Group) {
  484. $gId = $gId->getId();
  485. }
  486. if (!isset(self::$attributeCache[$productId]['price_type'])) {
  487. $attributes = $resource->getAttributeData($productId, $productPriceTypeId, $store);
  488. self::$attributeCache[$productId]['price_type'] = $attributes;
  489. } else {
  490. $attributes = self::$attributeCache[$productId]['price_type'];
  491. }
  492. $options = array(0);
  493. $results = $resource->getSelectionsData($productId);
  494. if (!$attributes || !$attributes[0]['value']) { //dynamic
  495. foreach ($results as $result) {
  496. if (!$result['product_id']) {
  497. continue;
  498. }
  499. if ($result['selection_can_change_qty'] && $result['type'] != 'multi' && $result['type'] != 'checkbox') {
  500. $qty = 1;
  501. } else {
  502. $qty = $result['selection_qty'];
  503. }
  504. $result['final_price'] = $selectionResource->getPriceFromIndex($result['product_id'], $qty, $store, $gId);
  505. $selectionPrice = $result['final_price']*$qty;
  506. if (isset($options[$result['option_id']])) {
  507. $options[$result['option_id']] = min($options[$result['option_id']], $selectionPrice);
  508. } else {
  509. $options[$result['option_id']] = $selectionPrice;
  510. }
  511. }
  512. $basePrice = array_sum($options);
  513. }
  514. else { //fixed
  515. foreach ($results as $result) {
  516. if (!$result['product_id']) {
  517. continue;
  518. }
  519. if ($result['selection_price_type']) {
  520. $selectionPrice = $basePrice*$result['selection_price_value']/100;
  521. } else {
  522. $selectionPrice = $result['selection_price_value'];
  523. }
  524. if ($result['selection_can_change_qty'] && $result['type'] != 'multi' && $result['type'] != 'checkbox') {
  525. $qty = 1;
  526. } else {
  527. $qty = $result['selection_qty'];
  528. }
  529. $selectionPrice = $selectionPrice*$qty;
  530. if (isset($options[$result['option_id']])) {
  531. $options[$result['option_id']] = min($options[$result['option_id']], $selectionPrice);
  532. } else {
  533. $options[$result['option_id']] = $selectionPrice;
  534. }
  535. }
  536. $basePrice = $basePrice + array_sum($options);
  537. }
  538. $finalPrice = self::calculateSpecialPrice($basePrice, $specialPrice, $specialPriceFrom, $specialPriceTo, $store);
  539. /**
  540. * adding customer defined options price
  541. */
  542. $customOptions = Mage::getResourceSingleton('catalog/product_option_collection')->reset();
  543. $customOptions->addFieldToFilter('is_require', '1')
  544. ->addProductToFilter($productId)
  545. ->addPriceToResult($store, 'price')
  546. ->addValuesToResult();
  547. foreach ($customOptions as $customOption) {
  548. if ($values = $customOption->getValues()) {
  549. $prices = array();
  550. foreach ($values as $value) {
  551. $prices[] = $value->getPrice();
  552. }
  553. if (count($prices)) {
  554. $finalPrice += min($prices);
  555. }
  556. } else {
  557. $finalPrice += $customOption->getPrice();
  558. }
  559. }
  560. if ($rulePrice === false) {
  561. $rulePrice = Mage::getResourceModel('catalogrule/rule')->getRulePrice(Mage::app()->getLocale()->storeTimeStamp($store), $wId, $gId, $productId);
  562. }
  563. if ($rulePrice !== null && $rulePrice !== false) {
  564. $finalPrice = min($finalPrice, $rulePrice);
  565. }
  566. $finalPrice = max($finalPrice, 0);
  567. return $finalPrice;
  568. }
  569. /**
  570. * Calculate and apply special price
  571. *
  572. * @param float $finalPrice
  573. * @param float $specialPrice
  574. * @param string $specialPriceFrom
  575. * @param string $specialPriceTo
  576. * @param mixed $store
  577. * @return float
  578. */
  579. public static function calculateSpecialPrice($finalPrice, $specialPrice, $specialPriceFrom, $specialPriceTo, $store = null)
  580. {
  581. if (!is_null($specialPrice) && $specialPrice != false) {
  582. if (Mage::app()->getLocale()->isStoreDateInInterval($store, $specialPriceFrom, $specialPriceTo)) {
  583. $specialPrice = Mage::app()->getStore()->roundPrice($finalPrice * $specialPrice / 100);
  584. $finalPrice = min($finalPrice, $specialPrice);
  585. }
  586. }
  587. return $finalPrice;
  588. }
  589. /**
  590. * Check is tier price value fixed or percent of original price
  591. *
  592. * @return bool
  593. */
  594. public function isTierPriceFixed()
  595. {
  596. return false;
  597. }
  598. /*
  599. public function getCustomOptionPrices($productId, $storeId, $which = null) {
  600. $optionsCollection = Mage::getResourceModel('catalog/product_option_collection')
  601. ->addProductToFilter($productId)
  602. ->;
  603. if (is_null($which)) {
  604. return array($minimalPrice, $maximalPrice);
  605. } else if ($which = 'max') {
  606. return $maximalPrice;
  607. } else if ($which = 'min') {
  608. return $minimalPrice;
  609. }
  610. return 0;
  611. }
  612. */
  613. }