本文整理汇总了PHP中oos_get_tax_rate函数的典型用法代码示例。如果您正苦于以下问题:PHP oos_get_tax_rate函数的具体用法?PHP oos_get_tax_rate怎么用?PHP oos_get_tax_rate使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了oos_get_tax_rate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
function process() {
global $oOrder, $oCurrencies;
if (MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == '1') {
switch (MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION) {
case 'national':
if ($oOrder->delivery['country_id'] == STORE_COUNTRY) $pass = true; break;
case 'international':
if ($oOrder->delivery['country_id'] != STORE_COUNTRY) $pass = true; break;
case 'both':
$pass = true; break;
default:
$pass = false; break;
}
if ( ($pass == true) && ( ($oOrder->info['total'] - $oOrder->info['shipping_cost']) < MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER) ) {
$tax = oos_get_tax_rate(MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS, $oOrder->billing['country']['id'], $oOrder->billing['zone_id']);
// $tax_description = oos_get_tax_description(MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS, $oOrder->delivery['country']['id'], $oOrder->delivery['zone_id']);
$tax_description = oos_get_tax_rate(MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS, $oOrder->billing['country']['id'], $oOrder->billing['zone_id']);
$oOrder->info['tax'] += oos_calculate_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax);
$oOrder->info['tax_groups']["$tax_description"] += oos_calculate_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax);
$oOrder->info['total'] += MODULE_ORDER_TOTAL_LOWORDERFEE_FEE + oos_calculate_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax);
$this->output[] = array('title' => $this->title . ':',
'text' => $oCurrencies->format(oos_add_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax), true, $oOrder->info['currency'], $oOrder->info['currency_value']),
'value' => oos_add_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax));
}
}
}
示例2: quote
function quote($method = '')
{
global $oOrder, $aLang, $shipping_weight, $shipping_num_boxes;
if (MODULE_SHIPPING_TABLE_MODE == 'price') {
$oOrder_total = $_SESSION['cart']->show_total();
} else {
$oOrder_total = $shipping_weight;
}
$table_cost = split("[:,]", MODULE_SHIPPING_TABLE_COST);
$size = count($table_cost);
for ($i = 0, $n = $size; $i < $n; $i += 2) {
if ($oOrder_total <= $table_cost[$i]) {
$shipping = $table_cost[$i + 1];
break;
}
}
if (MODULE_SHIPPING_TABLE_MODE == 'weight') {
$shipping = $shipping * $shipping_num_boxes;
}
$this->quotes = array('id' => $this->code, 'module' => $aLang['module_shipping_table_text_title'], 'methods' => array(array('id' => $this->code, 'title' => $aLang['module_shipping_table_text_way'], 'cost' => $shipping + MODULE_SHIPPING_TABLE_HANDLING)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = oos_get_tax_rate($this->tax_class, $oOrder->delivery['country']['id'], $oOrder->delivery['zone_id']);
}
if (oos_is_not_null($this->icon)) {
$this->quotes['icon'] = oos_image($this->icon, $this->title);
}
return $this->quotes;
}
示例3: quote
function quote($method = '')
{
global $aLang, $oOrder;
$this->quotes = array('id' => $this->code, 'module' => $aLang['module_shipping_hermes_text_title'], 'methods' => array(array('id' => $this->code, 'title' => $aLang['module_shipping_hermes_text_way'], 'cost' => MODULE_SHIPPING_HERMES_COST)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = oos_get_tax_rate($this->tax_class, $oOrder->delivery['country']['id'], $oOrder->delivery['zone_id']);
}
if (!empty($this->icon)) {
$this->quotes['icon'] = oos_image($this->icon, $this->title);
}
return $this->quotes;
}
示例4: quote
function quote($method = '')
{
global $aLang, $oOrder;
$this->quotes = array('id' => $this->code, 'module' => $aLang['module_shipping_certified_mail_text_title'], 'methods' => array(array('id' => $this->code, 'title' => $aLang['module_shipping_certified_mail_text_way'], 'cost' => MODULE_SHIPPING_CERTIFIED_MAIL_COST)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = oos_get_tax_rate($this->tax_class, $oOrder->delivery['country']['id'], $oOrder->delivery['zone_id']);
}
if (oos_is_not_null($this->icon)) {
$this->quotes['icon'] = oos_image($this->icon, $this->title);
}
return $this->quotes;
}
示例5: quote
function quote($method = '')
{
global $oOrder, $aLang, $total_count;
$this->quotes = array('id' => $this->code, 'module' => $aLang['module_shipping_item_text_title'], 'methods' => array(array('id' => $this->code, 'title' => $aLang['module_shipping_item_text_way'], 'cost' => MODULE_SHIPPING_ITEM_COST * $total_count + MODULE_SHIPPING_ITEM_HANDLING)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = oos_get_tax_rate($this->tax_class, $oOrder->delivery['country']['id'], $oOrder->delivery['zone_id']);
}
if (oos_is_not_null($this->icon)) {
$this->quotes['icon'] = oos_image($this->icon, $this->title);
}
return $this->quotes;
}
示例6: process
function process()
{
global $oOrder, $oCurrencies;
if (MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING == '1') {
switch (MODULE_ORDER_TOTAL_SHIPPING_DESTINATION) {
case 'national':
if ($oOrder->delivery['country_id'] == STORE_COUNTRY) {
$pass = true;
}
break;
case 'international':
if ($oOrder->delivery['country_id'] != STORE_COUNTRY) {
$pass = true;
}
break;
case 'both':
$pass = true;
break;
default:
$pass = false;
break;
}
if ($pass == true && $oOrder->info['total'] - $oOrder->info['shipping_cost'] >= MODULE_ORDER_TOTAL_SHIPPING_FREE_SHIPPING_OVER) {
$oOrder->info['shipping_method'] = $this->title;
$oOrder->info['total'] -= $oOrder->info['shipping_cost'];
$oOrder->info['shipping_cost'] = 0;
}
}
$module = substr($_SESSION['shipping']['id'], 0, strpos($_SESSION['shipping']['id'], '_'));
if (oos_is_not_null($oOrder->info['shipping_method'])) {
if ($GLOBALS[$module]->tax_class > 0) {
$shipping_tax = oos_get_tax_rate($GLOBALS[$module]->tax_class, $oOrder->billing['country']['id'], $oOrder->billing['zone_id']);
$shipping_tax_description = oos_get_tax_rate($GLOBALS[$module]->tax_class, $oOrder->billing['country']['id'], $oOrder->billing['zone_id']);
$tax = oos_calculate_tax($oOrder->info['shipping_cost'], $shipping_tax);
if ($_SESSION['member']->group['show_price_tax'] == 1) {
$oOrder->info['shipping_cost'] += $tax;
}
$oOrder->info['tax'] += $tax;
$oOrder->info['tax_groups']["{$shipping_tax_description}"] += $tax;
$oOrder->info['total'] += $tax;
}
$this->output[] = array('title' => $oOrder->info['shipping_method'] . ':', 'text' => $oCurrencies->format($oOrder->info['shipping_cost'], true, $oOrder->info['currency'], $oOrder->info['currency_value']), 'value' => $oOrder->info['shipping_cost']);
}
}
示例7: quote
function quote($method = '')
{
global $oOrder, $aLang, $shipping_weight;
$weight_cost = preg_split("/[:,]/", MODULE_SHIPPING_WEIGHT_COST);
if ($shipping_weight > $weight_cost[count($weight_cost) - 2]) {
$shipping = ($shipping_weight - $weight_cost[count($weight_cost) - 2]) * MODULE_SHIPPING_WEIGHT_STEP + $weight_cost[count($weight_cost) - 1];
}
for ($i = 0; $i < count($weight_cost); $i += 2) {
if ($shipping_weight <= $weight_cost[$i]) {
$shipping = $weight_cost[$i + 1];
break;
}
}
$this->quotes = array('id' => $this->code, 'module' => $aLang['module_shipping_weight_text_title'], 'methods' => array(array('id' => $this->code, 'title' => $aLang['module_shipping_weight_text_way'], 'cost' => $shipping + MODULE_SHIPPING_WEIGHT_HANDLING)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = oos_get_tax_rate($this->tax_class, $oOrder->delivery['country']['id'], $oOrder->delivery['zone_id']);
}
if (!empty($this->icon)) {
$this->quotes['icon'] = oos_image($this->icon, $this->title);
}
return $this->quotes;
}
示例8: array
default:
$options .= '<tr><td class="main">' . $products_options_name['products_options_name'] . ':</td><td class="main">' . "\n";
$selected = 0;
$products_options_array = array();
$products_attributestable = $oostable['products_attributes'];
$products_options_valuestable = $oostable['products_options_values'];
$products_options_sql = "SELECT pov.products_options_values_id, pov.products_options_values_name,\n pa.options_values_price, pa.price_prefix, pa.options_sort_order\n FROM {$products_attributestable} pa,\n {$products_options_valuestable} pov\n WHERE pa.products_id = '" . intval($nProductsId) . "'\n AND pa.options_id = '" . $products_options_name['products_options_id'] . "'\n AND pa.options_values_id = pov.products_options_values_id\n AND pov.products_options_values_languages_id = '" . intval($nLanguageID) . "'\n " . $options_sort_by;
$products_options_result = $dbconn->Execute($products_options_sql);
while ($products_options = $products_options_result->fields) {
$products_options_array[] = array('id' => $products_options['products_options_values_id'], 'text' => $products_options['products_options_values_name']);
if ($products_options['options_values_price'] > '0') {
if ($_SESSION['member']->group['show_price'] == 1) {
if ($info_product_discount != 0) {
$products_options_array[count($products_options_array) - 1]['text'] .= ' (' . $products_options['price_prefix'] . $oCurrencies->display_price($products_options['options_values_price'], oos_get_tax_rate($product_info['products_tax_class_id'])) . ' -' . number_format($info_product_discount, 2) . '% ) ';
} else {
$products_options_array[count($products_options_array) - 1]['text'] .= ' (' . $products_options['price_prefix'] . $oCurrencies->display_price($products_options['options_values_price'], oos_get_tax_rate($product_info['products_tax_class_id'])) . ') ';
}
}
}
// Move that ADOdb pointer!
$products_options_result->MoveNext();
}
$options .= oos_draw_pull_down_menu('id[' . $products_options_name['products_options_id'] . ']', $products_options_array, $_SESSION['cart']->contents[$sProductsId]['attributes'][$products_options_name['products_options_id']]);
$options .= '</td></tr>';
}
// Move that ADOdb pointer!
$products_options_name_result->MoveNext();
}
$options .= '</table>';
}
}
示例9: quote
function quote($method = '')
{
global $oOrder, $aLang, $shipping_weight, $shipping_num_boxes;
$dest_country = $oOrder->delivery['country']['iso_code_2'];
$dest_zone = 0;
$error = false;
for ($j = 1; $j <= $this->num_fedexeu; $j++) {
$countries_table = constant('MODULE_SHIPPING_FEDEXEU_COUNTRIES_' . $j);
$country_zones = split("[,]", $countries_table);
if (in_array($dest_country, $country_zones)) {
$dest_zone = $j;
break;
}
}
if ($dest_zone == 0) {
$error = true;
} else {
$shipping = -1;
$fedexeu_cost_pak = @constant('MODULE_SHIPPING_FEDEXEU_COST_PAK_' . $j);
$fedexeu_cost_box = @constant('MODULE_SHIPPING_FEDEXEU_COST_BOX_' . $j);
$methods = array();
if ($fedexeu_cost_pak != '') {
$fedexeu_table_pak = split("[:,]", $fedexeu_cost_pak);
for ($i = 0; $i < count($fedexeu_table_pak); $i += 2) {
if ($shipping_weight <= $fedexeu_table_pak[$i]) {
$shipping_pak = $fedexeu_table_pak[$i + 1];
break;
}
}
if ($shipping_pak == -1) {
$shipping_cost = 0;
$shipping_method = $aLang['module_shipping_fedexeu_undefined_rate'];
} else {
$shipping_cost_1 = $shipping_pak + MODULE_SHIPPING_FEDEXEU_HANDLING;
}
if ($shipping_pak != 0) {
$methods[] = array('id' => 'PAK', 'title' => 'FedEx Pak', 'cost' => (MODULE_SHIPPING_FEDEXEU_HANDLING + $shipping_cost_1) * $shipping_num_boxes);
}
}
if ($fedexeu_cost_box != '') {
$fedexeu_table_box = split("[:,]", $fedexeu_cost_box);
if ($shipping_weight > 10 and $shipping_weight <= 20) {
$shipping_box = number_format(($shipping_weight - 10) * 2 + 0.5, 0) * constant('MODULE_SHIPPING_FEDEXEU_SOOS_BOX_20_' . $j) + $fedexeu_table_box[count($fedexeu_table_box) - 1];
} elseif ($shipping_weight > 20 and $shipping_weight <= 40) {
$shipping_box = number_format(($shipping_weight - 20) * 2 + 0.5, 0) * constant('MODULE_SHIPPING_FEDEXEU_SOOS_BOX_40_' . $j) + 20 * constant('MODULE_SHIPPING_FEDEXEU_SOOS_BOX_20_' . $j) + $fedexeu_table_box[count($fedexeu_table_box) - 1];
} elseif ($shipping_weight > 40 and $shipping_weight <= 70) {
$shipping_box = number_format(($shipping_weight - 40) * 2 + 0.5, 0) * constant('MODULE_SHIPPING_FEDEXEU_SOOS_BOX_70_' . $j) + 20 * constant('MODULE_SHIPPING_FEDEXEU_SOOS_BOX_20_' . $j) + 40 * constant('MODULE_SHIPPING_FEDEXEU_SOOS_BOX_40_' . $j) + $fedexeu_table_box[count($fedexeu_table_box) - 1];
} else {
for ($i = 0; $i < count($fedexeu_table_box); $i += 2) {
if ($shipping_weight <= $fedexeu_table_box[$i]) {
$shipping_box = $fedexeu_table_box[$i + 1];
break;
}
}
}
if ($shipping_box == -1) {
$shipping_cost = 0;
$shipping_method = $aLang['module_shipping_fedexeu_undefined_rate'];
} else {
$shipping_cost_2 = $shipping_box + MODULE_SHIPPING_FEDEXEU_HANDLING;
}
if ($shipping_box != 0) {
$methods[] = array('id' => 'BOX', 'title' => 'FedEx Box', 'cost' => (MODULE_SHIPPING_FEDEXEU_HANDLING + $shipping_cost_2) * $shipping_num_boxes);
}
}
}
$this->quotes = array('id' => $this->code, 'module' => $this->title . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . ' ' . $aLang['module_shipping_fedexeu_text_units'] . ')');
$this->quotes['methods'] = $methods;
if ($this->tax_class > 0) {
$this->quotes['tax'] = oos_get_tax_rate($this->tax_class, $oOrder->delivery['country']['id'], $oOrder->delivery['zone_id']);
}
if (oos_is_not_null($this->icon)) {
$this->quotes['icon'] = oos_image($this->icon, $this->title);
}
if ($error == true) {
$this->quotes['error'] = $aLang['module_shipping_fedexeu_invalid_zone'];
}
if (oos_is_not_null($method) && isset($this->types[$method])) {
for ($i = 0; $i < count($methods); $i++) {
if ($method == $methods[$i]['id']) {
$methodsc = array();
$methodsc[] = array('id' => $methods[$i]['id'], 'title' => $methods[$i]['title'], 'cost' => $methods[$i]['cost']);
break;
}
}
$this->quotes['methods'] = $methodsc;
}
return $this->quotes;
}
示例10: get_order_total
function get_order_total()
{
global $oOrder;
$order_total = $oOrder->info['total'];
// Check if gift voucher is in cart and adjust total
$products = $_SESSION['cart']->get_products();
for ($i = 0; $i < count($products); $i++) {
$t_prid = oos_get_product_id($products[$i]['id']);
// Get database information
$dbconn =& oosDBGetConn();
$oostable =& oosDBGetTables();
$productstable = $oostable['products'];
$query = "SELECT products_price, products_tax_class_id, products_model\n FROM {$productstable}\n WHERE products_id = '" . intval($t_prid) . "'";
$gv_result = $dbconn->GetRow($query);
if (ereg('^GIFT', addslashes($gv_result['products_model']))) {
$qty = $_SESSION['cart']->get_quantity($t_prid);
$products_tax = oos_get_tax_rate($gv_result['products_tax_class_id']);
if ($this->include_tax == '0') {
$gv_amount = $gv_result['products_price'] * $qty;
} else {
$gv_amount = ($gv_result['products_price'] + oos_calculate_tax($gv_result['products_price'], $products_tax)) * $qty;
}
$order_total = $order_total - $gv_amount;
}
}
if ($this->include_tax == '0') {
$order_total = $order_total - $oOrder->info['tax'];
}
if ($this->include_shipping == '0') {
$order_total = $order_total - $oOrder->info['shipping_cost'];
}
return $order_total;
}
示例11: oos_get_tax_rate
if (!empty($featured_special_price)) {
$featured_product_special_price = $oCurrencies->display_price($featured_special_price, oos_get_tax_rate($featured['products_tax_class_id']));
} else {
$featured_max_product_discount = min($featured['products_discount_allowed'],$_SESSION['member']->group['discount']);
if ($featured_max_product_discount != 0 ) {
$featured_special_price = $featured['products_price']*(100-$featured_max_product_discount)/100;
$featured_product_discount_price = $oCurrencies->display_price($featured_special_price, oos_get_tax_rate($featured['products_tax_class_id']));
}
}
if ($featured['products_base_price'] != 1) {
$featured_base_product_price = $oCurrencies->display_price($featured['products_price'] * $featured['products_base_price'], oos_get_tax_rate($featured['products_tax_class_id']));
if ($featured_special_price != '') {
$featured_base_product_special_price = $oCurrencies->display_price($featured_special_price * $featured['products_base_price'], oos_get_tax_rate($featured['products_tax_class_id']));
}
}
$aFeatured[] = array('products_id' => $featured['products_id'],
'products_image' => $featured['products_image'],
'products_name' => $featured['products_name'],
'products_description' => oos_remove_tags($featured['products_description']),
'products_base_price' => $featured['products_base_price'],
'products_base_unit' => $featured['products_base_unit'],
'products_units' => $featured_units,
'featured_product_price' => $featured_product_price,
'featured_product_special_price' => $featured_product_special_price,
'featured_max_product_discount' => $featured_max_product_discount,
'featured_product_discount_price' => $featured_product_discount_price,
'featured_base_product_price' => $featured_base_product_price,
示例12: oos_get_tax_rate
$pl_product_special_price = $oCurrencies->display_price($pl_special_price, oos_get_tax_rate($listing['products_tax_class_id']));
} else {
$pl_max_product_discount = min($listing['products_discount_allowed'],$_SESSION['member']->group['discount']);
if ($pl_max_product_discount != 0 ) {
$pl_special_price = $listing['products_price']*(100-$pl_max_product_discount)/100;
$pl_product_special_price = $oCurrencies->display_price($pl_special_price, oos_get_tax_rate($listing['products_tax_class_id']));
}
}
if ($listing['products_base_price'] != 1) {
$pl_base_product_price = $oCurrencies->display_price($listing['products_price'] * $listing['products_base_price'], oos_get_tax_rate($listing['products_tax_class_id']));
if ($pl_special_price != '') {
$pl_base_product_special_price = $oCurrencies->display_price($pl_special_price * $listing['products_base_price'], oos_get_tax_rate($listing['products_tax_class_id']));
}
}
if (!empty($listing['specials_new_products_price'])) {
$sProductListPrice = ' <s>' . $pl_product_price . $sUnits . '</s><br />';
if ($listing['products_base_price'] != 1) $lc_text .= '<s><span class="base_price">' . $listing['products_base_unit'] . ' = ' . $pl_base_product_price . '</span></s><br />';
$sProductListPrice .= ' <span class="special_price">' . $pl_product_special_price . $sUnits . '</span>';
if ($listing['products_base_price'] != 1) $lc_text .= '<br /><span class="special_base_price">' . $listing['products_base_unit'] . ' = ' . $pl_base_product_special_price . '</span></s><br />';
} else {
if ($pl_max_product_discount != 0 ) {
$sProductListPrice = ' <s>' . $pl_product_price . $sUnits . '</s> -' . number_format($pl_max_product_discount, 2) . '%<br />';
$sProductListPrice .= ' <span class="discount_price">' . $pl_product_special_price . $sUnits . '</span>';
if ($listing['products_base_price'] != 1) $lc_text .= '<br /><span class="special_base_price">' . $listing['products_base_unit'] . ' = ' . $pl_base_product_special_price . '</span></s><br />';
示例13: quote
function quote($method = '')
{
global $oOrder, $aLang, $shipping_weight, $shipping_num_boxes;
if (!empty($method) && (isset($this->types[$method]) || in_array($method, $this->intl_types))) {
$this->_setService($method);
}
$this->_setMachinable('0');
$this->_setContainer('None');
$this->_setSize('REGULAR');
// usps doesnt accept zero weight
$shipping_weight = $shipping_weight < 0.1 ? 0.1 : $shipping_weight;
$shipping_pounds = floor($shipping_weight);
$shipping_ounces = round(16 * ($shipping_weight - floor($shipping_weight)));
$this->_setWeight($shipping_pounds, $shipping_ounces);
$uspsQuote = $this->_getQuote();
if (is_array($uspsQuote)) {
if (isset($uspsQuote['error'])) {
$this->quotes = array('module' => $this->title, 'error' => $uspsQuote['error']);
} else {
$this->quotes = array('id' => $this->code, 'module' => $this->title . ' (' . $shipping_num_boxes . ' x ' . $shipping_weight . 'lbs)');
$methods = array();
$size = count($uspsQuote);
for ($i = 0; $i < $size; $i++) {
list($type, $cost) = each($uspsQuote[$i]);
$methods[] = array('id' => $type, 'title' => isset($this->types[$type]) ? $this->types[$type] : $type, 'cost' => ($cost + MODULE_SHIPPING_USPS_HANDLING) * $shipping_num_boxes);
}
$this->quotes['methods'] = $methods;
if ($this->tax_class > 0) {
$this->quotes['tax'] = oos_get_tax_rate($this->tax_class, $oOrder->delivery['country']['id'], $oOrder->delivery['zone_id']);
}
}
} else {
$this->quotes = array('module' => $this->title, 'error' => $aLang['module_shipping_usps_text_error']);
}
if (!empty($this->icon)) {
$this->quotes['icon'] = oos_image($this->icon, $this->title);
}
return $this->quotes;
}
示例14: extract
extract($row, EXTR_PREFIX_ALL, "opt");
$AddedOptionsPrice += $opt_options_values_price;
$option_value_details[$option_id][$option_value_id] = array("options_values_price" => $opt_options_values_price);
$option_names[$option_id] = $opt_products_options_name;
$option_values_names[$option_value_id] = $opt_products_options_values_name;
}
}
// Get Product Info
$InfoQuery = "select p.products_model,p.products_price,pd.products_name,p.products_tax_class_id from " . $oostable['products'] . " p left join " . $oostable['products_description'] . " pd on pd.products_id=p.products_id WHERE p.products_id='{$add_product_products_id}'";
$result = $dbconn->Execute($InfoQuery);
$row = $result->fields;
extract($row, EXTR_PREFIX_ALL, "p");
// Following functions are defined at the bottom of this file
$CountryID = oos_get_country_id($order->delivery["country"]);
$ZoneID = oos_get_zone_id($CountryID, $order->delivery["state"]);
$ProductsTax = oos_get_tax_rate($p_products_tax_class_id, $CountryID, $ZoneID);
$Query = "insert into " . $oostable['orders_products'] . " set\n orders_id = {$oID},\n products_id = {$add_product_products_id},\n products_model = '{$p_products_model}',\n products_name = '" . str_replace("'", "'", $p_products_name) . "',\n products_price = '{$p_products_price}',\n final_price = '" . ($p_products_price + $AddedOptionsPrice) . "',\n products_tax = '{$ProductsTax}',\n products_quantity = {$add_product_quantity};";
$dbconn->Execute($Query);
$new_product_id = $dbconn->Insert_ID();
//UPDATE_INVENTORY_QUANTITY_START
$dbconn->Execute("UPDATE " . $oostable['products'] . " SET products_quantity = products_quantity - " . $add_product_quantity . ", products_ordered = products_ordered + " . $add_product_quantity . " WHERE products_id = '" . $add_product_products_id . "'");
//UPDATE_INVENTORY_QUANTITY_END
if (isset($add_product_options)) {
foreach ($add_product_options as $option_id => $option_value_id) {
$Query = "insert into " . $oostable['orders_products_attributes'] . " set\n orders_id = {$oID},\n orders_products_id = {$new_product_id},\n products_options = '" . $option_names[$option_id] . "',\n products_options_values = '" . $option_values_names[$option_value_id] . "',\n options_values_price = '" . $option_value_details[$option_id][$option_value_id]["options_values_price"] . "',\n price_prefix = '+';";
$dbconn->Execute($Query);
}
}
// Calculate Tax and Sub-Totals
$order = new order($oID);
$RunningSubTotal = 0;
示例15: oos_get_tax_rate
$reviews_total = $reviews->fields['total'];
$oSmarty->assign('reviews_total', $reviews_total);
}
$discounts_price = '0';
if (oos_empty($info_special_price) && ($product_info['products_discount4_qty'] > 0 || $product_info['products_discount3_qty'] > 0 || $product_info['products_discount2_qty'] > 0 || $product_info['products_discount1_qty'] > 0)) {
if ($_SESSION['member']->group['show_price'] == 1 && $_SESSION['member']->group['qty_discounts'] == 1) {
$discounts_price = '1';
require 'includes/modules/discounts_price.php';
if ($product_info['products_discount4'] > 0) {
$price_discount = $oCurrencies->display_price($product_info['products_discount4'], oos_get_tax_rate($product_info['products_tax_class_id']));
} elseif ($product_info['products_discount3'] > 0) {
$price_discount = $oCurrencies->display_price($product_info['products_discount3'], oos_get_tax_rate($product_info['products_tax_class_id']));
} elseif ($product_info['products_discount2'] > 0) {
$price_discount = $oCurrencies->display_price($product_info['products_discount2'], oos_get_tax_rate($product_info['products_tax_class_id']));
} elseif ($product_info['products_discount1'] > 0) {
$price_discount = $oCurrencies->display_price($product_info['products_discount1'], oos_get_tax_rate($product_info['products_tax_class_id']));
}
if (isset($price_discount)) {
$oSmarty->assign('price_discount', $price_discount);
}
}
}
require 'includes/modules/products_options.php';
// assign Smarty variables;
$oSmarty->assign(array('oos_breadcrumb' => $oBreadcrumb->trail(BREADCRUMB_SEPARATOR), 'discounts_price' => $discounts_price));
if (!isset($block_get_parameters)) {
$block_get_parameters = oos_get_all_get_parameters(array('action'));
$block_get_parameters = oos_remove_trailing($block_get_parameters);
$oSmarty->assign('get_params', $block_get_parameters);
}
$oSmarty->assign('product_info', $product_info);