本文整理汇总了PHP中tep_add_tax函数的典型用法代码示例。如果您正苦于以下问题:PHP tep_add_tax函数的具体用法?PHP tep_add_tax怎么用?PHP tep_add_tax使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tep_add_tax函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: process
function process()
{
global $order, $currencies;
if (MODULE_ORDER_TOTAL_LOWORDERFEE_LOW_ORDER_FEE == 'true') {
switch (MODULE_ORDER_TOTAL_LOWORDERFEE_DESTINATION) {
case 'national':
if ($order->delivery['country_id'] == STORE_COUNTRY) {
$pass = true;
}
break;
case 'international':
if ($order->delivery['country_id'] != STORE_COUNTRY) {
$pass = true;
}
break;
case 'both':
$pass = true;
break;
default:
$pass = false;
break;
}
if ($pass == true && $order->info['total'] - $order->info['shipping_cost'] < MODULE_ORDER_TOTAL_LOWORDERFEE_ORDER_UNDER) {
$tax = tep_get_tax_rate(MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']);
$tax_description = tep_get_tax_description(MODULE_ORDER_TOTAL_LOWORDERFEE_TAX_CLASS, $order->delivery['country']['id'], $order->delivery['zone_id']);
$order->info['tax'] += tep_calculate_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax);
$order->info['tax_groups']["{$tax_description}"] += tep_calculate_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax);
$order->info['total'] += MODULE_ORDER_TOTAL_LOWORDERFEE_FEE + tep_calculate_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax);
$this->output[] = array('title' => $this->title . ':', 'text' => $currencies->format(tep_add_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax), true, $order->info['currency'], $order->info['currency_value']), 'value' => tep_add_tax(MODULE_ORDER_TOTAL_LOWORDERFEE_FEE, $tax));
}
}
}
示例2: calculate_price
function calculate_price($products_price, $products_tax, $quantity = 1, $rate = "", $pid = "")
{
global $currency;
if (is_numeric($pid)) {
$dbres = tep_db_query("select categories_id from products_to_categories where products_id='" . $pid . "'");
$row = tep_db_fetch_array($dbres);
$cat_id = (int) $row['categories_id'];
if ($cat_id == 23) {
return tep_round(tep_add_tax($products_price, $products_tax), $this->currencies[$currency]['decimal_places']) * $quantity;
}
}
if ($rate == "") {
$rate = get_price_rate($_SESSION['customer_id']);
}
if (get_price_group_name($_SESSION['customer_id']) == "Interior Designer") {
$dbres = tep_db_query("select dn_price from products where products_id='{$pid}'");
$row = tep_db_fetch_array($dbres);
if ((double) $row['dn_price'] > 0) {
$products_price = $row['dn_price'];
$rate = "100";
}
}
return ceil(tep_add_tax($products_price * $rate / 100, $products_tax)) * $quantity;
// return tep_round(tep_add_tax(($products_price*$rate)/100, $products_tax), $this->currencies[$currency]['decimal_places']) * $quantity;
}
示例3: query
function query($order_id)
{
global $shipping;
$order_query = tep_db_query("select * from " . TABLE_ORDERS . " where orders_id = '" . (int) $order_id . "'");
$order = tep_db_fetch_array($order_query);
$totals_query = tep_db_query("select * from " . TABLE_ORDERS_TOTAL . " where orders_id = '" . (int) $order_id . "' order by sort_order");
while ($totals = tep_db_fetch_array($totals_query)) {
$this->totals[] = array('title' => $totals['title'], 'text' => $totals['text'], 'class' => $totals['class'], 'value' => $totals['value'], 'sort_order' => $totals['sort_order'], 'orders_total_id' => $totals['orders_total_id']);
}
$this->info = array('currency' => $order['currency'], 'currency_value' => $order['currency_value'], 'payment_method' => $order['payment_method'], 'cc_type' => $order['cc_type'], 'cc_owner' => $order['cc_owner'], 'cc_number' => $order['cc_number'], 'cc_expires' => $order['cc_expires'], 'date_purchased' => $order['date_purchased'], 'orders_status' => $order['orders_status'], 'last_modified' => $order['last_modified'], 'shipping_method' => $shipping['title'], 'shipping_cost' => $shipping['cost'], 'shipping_id' => $order['shipping_module'], 'subtotal' => 0, 'tax' => 0, 'tax_groups' => array());
$this->customer = array('id' => $order['customers_id'], 'name' => $order['customers_name'], 'company' => $order['customers_company'], 'street_address' => $order['customers_street_address'], 'suburb' => $order['customers_suburb'], 'city' => $order['customers_city'], 'postcode' => $order['customers_postcode'], 'state' => $order['customers_state'], 'country' => $order['customers_country'], 'country_id' => oe_get_country_id($order['customers_country']), 'zone_id' => oe_get_zone_id(oe_get_country_id($order['customers_country']), $order['customers_state']), 'format_id' => $order['customers_address_format_id'], 'telephone' => $order['customers_telephone'], 'email_address' => $order['customers_email_address']);
$this->delivery = array('name' => $order['delivery_name'], 'company' => $order['delivery_company'], 'street_address' => $order['delivery_street_address'], 'suburb' => $order['delivery_suburb'], 'city' => $order['delivery_city'], 'postcode' => $order['delivery_postcode'], 'state' => $order['delivery_state'], 'country' => $order['delivery_country'], 'country_id' => oe_get_country_id($order['delivery_country']), 'zone_id' => oe_get_zone_id(oe_get_country_id($order['delivery_country']), $order['delivery_state']), 'format_id' => $order['delivery_address_format_id']);
$this->billing = array('name' => $order['billing_name'], 'company' => $order['billing_company'], 'street_address' => $order['billing_street_address'], 'suburb' => $order['billing_suburb'], 'city' => $order['billing_city'], 'postcode' => $order['billing_postcode'], 'state' => $order['billing_state'], 'country' => $order['billing_country'], 'country_id' => oe_get_country_id($order['billing_country']), 'zone_id' => oe_get_zone_id(oe_get_country_id($order['billing_country']), $order['billing_state']), 'format_id' => $order['billing_address_format_id']);
$index = 0;
$orders_products_query = tep_db_query("select op.orders_products_id, op.products_id, op.products_name, op.products_model, op.products_code, op.products_price, op.products_tax, op.products_quantity, op.final_price, p.products_tax_class_id, p.products_weight, p.products_id from " . TABLE_ORDERS_PRODUCTS . " op INNER JOIN " . TABLE_PRODUCTS . " p on op.products_id = p.products_id where orders_id = '" . (int) $order_id . "' order by op.orders_products_id");
while ($orders_products = tep_db_fetch_array($orders_products_query)) {
$orders_products_tax_query = tep_db_query("select products_tax_class_id from " . TABLE_PRODUCTS . " where products_id = " . $orders_products['products_id'] . "");
$orders_products_tax = tep_db_fetch_array($orders_products_tax_query);
$this->products[$index] = array('qty' => $orders_products['products_quantity'], 'name' => $orders_products['products_name'], 'model' => $orders_products['products_model'], 'code' => $orders_products['products_code'], 'tax' => $orders_products['products_tax'], 'tax_description' => tep_get_tax_description($orders_products_tax['products_tax_class_id'], $this->delivery["country_id"], $this->delivery["zone_id"]), 'price' => $orders_products['products_price'], 'final_price' => $orders_products['final_price'], 'weight' => $orders_products['products_weight'], 'products_id' => $orders_products['products_id'], 'orders_products_id' => $orders_products['orders_products_id']);
$subindex = 0;
$attributes_query = tep_db_query("select products_options, products_options_values, options_values_price, price_prefix, orders_products_attributes_id from " . TABLE_ORDERS_PRODUCTS_ATTRIBUTES . " where orders_id = '" . (int) $order_id . "' and orders_products_id = '" . (int) $orders_products['orders_products_id'] . "'");
if (tep_db_num_rows($attributes_query)) {
while ($attributes = tep_db_fetch_array($attributes_query)) {
$this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options'], 'value' => $attributes['products_options_values'], 'prefix' => $attributes['price_prefix'], 'price' => $attributes['options_values_price'], 'orders_products_attributes_id' => $attributes['orders_products_attributes_id']);
$subindex++;
}
}
$shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];
$this->info['subtotal'] += $shown_price;
$products_tax = $this->products[$index]['tax'];
$products_tax_description = $this->products[$index]['tax_description'];
if (DISPLAY_PRICE_WITH_TAX == 'true') {
$this->info['tax'] += $shown_price - $shown_price / ($products_tax < 10 ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax));
if (isset($this->info['tax_groups']["{$products_tax_description}"])) {
$this->info['tax_groups']["{$products_tax_description}"] += $shown_price - $shown_price / ($products_tax < 10 ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax));
} else {
$this->info['tax_groups']["{$products_tax_description}"] = $shown_price - $shown_price / ($products_tax < 10 ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax));
}
} else {
$this->info['tax'] += $products_tax / 100 * $shown_price;
if (isset($this->info['tax_groups']["{$products_tax_description}"])) {
$this->info['tax_groups']["{$products_tax_description}"] += $products_tax / 100 * $shown_price;
} else {
$this->info['tax_groups']["{$products_tax_description}"] = $products_tax / 100 * $shown_price;
}
}
$index++;
}
if (DISPLAY_PRICE_WITH_TAX == 'true') {
$this->info['total'] = $this->info['subtotal'] + $this->info['shipping_cost'];
} else {
$this->info['total'] = $this->info['subtotal'] + $this->info['tax'] + $this->info['shipping_cost'];
}
}
示例4: process_button
function process_button()
{
global $HTTP_POST_VARS, $customer_id, $currencies, $currency, $order, $languages_id, $cartID;
$process_button_string = tep_draw_hidden_field('sid', MODULE_PAYMENT_2CHECKOUT_LOGIN) . tep_draw_hidden_field('total', $this->format_raw($order->info['total'], MODULE_PAYMENT_2CHECKOUT_CURRENCY)) . tep_draw_hidden_field('cart_order_id', date('YmdHis') . '-' . $customer_id . '-' . $cartID) . tep_draw_hidden_field('fixed', 'Y') . tep_draw_hidden_field('first_name', $order->billing['firstname']) . tep_draw_hidden_field('last_name', $order->billing['lastname']) . tep_draw_hidden_field('street_address', $order->billing['street_address']) . tep_draw_hidden_field('city', $order->billing['city']) . tep_draw_hidden_field('state', $order->billing['state']) . tep_draw_hidden_field('zip', $order->billing['postcode']) . tep_draw_hidden_field('country', $order->billing['country']['title']) . tep_draw_hidden_field('email', $order->customer['email_address']) . tep_draw_hidden_field('phone', $order->customer['telephone']) . tep_draw_hidden_field('ship_name', $order->delivery['firstname'] . ' ' . $order->delivery['lastname']) . tep_draw_hidden_field('ship_street_address', $order->delivery['street_address']) . tep_draw_hidden_field('ship_city', $order->delivery['city']) . tep_draw_hidden_field('ship_state', $order->delivery['state']) . tep_draw_hidden_field('ship_zip', $order->delivery['postcode']) . tep_draw_hidden_field('ship_country', $order->delivery['country']['title']);
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
$process_button_string .= tep_draw_hidden_field('c_prod_' . ($i + 1), (int) $order->products[$i]['id'] . ',' . (int) $order->products[$i]['qty']) . tep_draw_hidden_field('c_name_' . ($i + 1), $order->products[$i]['name']) . tep_draw_hidden_field('c_description_' . ($i + 1), $order->products[$i]['name']) . tep_draw_hidden_field('c_price_' . ($i + 1), $this->format_raw(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), MODULE_PAYMENT_2CHECKOUT_CURRENCY));
}
$process_button_string .= tep_draw_hidden_field('id_type', '1') . tep_draw_hidden_field('skip_landing', '1');
if (MODULE_PAYMENT_2CHECKOUT_TESTMODE == 'Test') {
$process_button_string .= tep_draw_hidden_field('demo', 'Y');
}
$process_button_string .= tep_draw_hidden_field('return_url', tep_href_link(FILENAME_SHOPPING_CART));
$lang_query = tep_db_query("select code from " . TABLE_LANGUAGES . " where languages_id = '" . (int) $languages_id . "'");
$lang = tep_db_fetch_array($lang_query);
switch (strtolower($lang['code'])) {
case 'es':
$process_button_string .= tep_draw_hidden_field('lang', 'sp');
break;
}
$process_button_string .= tep_draw_hidden_field('cart_brand_name', 'oscommerce') . tep_draw_hidden_field('cart_version_name', PROJECT_VERSION);
return $process_button_string;
}
示例5: floor
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" colspan="3"><?php
echo TABLE_HEADING_SHIPPING_QUOTES;
?>
</td>
</tr>
<?php
$r = 0;
for ($i = 0, $n = sizeof($shipping_quotes); $i < $n; $i++) {
for ($j = 0, $n2 = sizeof($shipping_quotes[$i]['methods']); $j < $n2; $j++) {
$r++;
if (!isset($shipping_quotes[$i]['tax'])) {
$shipping_quotes[$i]['tax'] = 0;
}
$rowClass = $r / 2 == floor($r / 2) ? 'dataTableRowOver' : 'dataTableRow';
echo ' <tr class="' . $rowClass . '" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this, \'' . $rowClass . '\')" onclick="selectRowEffect(this, ' . $r . '); setShipping(' . $r . ');">' . "\n" . ' <td class="dataTableContent" valign="top" align="left" width="15px">' . "\n" . ' <input type="radio" name="shipping" id="shipping_radio_' . $r . '" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'] . '">' . "\n" . ' <input type="hidden" id="update_shipping[' . $r . '][title]" name="update_shipping[' . $r . '][title]" value="' . $shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'] . '):">' . "\n" . ' <input type="hidden" id="update_shipping[' . $r . '][value]" name="update_shipping[' . $r . '][value]" value="' . tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']) . '">' . "\n" . ' <input type="hidden" id="update_shipping[' . $r . '][id]" name="update_shipping[' . $r . '][id]" value="' . $shipping_quotes[$i]['id'] . '_' . $shipping_quotes[$i]['methods'][$j]['id'] . '">' . "\n" . '<td class="dataTableContent" valign="top">' . $shipping_quotes[$i]['module'] . ' (' . $shipping_quotes[$i]['methods'][$j]['title'] . '):</td>' . "\n" . '<td class="dataTableContent" align="right">' . $currencies->format(tep_add_tax($shipping_quotes[$i]['methods'][$j]['cost'], $shipping_quotes[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . ' </tr>';
}
}
?>
<tr class="dataTableHeadingRow">
<td class="dataTableHeadingContent" colspan="3"><?php
echo sprintf(TEXT_PACKAGE_WEIGHT_COUNT, $shipping_num_boxes . ' x ' . $shipping_weight, $total_count);
?>
</td>
</tr>
</table>
<!-- shipping_quote_eof //-->
<?php
} else {
echo AJAX_NO_QUOTES;
示例6: isset
echo ' ';
} else {
echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0));
?>
<?php
echo tep_draw_radio_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id'], $checked, 'required aria-required="true"');
}
?>
</td>
<?php
} else {
?>
<td align="right"><?php
echo $currencies->format(tep_add_tax($quotes[$i]['methods'][$j]['cost'], isset($quotes[$i]['tax']) ? $quotes[$i]['tax'] : 0)) . tep_draw_hidden_field('shipping', $quotes[$i]['id'] . '_' . $quotes[$i]['methods'][$j]['id']);
?>
</td>
<?php
}
?>
</tr>
<?php
}
}
}
?>
示例7: tep_display_tax_value
</b></td>
</tr>
<?php
}
for ($i = 0, $n = sizeof($order->products); $i < $n; $i++) {
echo ' <tr>' . "\n" . ' <td class="main" align="right" valign="top" width="30">' . $order->products[$i]['qty'] . ' x</td>' . "\n" . ' <td class="main" valign="top">' . $order->products[$i]['name'];
if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0) {
for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) {
echo '<br><nobr><small> <i> - ' . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'] . '</i></small></nobr>';
}
}
echo '</td>' . "\n";
if (sizeof($order->info['tax_groups']) > 1) {
echo ' <td class="main" valign="top" align="right">' . tep_display_tax_value($order->products[$i]['tax']) . '%</td>' . "\n";
}
echo ' <td class="main" align="right" valign="top">' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . ' </tr>' . "\n";
}
?>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td><?php
echo tep_draw_separator('pixel_trans.gif', '100%', '10');
?>
</td>
</tr>
<tr>
示例8: htmlspecialchars
</td>
</tr>
<?php
for ($i = 0; $i < sizeof($order->products); $i++) {
$orders_products_id = $order->products[$i]['orders_products_id'];
$RowStyle = "dataTableContent";
echo ' <tr class="dataTableRow">' . "\n" . ' <td class="' . $RowStyle . '" align="left" width="25">' . "<input name='update_products[{$orders_products_id}][qty]' size='2' value='" . $order->products[$i]['qty'] . "'></td>\n" . ' <td class="' . $RowStyle . '" width="10"> x </td>' . ' <td class="' . $RowStyle . '" width="300">' . $order->products[$i]['name'] . "<input name='update_products[{$orders_products_id}][name]' type='hidden' value='" . $order->products[$i]['name'] . "'>";
// # Has Attributes?
if (sizeof($order->products[$i]['attributes']) > 0) {
for ($j = 0; $j < sizeof($order->products[$i]['attributes']); $j++) {
$orders_products_attributes_id = $order->products[$i]['attributes'][$j]['orders_products_attributes_id'];
echo '<br><nobr><small> <i> - ' . htmlspecialchars($order->products[$i]['attributes'][$j]['option']) . ': ' . htmlspecialchars($order->products[$i]['attributes'][$j]['value']);
}
}
echo ' </td>' . "\n" . ' <td class="' . $RowStyle . '">' . $order->products[$i]['model'] . "<input name='update_products[{$orders_products_id}][model]' size='12' type='hidden' value='" . $order->products[$i]['model'] . "'>" . '</td>' . "\n" . ' <td class="' . $RowStyle . '">' . "<input name='update_products[{$orders_products_id}][tax]' size='4' value='" . tep_display_tax_value($order->products[$i]['tax']) . "'>" . '%</td>' . "\n" . ' <td class="' . $RowStyle . '" align="right">' . $currencies->format($order->products[$i]['final_price']) . "<input name='update_products[{$orders_products_id}][final_price]' size='5' type='hidden' value='" . $order->products[$i]['final_price'] . "'>" . '</td>' . "\n" . ' <td class="' . $RowStyle . '" align="right">' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . ' <td class="' . $RowStyle . '" align="right">' . $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</td>' . "\n" . ' <td class="' . $RowStyle . '" align="right"><b>' . $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']) . '</b></td>' . "\n" . ' </tr>' . "\n";
}
?>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" cellpadding="0" cellspacing="0">
<tr>
<td valign="top"><?php
echo "<span class='smalltext'>" . HINT_DELETE_POSITION . "</span>";
?>
</td>
<td align="right"><?php
示例9: cart
function cart()
{
global $customer_id, $sendto, $billto, $cart, $languages_id, $currency, $currencies, $shipping, $payment;
$this->content_type = $cart->get_content_type();
$customer_address_query = tep_db_query("select c.customers_firstname, c.customers_lastname, c.customers_telephone, c.customers_email_address, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, co.countries_id, co.countries_name, co.countries_iso_code_2, co.countries_iso_code_3, co.address_format_id, ab.entry_state from " . TABLE_CUSTOMERS . " c, " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " co on (ab.entry_country_id = co.countries_id) where c.customers_id = '" . (int) $customer_id . "' and ab.customers_id = '" . (int) $customer_id . "' and c.customers_default_address_id = ab.address_book_id");
$customer_address = tep_db_fetch_array($customer_address_query);
$shipping_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " c on (ab.entry_country_id = c.countries_id) where ab.customers_id = '" . (int) $customer_id . "' and ab.address_book_id = '" . (int) $sendto . "'");
$shipping_address = tep_db_fetch_array($shipping_address_query);
$billing_address_query = tep_db_query("select ab.entry_firstname, ab.entry_lastname, ab.entry_company, ab.entry_street_address, ab.entry_suburb, ab.entry_postcode, ab.entry_city, ab.entry_zone_id, z.zone_name, ab.entry_country_id, c.countries_id, c.countries_name, c.countries_iso_code_2, c.countries_iso_code_3, c.address_format_id, ab.entry_state from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) left join " . TABLE_COUNTRIES . " c on (ab.entry_country_id = c.countries_id) where ab.customers_id = '" . (int) $customer_id . "' and ab.address_book_id = '" . (int) $billto . "'");
$billing_address = tep_db_fetch_array($billing_address_query);
$tax_address_query = tep_db_query("select ab.entry_country_id, ab.entry_zone_id from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) where ab.customers_id = '" . (int) $customer_id . "' and ab.address_book_id = '" . (int) ($this->content_type == 'virtual' ? $billto : $sendto) . "'");
$tax_address = tep_db_fetch_array($tax_address_query);
$this->info = array('order_status' => DEFAULT_ORDERS_STATUS_ID, 'currency' => $currency, 'currency_value' => $currencies->currencies[$currency]['value'], 'payment_method' => $payment, 'cc_type' => isset($GLOBALS['cc_type']) ? $GLOBALS['cc_type'] : '', 'cc_owner' => isset($GLOBALS['cc_owner']) ? $GLOBALS['cc_owner'] : '', 'cc_number' => isset($GLOBALS['cc_number']) ? $GLOBALS['cc_number'] : '', 'cc_expires' => isset($GLOBALS['cc_expires']) ? $GLOBALS['cc_expires'] : '', 'shipping_method' => $shipping['title'], 'shipping_cost' => $shipping['cost'], 'subtotal' => 0, 'tax' => 0, 'tax_groups' => array(), 'comments' => isset($GLOBALS['comments']) ? $GLOBALS['comments'] : '');
if (isset($GLOBALS[$payment]) && is_object($GLOBALS[$payment])) {
$this->info['payment_method'] = $GLOBALS[$payment]->title;
if (isset($GLOBALS[$payment]->order_status) && is_numeric($GLOBALS[$payment]->order_status) && $GLOBALS[$payment]->order_status > 0) {
$this->info['order_status'] = $GLOBALS[$payment]->order_status;
}
}
$this->customer = array('firstname' => $customer_address['customers_firstname'], 'lastname' => $customer_address['customers_lastname'], 'company' => $customer_address['entry_company'], 'street_address' => $customer_address['entry_street_address'], 'suburb' => $customer_address['entry_suburb'], 'city' => $customer_address['entry_city'], 'postcode' => $customer_address['entry_postcode'], 'state' => tep_not_null($customer_address['entry_state']) ? $customer_address['entry_state'] : $customer_address['zone_name'], 'zone_id' => $customer_address['entry_zone_id'], 'country' => array('id' => $customer_address['countries_id'], 'title' => $customer_address['countries_name'], 'iso_code_2' => $customer_address['countries_iso_code_2'], 'iso_code_3' => $customer_address['countries_iso_code_3']), 'format_id' => $customer_address['address_format_id'], 'telephone' => $customer_address['customers_telephone'], 'email_address' => $customer_address['customers_email_address']);
$this->delivery = array('firstname' => $shipping_address['entry_firstname'], 'lastname' => $shipping_address['entry_lastname'], 'company' => $shipping_address['entry_company'], 'street_address' => $shipping_address['entry_street_address'], 'suburb' => $shipping_address['entry_suburb'], 'city' => $shipping_address['entry_city'], 'postcode' => $shipping_address['entry_postcode'], 'state' => tep_not_null($shipping_address['entry_state']) ? $shipping_address['entry_state'] : $shipping_address['zone_name'], 'zone_id' => $shipping_address['entry_zone_id'], 'country' => array('id' => $shipping_address['countries_id'], 'title' => $shipping_address['countries_name'], 'iso_code_2' => $shipping_address['countries_iso_code_2'], 'iso_code_3' => $shipping_address['countries_iso_code_3']), 'country_id' => $shipping_address['entry_country_id'], 'format_id' => $shipping_address['address_format_id']);
$this->billing = array('firstname' => $billing_address['entry_firstname'], 'lastname' => $billing_address['entry_lastname'], 'company' => $billing_address['entry_company'], 'street_address' => $billing_address['entry_street_address'], 'suburb' => $billing_address['entry_suburb'], 'city' => $billing_address['entry_city'], 'postcode' => $billing_address['entry_postcode'], 'state' => tep_not_null($billing_address['entry_state']) ? $billing_address['entry_state'] : $billing_address['zone_name'], 'zone_id' => $billing_address['entry_zone_id'], 'country' => array('id' => $billing_address['countries_id'], 'title' => $billing_address['countries_name'], 'iso_code_2' => $billing_address['countries_iso_code_2'], 'iso_code_3' => $billing_address['countries_iso_code_3']), 'country_id' => $billing_address['entry_country_id'], 'format_id' => $billing_address['address_format_id']);
$index = 0;
$products = $cart->get_products();
for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
$this->products[$index] = array('qty' => $products[$i]['quantity'], 'name' => $products[$i]['name'], 'model' => $products[$i]['model'], 'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']), 'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']), 'price' => $products[$i]['price'], 'final_price' => $products[$i]['price'] + $cart->attributes_price($products[$i]['id']), 'weight' => $products[$i]['weight'], 'id' => $products[$i]['id']);
if ($products[$i]['attributes']) {
$subindex = 0;
reset($products[$i]['attributes']);
while (list($option, $value) = each($products[$i]['attributes'])) {
$attributes_query = tep_db_query("select popt.products_options_name, poval.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_OPTIONS_VALUES . " poval, " . TABLE_PRODUCTS_ATTRIBUTES . " pa where pa.products_id = '" . (int) $products[$i]['id'] . "' and pa.options_id = '" . (int) $option . "' and pa.options_id = popt.products_options_id and pa.options_values_id = '" . (int) $value . "' and pa.options_values_id = poval.products_options_values_id and popt.language_id = '" . (int) $languages_id . "' and poval.language_id = '" . (int) $languages_id . "'");
$attributes = tep_db_fetch_array($attributes_query);
$this->products[$index]['attributes'][$subindex] = array('option' => $attributes['products_options_name'], 'value' => $attributes['products_options_values_name'], 'option_id' => $option, 'value_id' => $value, 'prefix' => $attributes['price_prefix'], 'price' => $attributes['options_values_price']);
$subindex++;
}
}
$shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];
$this->info['subtotal'] += $shown_price;
$products_tax = $this->products[$index]['tax'];
$products_tax_description = $this->products[$index]['tax_description'];
if (DISPLAY_PRICE_WITH_TAX == 'true') {
$this->info['tax'] += $shown_price - $shown_price / ($products_tax < 10 ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax));
if (isset($this->info['tax_groups']["{$products_tax_description}"])) {
$this->info['tax_groups']["{$products_tax_description}"] += $shown_price - $shown_price / ($products_tax < 10 ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax));
} else {
$this->info['tax_groups']["{$products_tax_description}"] = $shown_price - $shown_price / ($products_tax < 10 ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax));
}
} else {
$this->info['tax'] += $products_tax / 100 * $shown_price;
if (isset($this->info['tax_groups']["{$products_tax_description}"])) {
$this->info['tax_groups']["{$products_tax_description}"] += $products_tax / 100 * $shown_price;
} else {
$this->info['tax_groups']["{$products_tax_description}"] = $products_tax / 100 * $shown_price;
}
}
$index++;
}
if (DISPLAY_PRICE_WITH_TAX == 'true') {
$this->info['total'] = $this->info['subtotal'] + $this->info['shipping_cost'];
} else {
$this->info['total'] = $this->info['subtotal'] + $this->info['tax'] + $this->info['shipping_cost'];
}
}
示例10: payment
$payment_modules = new payment($payment);
require DIR_WS_CLASSES . 'order.php';
$order = new order();
// load the selected shipping module
require DIR_WS_CLASSES . 'shipping.php';
$shipping_modules = new shipping($shipping);
if (sizeof($order->products) == 0) {
tep_redirect(tep_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));
}
if ($customer_id == '58543') {
$order->info['subtotal'] = 0;
reset($order->products);
while (list($i) = each($order->products)) {
$order->products[$i]['price'] = round($order->products[$i]['price'] * 1.15);
$order->products[$i]['final_price'] = round($order->products[$i]['final_price'] * 1.15);
$order->info['subtotal'] += tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'];
$order->info['total'] = $order->info['subtotal'];
}
$shipping = array('id' => 'slf_0', 'title' => 'Самовывоз', 'cost' => 0);
}
require DIR_WS_CLASSES . 'order_total.php';
$order_total_modules = new order_total();
$order_totals = $order_total_modules->process();
if ($customer_id == '58543') {
reset($order_totals);
while (list($i) = each($order_totals)) {
if ($order_totals[$i]['code'] == 'ot_shipping') {
$order_totals[$i]['title'] = 'Самовывоз';
$order_totals[$i]['text'] = $currencies->format(0);
$order_totals[$i]['value'] = '0';
}
示例11: cart
//.........这里部分代码省略.........
$k = str_replace('companies_', 'company_', $k);
$k = str_replace('company_full_name', 'company_full', $k);
$k = str_replace('company_name', 'company', $k);
$company[$k] = $v;
}
$shipping_address_query = tep_db_query("select entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_zone_id, entry_country_id, entry_telephone, entry_state from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $customer_id . "' and address_book_id = '" . (int) $sendto . "'");
$shipping_address = tep_db_fetch_array($shipping_address_query);
if (!is_array($shipping_address)) {
$shipping_address = array();
}
$country_info_query = tep_db_query("select countries_id, countries_name, countries_iso_code_2, countries_iso_code_3, address_format_id from " . TABLE_COUNTRIES . " where countries_id = '" . (int) $shipping_address['entry_country_id'] . "' and language_id = '" . (int) $languages_id . "'");
$country_info = tep_db_fetch_array($country_info_query);
if (!is_array($country_info)) {
$country_info = array();
reset($shop_countries);
while (list(, $shop_country) = each($shop_countries)) {
if ($shop_country['country_id'] == $shipping_address['entry_country_id']) {
$country_info = array('countries_id' => $shop_country['country_id'], 'countries_name' => $shop_country['country_name'], 'countries_iso_code_2' => $shop_country['country_code'], 'countries_iso_code_3' => $shop_country['country_code_3'], 'address_format_id' => $shop_country['address_format_id']);
break;
}
}
}
$zone_info_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_id = '" . (int) $shipping_address['entry_zone_id'] . "'");
$zone_info = tep_db_fetch_array($zone_info_query);
if (!is_array($zone_info)) {
$zone_info = array();
}
$shipping_address = array_merge($shipping_address, $country_info, $zone_info);
$billing_address_query = tep_db_query("select entry_firstname, entry_lastname, entry_street_address, entry_suburb, entry_postcode, entry_city, entry_zone_id, entry_country_id, entry_telephone, entry_state from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . (int) $customer_id . "' and address_book_id = '" . (int) $billto . "'");
$billing_address = tep_db_fetch_array($billing_address_query);
if (!is_array($billing_address)) {
$billing_address = array();
}
$country_info_query = tep_db_query("select countries_id, countries_name, countries_iso_code_2, countries_iso_code_3, address_format_id from " . TABLE_COUNTRIES . " where countries_id = '" . (int) $billing_address['entry_country_id'] . "' and language_id = '" . (int) $languages_id . "'");
$country_info = tep_db_fetch_array($country_info_query);
if (!is_array($country_info)) {
$country_info = array();
reset($shop_countries);
while (list(, $shop_country) = each($shop_countries)) {
if ($shop_country['country_id'] == $billing_address['entry_country_id']) {
$country_info = array('countries_id' => $shop_country['country_id'], 'countries_name' => $shop_country['country_name'], 'countries_iso_code_2' => $shop_country['country_code'], 'countries_iso_code_3' => $shop_country['country_code_3'], 'address_format_id' => $shop_country['address_format_id']);
break;
}
}
}
$zone_info_query = tep_db_query("select zone_name from " . TABLE_ZONES . " where zone_id = '" . (int) $billing_address['entry_zone_id'] . "'");
$zone_info = tep_db_fetch_array($zone_info_query);
if (!is_array($zone_info)) {
$zone_info = array();
}
$billing_address = array_merge($billing_address, $country_info, $zone_info);
$tax_address_query = tep_db_query("select ab.entry_country_id, ab.entry_zone_id from " . TABLE_ADDRESS_BOOK . " ab left join " . TABLE_ZONES . " z on (ab.entry_zone_id = z.zone_id) where ab.customers_id = '" . (int) $customer_id . "' and ab.address_book_id = '" . (int) ($this->content_type == 'virtual' ? $billto : $sendto) . "'");
$tax_address = tep_db_fetch_array($tax_address_query);
$this->info = array('code' => '', 'order_status' => DEFAULT_ORDERS_STATUS_ID, 'currency' => $currency, 'currency_value' => $currencies->currencies[$currency]['value'], 'is_paid' => '0', 'payment_method' => $payment, 'cc_type' => isset($GLOBALS['cc_type']) ? $GLOBALS['cc_type'] : '', 'cc_owner' => isset($GLOBALS['cc_owner']) ? $GLOBALS['cc_owner'] : '', 'cc_number' => isset($GLOBALS['cc_number']) ? $GLOBALS['cc_number'] : '', 'cc_expires' => isset($GLOBALS['cc_expires']) ? $GLOBALS['cc_expires'] : '', 'check_account_type' => isset($GLOBALS['check_account_type']) ? $GLOBALS['check_account_type'] : '', 'check_bank_name' => isset($GLOBALS['check_bank_name']) ? $GLOBALS['check_bank_name'] : '', 'check_routing_number' => isset($GLOBALS['check_routing_number']) ? $GLOBALS['check_routing_number'] : '', 'check_account_number' => isset($GLOBALS['check_account_number']) ? $GLOBALS['check_account_number'] : '', 'shipping_method' => $shipping['title'], 'shipping_cost' => $shipping['cost'], 'subtotal' => 0, 'tax' => 0, 'tax_groups' => array(), 'comments' => isset($GLOBALS['comments']) ? $GLOBALS['comments'] : '', 'delivery_transfer' => $cart->info['delivery_transfer'], 'shops_id' => SHOP_ID);
if (isset($GLOBALS[$payment]) && is_object($GLOBALS[$payment])) {
$this->info['payment_method'] = $GLOBALS[$payment]->title;
if (isset($GLOBALS[$payment]->order_status) && is_numeric($GLOBALS[$payment]->order_status) && $GLOBALS[$payment]->order_status > 0) {
$this->info['order_status'] = $GLOBALS[$payment]->order_status;
}
}
$this->customer = array('id' => $customer_id, 'firstname' => $customer_address['customers_firstname'], 'lastname' => $customer_address['customers_lastname'], 'street_address' => $customer_address['entry_street_address'], 'suburb' => $customer_address['entry_suburb'], 'city' => $customer_address['entry_city'], 'postcode' => $customer_address['entry_postcode'], 'state' => tep_not_null($customer_address['entry_state']) ? $customer_address['entry_state'] : $customer_address['zone_name'], 'zone_id' => $customer_address['entry_zone_id'], 'country' => array('id' => $customer_address['countries_id'], 'title' => $customer_address['countries_name'], 'iso_code_2' => $customer_address['countries_iso_code_2'], 'iso_code_3' => $customer_address['countries_iso_code_3']), 'format_id' => $customer_address['address_format_id'], 'telephone' => $customer_address['entry_telephone'], 'email_address' => $customer_address['customers_email_address']);
$this->customer = array_merge($this->customer, $company);
$this->delivery = array('firstname' => $shipping_address['entry_firstname'], 'lastname' => $shipping_address['entry_lastname'], 'street_address' => $shipping_address['entry_street_address'], 'suburb' => $shipping_address['entry_suburb'], 'city' => $shipping_address['entry_city'], 'postcode' => $shipping_address['entry_postcode'], 'state' => tep_not_null($shipping_address['entry_state']) ? $shipping_address['entry_state'] : $shipping_address['zone_name'], 'zone_id' => $shipping_address['entry_zone_id'], 'country' => array('id' => $shipping_address['countries_id'], 'title' => $shipping_address['countries_name'], 'iso_code_2' => $shipping_address['countries_iso_code_2'], 'iso_code_3' => $shipping_address['countries_iso_code_3']), 'country_id' => $shipping_address['entry_country_id'], 'telephone' => $shipping_address['entry_telephone'], 'format_id' => $shipping_address['address_format_id']);
$this->billing = array('firstname' => $billing_address['entry_firstname'], 'lastname' => $billing_address['entry_lastname'], 'street_address' => $billing_address['entry_street_address'], 'suburb' => $billing_address['entry_suburb'], 'city' => $billing_address['entry_city'], 'postcode' => $billing_address['entry_postcode'], 'state' => tep_not_null($billing_address['entry_state']) ? $billing_address['entry_state'] : $billing_address['zone_name'], 'zone_id' => $billing_address['entry_zone_id'], 'country' => array('id' => $billing_address['countries_id'], 'title' => $billing_address['countries_name'], 'iso_code_2' => $billing_address['countries_iso_code_2'], 'iso_code_3' => $billing_address['countries_iso_code_3']), 'country_id' => $billing_address['entry_country_id'], 'telephone' => $billing_address['entry_telephone'], 'format_id' => $billing_address['address_format_id']);
$index = 0;
$products = $cart->get_products();
for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
$this->products[$index] = array('qty' => $products[$i]['quantity'], 'name' => $products[$i]['name'], 'model' => $products[$i]['model'], 'code' => $products[$i]['code'], 'manufacturer' => $products[$i]['manufacturer'], 'year' => $products[$i]['year'], 'type' => $products[$i]['type'], 'periodicity' => $products[$i]['periodicity'], 'periodicity_min' => $products[$i]['periodicity_min'], 'price' => $products[$i]['price'], 'final_price' => $products[$i]['price'], 'tax' => tep_get_tax_rate($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']), 'tax_description' => tep_get_tax_description($products[$i]['tax_class_id'], $tax_address['entry_country_id'], $tax_address['entry_zone_id']), 'weight' => $products[$i]['weight'], 'warranty' => $products[$i]['warranty'], 'id' => $products[$i]['id']);
if (tep_not_null($products[$i]['filename'])) {
$this->products[$index]['filename'] = $products[$i]['filename'];
$this->products[$index]['download_maxdays'] = DOWNLOAD_MAX_DAYS;
$this->products[$index]['download_count'] = DOWNLOAD_MAX_COUNT;
}
$shown_price = tep_add_tax($this->products[$index]['final_price'], $this->products[$index]['tax']) * $this->products[$index]['qty'];
$this->info['subtotal'] += $shown_price;
$products_tax = $this->products[$index]['tax'];
$products_tax_description = $this->products[$index]['tax_description'];
if (DISPLAY_PRICE_WITH_TAX == 'true') {
$this->info['tax'] += $shown_price - $shown_price / ($products_tax < 10 ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax));
if (isset($this->info['tax_groups']["{$products_tax_description}"])) {
$this->info['tax_groups']["{$products_tax_description}"] += $shown_price - $shown_price / ($products_tax < 10 ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax));
} else {
$this->info['tax_groups']["{$products_tax_description}"] = $shown_price - $shown_price / ($products_tax < 10 ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax));
}
} else {
$this->info['tax'] += $products_tax / 100 * $shown_price;
if (isset($this->info['tax_groups']["{$products_tax_description}"])) {
$this->info['tax_groups']["{$products_tax_description}"] += $products_tax / 100 * $shown_price;
} else {
$this->info['tax_groups']["{$products_tax_description}"] = $products_tax / 100 * $shown_price;
}
}
$index++;
}
if (DISPLAY_PRICE_WITH_TAX == 'true') {
$this->info['total'] = $this->info['subtotal'] + $this->info['shipping_cost'];
} else {
$this->info['total'] = $this->info['subtotal'] + $this->info['tax'] + $this->info['shipping_cost'];
}
}
示例12: fixTaxes
function fixTaxes()
{
global $cart, $order, $currencies, $onepage, $customer_id, $customer_country_id, $customer_zone_id;
if ($cart->get_content_type() == 'virtual' && is_numeric($onepage['billing']['country_id'])) {
$taxCountryID = $onepage['billing']['country_id'];
$taxZoneID = $onepage['billing']['zone_id'];
} elseif (is_numeric($onepage['delivery']['country_id'])) {
$taxCountryID = $onepage['delivery']['country_id'];
$taxZoneID = $onepage['delivery']['zone_id'];
} elseif (!tep_session_is_registered('customer_id')) {
if (DISPLAY_PRICE_WITH_TAX == 'false') {
$taxCountryID = 0;
$taxZoneID = 0;
} else {
$taxCountryID = STORE_COUNTRY;
$taxZoneID = STORE_ZONE;
}
} else {
$taxCountryID = $customer_country_id;
$taxZoneID = $customer_zone_id;
}
$products = $cart->get_products();
if (sizeof($products) > 0) {
$order->info['subtotal'] = 0;
$order->info['tax_groups'] = array();
$order->info['tax'] = 0;
//BOF KGT
if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true') {
$valid_products_count = 0;
$order->coupon->applied_discount = array();
}
//EOF KGT
//echo '<pre>';
for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
$taxClassID = $products[$i]['tax_class_id'];
$order->products[$i]['tax'] = tep_get_tax_rate($taxClassID, $taxCountryID, $taxZoneID);
$order->products[$i]['tax_description'] = tep_get_tax_description($taxClassID, $taxCountryID, $taxZoneID);
//BOF KGT
if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true' && is_object($order->coupon) && !empty($order->coupon->coupon)) {
//kgt - discount coupons
$applied_discount = 0;
$discount = $order->coupon->calculate_discount($order->products[$i], $valid_products_count);
if ($discount['applied_discount'] > 0) {
$valid_products_count++;
}
$shown_price = $order->coupon->calculate_shown_price($discount, $order->products[$i]);
//var_dump($shown_price);
$shown_price = $shown_price['actual_shown_price'];
} else {
$shown_price = tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'];
}
$order->info['subtotal'] += $shown_price;
/**************
$shown_price = tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'];
$order->info['subtotal'] += $shown_price;
**************/
//end kgt - discount coupons
//EOF KGT
$products_tax = $order->products[$i]['tax'];
$products_tax_description = $order->products[$i]['tax_description'];
//echo "tax: $products_tax \n";
//echo "tax desc: $products_tax_description \n";
if (DISPLAY_PRICE_WITH_TAX == 'true') {
$order->info['tax'] += $shown_price - $shown_price / ($products_tax < 10 ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax));
if (isset($order->info['tax_groups']["{$products_tax_description}"])) {
$order->info['tax_groups']["{$products_tax_description}"] += $shown_price - $shown_price / ($products_tax < 10 ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax));
} else {
$order->info['tax_groups']["{$products_tax_description}"] = $shown_price - $shown_price / ($products_tax < 10 ? "1.0" . str_replace('.', '', $products_tax) : "1." . str_replace('.', '', $products_tax));
}
} else {
$order->info['tax'] += $products_tax / 100 * $shown_price;
if (isset($order->info['tax_groups']["{$products_tax_description}"])) {
$order->info['tax_groups']["{$products_tax_description}"] += $products_tax / 100 * $shown_price;
} else {
$order->info['tax_groups']["{$products_tax_description}"] = $products_tax / 100 * $shown_price;
}
}
//echo $shown_price."\n";
}
if (DISPLAY_PRICE_WITH_TAX == 'true') {
$order->info['total'] = $order->info['subtotal'] + $order->info['shipping_cost'];
} else {
$order->info['total'] = $order->info['subtotal'] + $order->info['tax'] + $order->info['shipping_cost'];
}
//kgt - discount coupon
if (MODULE_ORDER_TOTAL_DISCOUNT_COUPON_STATUS == 'true' && is_object($order->coupon) && !empty($order->coupon->coupon)) {
//$order->coupon->applied_discount = $applied_discount;
$order->info['total'] = $order->coupon->finalize_discount($order->info);
$onepage['coupon'] = $order->coupon;
}
//end kgt - discount coupon
}
}
示例13:
$pdf->SetX(30);
$pdf->SetFont('Arial', '', 7);
$pdf->MultiCell(25, 6, $order->products[$i]['model'], $border, 'C');
$pdf->SetY($Y_Table_Position);
$pdf->SetX(125);
$pdf->SetFont('Arial', '', 7);
$pdf->MultiCell(20, 6, $currencies->format($order->products[$i]['final_price'], true, $order->info['currency'], $order->info['currency_value']), $border, 'C');
$pdf->SetY($Y_Table_Position);
$pdf->SetX(145);
$pdf->MultiCell(20, 6, $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']), true, $order->info['currency'], $order->info['currency_value']), $border, 'C');
$pdf->SetY($Y_Table_Position);
$pdf->SetX(165);
$pdf->MultiCell(20, 6, $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']), $border, 'C');
$pdf->SetY($Y_Table_Position);
$pdf->SetX(185);
$pdf->MultiCell(18, 6, $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax']) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']), $border, 'C');
$Y_Table_Position += 6;
$attributes = '';
$pdf->SetFont('Arial', 'I', 5);
for ($att = 0; $att < sizeof($order->products[$i]['attributes']); $att++) {
$border = 'LR';
if ($att == sizeof($order->products[$i]['attributes']) - 1) {
$border .= 'B';
}
$pdf->SetY($Y_Table_Position);
$pdf->SetX(20);
//$temp = str_replace(' ', ' ');
$pdf->MultiCell(10, 4, "", $border, 'C');
$pdf->SetY($Y_Table_Position);
$pdf->SetX(55);
$attributes = $order->products[$i]['attributes'][$att]['option'] . " :" . $order->products[$i]['attributes'][$att]['value'];
示例14:
<?php
echo $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true), true, $order->info['currency'], $order->info['currency_value']);
?>
</strong>
</td>
<td class="dataTableContent" align="right" valign="top">
<strong>
<?php
echo $currencies->format($order->products[$i]['final_price'] * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']);
?>
</strong>
</td>
<td class="dataTableContent" align="right" valign="top">
<strong>
<?php
echo $currencies->format(tep_add_tax($order->products[$i]['final_price'], $order->products[$i]['tax'], true) * $order->products[$i]['qty'], true, $order->info['currency'], $order->info['currency_value']);
?>
</strong>
</td>
</tr>
<?php
}
?>
<?php
}
?>
<tr>
<td align="right" colspan="8">
<table border="0" cellspacing="0" cellpadding="2">
<?php
for ($i = 0, $n = sizeof($order->totals); $i < $n; $i++) {
示例15: tep_get_price_with_tax
function tep_get_price_with_tax($products_price, $products_tax, $default_currency, $calculate_currency_value = true)
{
$price = tep_round(tep_add_tax($products_price, $products_tax, true), $default_currency['decimal_places']);
if ($calculate_currency_value) {
$format_string = number_format($price * $default_currency['value'], $default_currency['decimal_places'], $default_currency['decimal_point'], $default_currency['thousands_point']);
} else {
$format_string = number_format($price, $default_currency['decimal_places'], $default_currency['decimal_point'], $default_currency['thousands_point']);
}
return $format_string;
}