当前位置: 首页>>代码示例>>PHP>>正文


PHP Options::getSaleFees方法代码示例

本文整理汇总了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));
 }
开发者ID:wangshipeng,项目名称:license_manager,代码行数:12,代码来源:orders.php

示例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;
 }
开发者ID:wangshipeng,项目名称:license_manager,代码行数:32,代码来源:packages.php


注:本文中的Options::getSaleFees方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。