本文整理汇总了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;
}