Page MenuHomeIn-Portal Phabricator

products_option_combination_item.php
No OneTemporary

File Metadata

Created
Fri, Nov 21, 6:08 AM

products_option_combination_item.php

<?php
/**
* @version $Id: products_option_combination_item.php 15141 2012-03-04 08:08:18Z alex $
* @package In-Commerce
* @copyright Copyright (C) 1997 - 2009 Intechnic. All rights reserved.
* @license Commercial License
* This software is protected by copyright law and international treaties.
* Unauthorized reproduction or unlicensed usage of the code of this program,
* or any portion of it may result in severe civil and criminal penalties,
* and will be prosecuted to the maximum extent possible under the law
* See http://www.in-portal.org/commercial-license for copyright notices and details.
*/
defined('FULL_PATH') or die('restricted access!');
class kPOCItem extends kDBItem
{
/**
* Returns unformatted field value
*
* @param string $field
* @return string
* @access public
*/
function GetDBField($field)
{
if ($field == 'FinalPrice') {
$product = $this->Application->recallObject('p');
switch($this->GetDBField('PriceType'))
{
case 1: // = (override)
return $this->GetDBField('Price');
break;
case 2: // flat
return $product->GetDBField('Price') + $this->GetDBField('Price');
break;
case 3: // percent
return $product->GetDBField('Price') * (1 + $this->GetDBField('Price')/100);
break;
}
}
else {
$ret = parent::GetDBField($field);
}
return $ret;
}
}

Event Timeline