本文整理匯總了PHP中Options::getSaleFees方法的典型用法代碼示例。如果您正苦於以下問題:PHP Options::getSaleFees方法的具體用法?PHP Options::getSaleFees怎麽用?PHP Options::getSaleFees使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Options
的用法示例。
在下文中一共展示了Options::getSaleFees方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __construct
public function __construct()
{
//Setting up order fees
$options = new Options();
$fees = $options->getSaleFees();
$this->tax_percent = $fees["fees_tax_percent"];
$this->paypal_ratepercent = $fees["fees_paypal_ratepercent"];
$this->paypal_extrafee = $fees["fees_paypal_extrafee"];
//Main loggging, addDebug,addInfo,addNotice,addWarning,addError,addCritical,addAlert,addEmergency
$this->log = new Logger('vibepuntacana');
$this->log->pushHandler(new StreamHandler(MAIN_LOG, Logger::WARNING));
}
示例2: getValidPackageByGuid
public function getValidPackageByGuid($guid)
{
$db = new clsDBdbConnection();
$guid = $db->esc($guid);
//status_id 2 = active
$sql = "select id,guid,title,title_summary,price,valid_to,status_id,details from packages\n where status_id = 2 and guid = '{$guid}' ";
$db->query($sql);
$row = array();
$options = new Options();
$saleFees = $options->getSaleFees();
$db->next_record();
$package_id = (int) $db->f("id");
$row["guid"] = $db->f("guid");
$row["title"] = $db->f("title");
$row["title_summary"] = $db->f("title_summary");
$row["price"] = $db->f("price");
$row["valid_to"] = $db->f("valid_to");
//Calculating sale fee for 1 package, quantity changes after order submision and qty selected
$qty = 1;
$subtotal = $row["price"] * $qty;
$tax_total = $saleFees["fees_tax_percent"] * $subtotal;
$paypal_totalfee = $saleFees["fees_paypal_ratepercent"] * $subtotal + $saleFees["fees_paypal_extrafee"];
$sale_fee = $tax_total + $paypal_totalfee;
//Only 2 decimal places for amounts
$sale_fee = number_format($sale_fee, 2);
$row["sale_fee"] = $sale_fee;
$row["status_id"] = $db->f("status_id");
$row["details"] = nl2br($db->f("details"));
$row["package_images"] = $this->getImagesByPackageId($package_id);
$db->close();
return $row;
}