本文整理汇总了PHP中zen_get_tax_rate函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_get_tax_rate函数的具体用法?PHP zen_get_tax_rate怎么用?PHP zen_get_tax_rate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了zen_get_tax_rate函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: quote
function quote($method = '')
{
global $order, $shipping_weight;
$calc_weight = $shipping_weight;
$error = false;
$dest_country = $order->delivery['country']['iso_code_2'];
if (defined('MODULE_SHIPPING_CHINAPOSTREGISTERED_BASIS_WEIGHT_FEE') && defined('MODULE_SHIPPING_CHINAPOSTREGISTERED_BASIS_WEIGHT') && defined('MODULE_SHIPPING_CHINAPOSTREGISTERED_REST_WEIGHT_UNIT_FEE') && MODULE_SHIPPING_CHINAPOSTREGISTERED_REST_WEIGHT_UNIT_FEE > 0) {
if ($calc_weight <= MODULE_SHIPPING_CHINAPOSTREGISTERED_BASIS_WEIGHT) {
$shipping_cost = MODULE_SHIPPING_CHINAPOSTREGISTERED_BASIS_WEIGHT_FEE + MODULE_SHIPPING_CHINAPOSTREGISTERED_REGISTER_FEE;
} else {
$calc_weight = $calc_weight - MODULE_SHIPPING_CHINAPOSTREGISTERED_BASIS_WEIGHT;
$shipping_cost = ceil($calc_weight / MODULE_SHIPPING_CHINAPOSTREGISTERED_REST_WEIGHT_UNIT) * MODULE_SHIPPING_CHINAPOSTREGISTERED_REST_WEIGHT_UNIT_FEE;
$shipping_cost = MODULE_SHIPPING_CHINAPOSTREGISTERED_BASIS_WEIGHT_FEE + $shipping_cost + MODULE_SHIPPING_CHINAPOSTREGISTERED_REGISTER_FEE;
}
$shipping_method = MODULE_SHIPPING_CHINAPOSTREGISTERED_TEXT_WAY . ' ' . $dest_country . ' (' . number_format($shipping_weight, 2) . MODULE_SHIPPING_CHINAPOSTREGISTERED_TEXT_UNITS . ') ';
//modified by john 2010-06-30
//for better calculate with currency
$shipping_cost = $shipping_cost / (defined('MODULE_SHIPPING_CHINAPOSTREGISTERED_EXCHANGE_RATE') ? MODULE_SHIPPING_CHINAPOSTREGISTERED_EXCHANGE_RATE : 1);
}
if ($shipping_weight > MODULE_SHIPPING_CHINAPOSTREGISTERED_BEYOND_WEIGHTLIMIT) {
$error = true;
}
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_CHINAPOSTREGISTERED_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => $shipping_method, 'cost' => $shipping_cost)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) {
$this->quotes['icon'] = zen_image($this->icon, $this->title);
}
if ($error == true) {
$this->quotes['error'] = MODULE_SHIPPING_CHINAPOSTREGISTERED_BEYOND_WEIGHTLIMIT_TEXT;
}
return $this->quotes;
}
开发者ID:andychang88,项目名称:daddy-store.com,代码行数:34,代码来源:chinapostregistered.php
示例2: getCartContents
/**
* @param $order
* @return string
*/
public static function getCartContents($order)
{
$countLines = 1;
$shipping = number_format($order->info['shipping_cost'], 2, '.', '');
$shippingtax = number_format($order->info['shipping_tax'], 2, '.', '');
$totalshipping = number_format($shipping + $shippingtax, 2, '.', '');
$shippingStr = ":Shipping:---:" . $shipping . ":" . $shippingtax . ":" . $totalshipping . ":" . $totalshipping;
$products = $_SESSION['cart']->get_products();
$productLines = '';
for ($i = 0, $n = sizeof($products); $i < $n; $i++) {
$desc = str_replace(":", "", $order->products[$i]['name']);
$qty = $order->products[$i]['qty'];
$price = $order->products[$i]['price'] + $_SESSION['cart']->attributes_price($products[$i]['id']);
$tax = $price / 100 * zen_get_tax_rate($products[$i]['tax_class_id']);
$tax = number_format($tax, 2, '.', '');
$finalPrice = $price + $tax;
$finalPrice = number_format($finalPrice, 2, '.', '');
$lineTotal = $qty * $finalPrice;
$lineTotal = number_format($lineTotal, 2, '.', '');
$line = ":" . $desc . ":" . $qty . ":" . $price . ":" . $tax . ":" . $finalPrice . ":" . $lineTotal;
$productLines .= $line;
$countLines++;
}
return $countLines . $productLines . $shippingStr;
}
开发者ID:zencart,项目名称:sagepay,代码行数:29,代码来源:SagepayBasket.php
示例3: quote
function quote($method = '')
{
global $order, $shipping_weight;
$error = false;
$dest_country = $order->delivery['country']['iso_code_2'];
if (defined('MODULE_SHIPPING_HKPOSTREGISTERED_COST_UNIT') && MODULE_SHIPPING_HKPOSTREGISTERED_COST_UNIT > 0) {
//hkpost weight as gram g.
$shipping_cost = MODULE_SHIPPING_HKPOSTREGISTERED_COST_UNIT * $shipping_weight;
if (defined('MODULE_SHIPPING_HKPOSTREGISTERED_HANDLE_FEE') && MODULE_SHIPPING_HKPOSTREGISTERED_HANDLE_FEE > 0) {
$shipping_cost += MODULE_SHIPPING_HKPOSTREGISTERED_HANDLE_FEE;
}
//$shipping_method = MODULE_SHIPPING_HKPOSTREGISTERED_TEXT_WAY . ' ' . $dest_country . ' ('.number_format($shipping_weight,2).MODULE_SHIPPING_HKPOSTREGISTERED_TEXT_UNITS.')';
$shipping_method = MODULE_SHIPPING_HKPOSTREGISTERED_TEXT_WAY;
//############################for better calculate with currency#########################
//modified by john 2010-06-30 2/3
$shipping_cost = $shipping_cost / (defined('MODULE_SHIPPING_HKPOSTREGISTERED_EXCHANGE_RATE') ? MODULE_SHIPPING_HKPOSTREGISTERED_EXCHANGE_RATE : 1);
}
if ($shipping_weight > MODULE_SHIPPING_HKPOSTREGISTERED_BEYOND_WEIGHTLIMIT) {
$error = true;
}
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_HKPOSTREGISTERED_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => $shipping_method, 'cost' => $shipping_cost)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) {
$this->quotes['icon'] = zen_image($this->icon, $this->title);
}
if ($error == true) {
$this->quotes['error'] = MODULE_SHIPPING_HKPOSTREGISTERED_BEYOND_WEIGHTLIMIT_TEXT;
}
return $this->quotes;
}
开发者ID:andychang88,项目名称:daddy-store.com,代码行数:32,代码来源:hkpostregistered.php
示例4: quote
function quote($method = '')
{
global $order;
if ($this->enabled) {
$excluded_array = explode(',', MODULE_SHIPPING_PREFERRED_SHIPPING_EXCLUDED_PRODUCTS);
$products_in_cart_array = explode(',', $_SESSION['cart']->get_product_id_list());
echo var_dump($products_in_cart_array);
foreach ($products_in_cart_array as $product_in_cart) {
$base_product_in_cart = substr($product_in_cart, 0, strpos($product_in_cart, ':'));
if (in_array($base_product_in_cart, $excluded_array)) {
$this->enabled = false;
}
}
if ($_SESSION['cart']->show_total() < MODULE_SHIPPING_PREFERRED_SHIPPING_MIN_ORDER) {
$this->enabled = false;
}
}
if ($this->enabled) {
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_PREFERRED_SHIPPING_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_PREFERRED_SHIPPING_TEXT_WAY, 'cost' => '0.00')));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) {
$this->quotes['icon'] = zen_image($this->icon, $this->title);
}
}
return $this->quotes;
}
开发者ID:bislewl,项目名称:zen_preferred_shipping,代码行数:28,代码来源:preferredshipping.php
示例5: quote
function quote($pShipHash = array())
{
global $order, $currencies;
$this->quotes['id'] = $this->code;
$this->quotes['module'] = tra('SuperSaver Shipping');
$this->quotes['icon'] = $this->icon;
$min = MODULE_SHIPPING_SUPERSAVER_MIN;
$max = MODULE_SHIPPING_SUPERSAVER_MAX;
if (!empty($min) && $order->subtotal < MODULE_SHIPPING_SUPERSAVER_MIN) {
$this->quotes['error'] = tra('You must spend at least ' . $currencies->format(MODULE_SHIPPING_SUPERSAVER_MIN) . ' to get SuperSaver Shipping.') . ' <a href="' . zen_href_link(FILENAME_SHOPPING_CART) . '">' . tra('Update Cart') . '</a>';
} elseif (!empty($max) && $order->subtotal > MODULE_SHIPPING_SUPERSAVER_MAX) {
// no quote for you!
$this->quotes['error'] = tra('SuperSaver Shipping only applies to orders up to ' . $currencies->format(MODULE_SHIPPING_SUPERSAVER_MAX)) . ' <a href="' . zen_href_link(FILENAME_SHOPPING_CART) . '">' . tra('Update Cart') . '</a>';
} else {
$this->quotes['note'] = tra(MODULE_SHIPPING_SUPERSAVER_DESC);
if (SHIPPING_ORIGIN_COUNTRY == $order->delivery['country']['countries_id'] && MODULE_SHIPPING_SUPERSAVER_DOMESTIC == 'True') {
$desc = tra(MODULE_SHIPPING_SUPERSAVER_DESC) . ' ' . tra(MODULE_SHIPPING_SUPERSAVER_DOMESTIC_DESC);
$this->quotes['methods'] = array(array('id' => $this->code, 'title' => trim($desc), 'code' => 'supersaver', 'cost' => MODULE_SHIPPING_SUPERSAVER_DOMESTIC_COST + MODULE_SHIPPING_SUPERSAVER_HANDLING));
} elseif (MODULE_SHIPPING_SUPERSAVER_INTL == 'True') {
$desc = tra(MODULE_SHIPPING_SUPERSAVER_DESC) . ' ' . tra(MODULE_SHIPPING_SUPERSAVER_INTL_DESC);
$this->quotes['methods'] = array(array('id' => $this->code, 'title' => trim($desc), 'code' => 'supersaverintl', 'cost' => MODULE_SHIPPING_SUPERSAVER_INTL_COST + MODULE_SHIPPING_SUPERSAVER_HANDLING));
}
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['countries_id'], $order->delivery['zone_id']);
}
}
return $this->quotes;
}
开发者ID:bitweaver,项目名称:commerce,代码行数:28,代码来源:supersaver.php
示例6: convert_product_attributes_result
function convert_product_attributes_result($attributes_values, $load_option_name = true, $can_operate = false)
{
if ($load_option_name) {
$attributes_values->fields['products_options_name'] = zen_options_name($attributes_values->fields['options_id']);
$attributes_values->fields['products_options_values_name'] = zen_values_name($attributes_values->fields['options_values_id']);
}
$attributes_values->fields['products_display_price'] = $attributes_values->fields['price_prefix'] . $attributes_values->fields['options_values_price'];
$attributes_values->fields['products_attributes_display_weight'] = $attributes_values->fields['products_attributes_weight_prefix'] . $attributes_values->fields['products_attributes_weight'];
require_once DIR_WS_CLASSES . 'currencies.php';
$currencies = new currencies();
$attributes_price_final = zen_get_attributes_price_final($attributes_values->fields["products_attributes_id"], 1, $attributes_values, 'false');
$attributes_price_final_value = $attributes_price_final;
$attributes_price_final = $currencies->display_price($attributes_price_final, zen_get_tax_rate(1), 1);
$attributes_price_final_onetime = zen_get_attributes_price_final_onetime($attributes_values->fields["products_attributes_id"], 1, $attributes_values);
$attributes_price_final_onetime = $currencies->display_price($attributes_price_final_onetime, zen_get_tax_rate(1), 1);
$new_attributes_price = '';
if ($attributes_values->fields["attributes_discounted"]) {
$new_attributes_price = zen_get_attributes_price_final($attributes_values->fields["products_attributes_id"], 1, '', 'false');
$new_attributes_price = zen_get_discount_calc($attributes_values->fields['products_id'], true, $new_attributes_price);
if ($new_attributes_price != $attributes_price_final_value) {
$new_attributes_price = '|' . $currencies->display_price($new_attributes_price, zen_get_tax_rate(1), 1);
} else {
$new_attributes_price = '';
}
}
$attributes_values->fields['attributes_display_price_final'] = $attributes_price_final . $new_attributes_price . ' ' . $attributes_price_final_onetime;
// status
$attributes_values->fields['products_status'] = "";
foreach ($this->statuses as $type => $icon_info) {
$attributes_values->fields['products_status'] .= self::make_status_link($attributes_values->fields, $type, $icon_info['color'], $icon_info['alt'], $can_operate);
}
return $attributes_values->fields;
}
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:33,代码来源:easy_admin_products_attribute_model.php
示例7: quote
function quote($pShipHash = array())
{
global $order;
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_STOREPICKUP_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'code' => $this->code, 'title' => MODULE_SHIPPING_STOREPICKUP_TEXT_WAY, 'cost' => MODULE_SHIPPING_STOREPICKUP_COST)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['countries_id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) {
$this->quotes['icon'] = $this->icon;
}
return $this->quotes;
}
开发者ID:bitweaver,项目名称:commerce,代码行数:12,代码来源:storepickup.php
示例8: quote
function quote($method = '')
{
global $order;
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_FREESHIPPER_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_FREESHIPPER_TEXT_WAY, 'cost' => MODULE_SHIPPING_FREESHIPPER_COST + MODULE_SHIPPING_FREESHIPPER_HANDLING)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) {
$this->quotes['icon'] = zen_image($this->icon, $this->title);
}
return $this->quotes;
}
开发者ID:andychang88,项目名称:daddy-store.com,代码行数:12,代码来源:freeshipper.php
示例9: quote
function quote($method = '')
{
global $order, $total_count;
// adjusted count for free shipping
$item_total_count = $total_count - $_SESSION['cart']->free_shipping_items();
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_ITEM_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_ITEM_TEXT_WAY, 'cost' => MODULE_SHIPPING_ITEM_COST * $item_total_count + MODULE_SHIPPING_ITEM_HANDLING)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) {
$this->quotes['icon'] = zen_image($this->icon, $this->title);
}
return $this->quotes;
}
开发者ID:wwxgitcat,项目名称:zencart_v1.0,代码行数:14,代码来源:item.php
示例10: quote
function quote($pShipHash = array())
{
global $order, $total_count;
// adjusted count for free shipping
// $total_count = $total_count - $gBitCustomer->mCart->in_cart_check('product_is_free','1');
// $total_count = $total_count - $gBitCustomer->mCart->in_cart_check('product_is_always_free_ship','1');
$total_count = $total_count - $gBitCustomer->mCart->free_shipping_items();
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_ITEM_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => MODULE_SHIPPING_ITEM_TEXT_WAY, 'cost' => MODULE_SHIPPING_ITEM_COST * $total_count + MODULE_SHIPPING_ITEM_HANDLING)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['countries_id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) {
$this->quotes['icon'] = $this->icon;
}
return $this->quotes;
}
开发者ID:bitweaver,项目名称:commerce,代码行数:16,代码来源:item.php
示例11: quote
function quote($method = '')
{
global $order, $shipping_weight;
$calc_weight = $shipping_weight;
$error = false;
$dest_country = $order->delivery['country']['iso_code_2'];
if (defined('MODULE_SHIPPING_EMS_BASIS_WEIGHT_FEE') && defined('MODULE_SHIPPING_EMS_BASIS_WEIGHT') && defined('MODULE_SHIPPING_EMS_REST_WEIGHT_UNIT_FEE') && MODULE_SHIPPING_EMS_REST_WEIGHT_UNIT_FEE > 0) {
if ($calc_weight <= MODULE_SHIPPING_EMS_BASIS_WEIGHT) {
$shipping_cost = MODULE_SHIPPING_EMS_BASIS_WEIGHT_FEE + MODULE_SHIPPING_EMS_HANDLING_FEE;
} else {
$calc_weight = $calc_weight - MODULE_SHIPPING_EMS_BASIS_WEIGHT;
$shipping_cost = ceil($calc_weight / MODULE_SHIPPING_EMS_REST_WEIGHT_UNIT) * MODULE_SHIPPING_EMS_REST_WEIGHT_UNIT_FEE;
$shipping_cost = MODULE_SHIPPING_EMS_BASIS_WEIGHT_FEE + $shipping_cost + MODULE_SHIPPING_EMS_HANDLING_FEE;
}
/*$shipping_method = MODULE_SHIPPING_EMS_TEXT_WAY . ' ' .
$dest_country . ' ('.number_format($shipping_weight,2).MODULE_SHIPPING_EMS_TEXT_UNITS.') ';*/
$shipping_method = MODULE_SHIPPING_EMS_TEXT_WAY;
//############################for better calculate with currency#########################
//modified by john 2010-06-30 1/3
$shipping_cost = $shipping_cost / (defined('MODULE_SHIPPING_EMS_EXCHANGE_RATE') ? MODULE_SHIPPING_EMS_EXCHANGE_RATE : 1);
}
if (defined('MODULE_SHIPPING_EMS_ENABLED_COUNTRIES')) {
$enable_countries = split('[,]', MODULE_SHIPPING_EMS_ENABLED_COUNTRIES);
if (is_array($enable_countries) && !in_array($dest_country, $enable_countries)) {
$error = true;
}
}
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_EMS_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => $shipping_method, 'cost' => $shipping_cost)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) {
$this->quotes['icon'] = zen_image($this->icon, $this->title);
}
if ($error == true) {
$this->quotes['error'] = MODULE_SHIPPING_EMS_NOT_DISPATCH_TO_TEXT . ' ' . $dest_country;
}
return $this->quotes;
}
开发者ID:andychang88,项目名称:daddy-store.com,代码行数:39,代码来源:ems.php
示例12: quote
function quote($method = '')
{
global $order, $shipping_weight, $shipping_num_boxes;
$dest_country = $order->delivery['country']['iso_code_2'];
$dest_zone = 0;
$error = false;
for ($i = 1; $i <= $this->num_zones; $i++) {
$countries_table = constant('MODULE_SHIPPING_ZONES_COUNTRIES_' . $i);
$country_zones = split("[,]", $countries_table);
if (in_array($dest_country, $country_zones)) {
$dest_zone = $i;
break;
}
}
if ($dest_zone == 0) {
$error = true;
} else {
$shipping = -1;
$zones_cost = constant('MODULE_SHIPPING_ZONES_COST_' . $dest_zone);
$zones_table = split("[:,]", $zones_cost);
$size = sizeof($zones_table);
for ($i = 0; $i < $size; $i += 2) {
if (MODULE_SHIPPING_ZONES_METHOD == 'Weight') {
if ($shipping_weight <= $zones_table[$i]) {
$shipping = $zones_table[$i + 1];
switch (SHIPPING_BOX_WEIGHT_DISPLAY) {
case 0:
$show_box_weight = '';
break;
case 1:
$show_box_weight = ' (' . $shipping_num_boxes . ' ' . TEXT_SHIPPING_BOXES . ')';
break;
case 2:
$show_box_weight = ' (' . number_format($shipping_weight * $shipping_num_boxes, 2) . MODULE_SHIPPING_ZONES_TEXT_UNITS . ')';
break;
default:
$show_box_weight = ' (' . $shipping_num_boxes . ' x ' . number_format($shipping_weight, 2) . MODULE_SHIPPING_ZONES_TEXT_UNITS . ')';
break;
}
// $shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country . (SHIPPING_BOX_WEIGHT_DISPLAY >= 2 ? ' : ' . $shipping_weight . ' ' . MODULE_SHIPPING_ZONES_TEXT_UNITS : '');
$shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country . $show_box_weight;
break;
}
} else {
// shipping adjustment
if ($_SESSION['cart']->show_total() - $_SESSION['cart']->free_shipping_prices() <= $zones_table[$i]) {
$shipping = $zones_table[$i + 1];
$shipping_method = MODULE_SHIPPING_ZONES_TEXT_WAY . ' ' . $dest_country;
break;
}
}
}
if ($shipping == -1) {
$shipping_cost = 0;
$shipping_method = MODULE_SHIPPING_ZONES_UNDEFINED_RATE;
} else {
if (MODULE_SHIPPING_ZONES_METHOD == 'Weight') {
$shipping_cost = $shipping * $shipping_num_boxes + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);
} else {
// don't charge per box when done by Price
$shipping_cost = $shipping + constant('MODULE_SHIPPING_ZONES_HANDLING_' . $dest_zone);
}
}
}
$this->quotes = array('id' => $this->code, 'module' => MODULE_SHIPPING_ZONES_TEXT_TITLE, 'methods' => array(array('id' => $this->code, 'title' => $shipping_method, 'cost' => $shipping_cost)));
if ($this->tax_class > 0) {
$this->quotes['tax'] = zen_get_tax_rate($this->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
}
if (zen_not_null($this->icon)) {
$this->quotes['icon'] = zen_image($this->icon, $this->title);
}
if ($error == true) {
$this->quotes['error'] = MODULE_SHIPPING_ZONES_INVALID_ZONE;
}
return $this->quotes;
}
开发者ID:homework-bazaar,项目名称:zencart-sugu,代码行数:76,代码来源:zones.php
示例13: zen_href_link
<td><?php
echo $quantityDiscount['show_qty'];
?>
</td>
<?php
if (!isset($_SESSION['customer_id']) && $key + 1 > SHOW_PRICE_QTY_MAX_GROUP) {
?>
<td><a rel="nofollow" href="<?php
echo zen_href_link(FILENAME_LOGIN, '', 'SSL');
?>
">Login</a></td>
<?php
} else {
?>
<td><?php
echo $currencies->display_price($quantityDiscount['discounted_price'], zen_get_tax_rate($products_tax_class_id));
?>
</td>
<?php
}
?>
</tr>
<?php
/*$disc_cnt++;
if ($discount_col_cnt == $disc_cnt && !($key == sizeof($quantityDiscount))) {
$disc_cnt=0;
}*/
}
/*if ($disc_cnt < $columnCount) {
?>
<td align="center" colspan="<?php echo ($columnCount+1 - $disc_cnt)+1; ?>"> </td>
开发者ID:andychang88,项目名称:daddy-store.com,代码行数:31,代码来源:tpl_modules_products_quantity_discounts.php
示例14: echo
</td>
<td class="smallText" align="center"><?php
echo ($attributes_values->fields["attributes_required"] == '0' ? '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=set_flag_attributes_required' . '&attributes_id=' . $attributes_values->fields["products_attributes_id"] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '¤t_category_id=' . $current_category_id) . '" onClick="divertClick(this.href);return false;">' . zen_image(DIR_WS_IMAGES . 'icon_red_off.gif', LEGEND_ATTRIBUTES_REQUIRED) . '</a>' : '<a href="' . zen_href_link(FILENAME_ATTRIBUTES_CONTROLLER, 'action=set_flag_attributes_required' . '&attributes_id=' . $attributes_values->fields["products_attributes_id"] . (isset($_GET['option_page']) ? '&option_page=' . $_GET['option_page'] . '&' : '') . (isset($_GET['value_page']) ? '&value_page=' . $_GET['value_page'] . '&' : '') . (isset($_GET['attribute_page']) ? '&attribute_page=' . $_GET['attribute_page'] : '') . '&products_filter=' . $products_filter . '¤t_category_id=' . $current_category_id) . '" onClick="divertClick(this.href);return false;">' . zen_image(DIR_WS_IMAGES . 'icon_red_on.gif', LEGEND_ATTRIBUTES_REQUIRED)) . '</a>';
?>
</td>
</tr>
</table>
</td>
<?php
}
$new_attributes_price = '';
if ($attributes_values->fields["attributes_discounted"]) {
$new_attributes_price = zen_get_attributes_price_final($attributes_values->fields["products_attributes_id"], 1, '', 'false');
$new_attributes_price = zen_get_discount_calc($products_filter, true, $new_attributes_price);
if ($new_attributes_price != $attributes_price_final_value) {
$new_attributes_price = '|' . $currencies->display_price($new_attributes_price, zen_get_tax_rate($product_check->fields['products_tax_class_id']), 1);
} else {
$new_attributes_price = '';
}
}
?>
<td align="right" class="smallText"><?php
echo $attributes_price_final . $new_attributes_price . ' ' . $attributes_price_final_onetime;
?>
</td>
<?php
if ($action != '') {
?>
<td width='120' align="center" class="smallText"> </td>
<?php
} else {
开发者ID:quangn92,项目名称:visualyou,代码行数:31,代码来源:attributes_controller.php
示例15: _build_attributes_array
function _build_attributes_array($build_stocked, $build_nonstocked)
{
global $languages_id;
global $currencies;
global $cart;
global $db;
if (!($build_stocked | $build_nonstocked)) {
return null;
}
if ($build_stocked && $build_nonstocked) {
$stocked_where = "";
} elseif ($build_stocked) {
$stocked_where = "and popt.products_options_track_stock = 1";
} elseif ($build_nonstocked) {
$stocked_where = "and popt.products_options_track_stock = 0";
}
$products_options_name_query = "select distinct popt.products_options_id, popt.products_options_name, popt.products_options_track_stock, popt.products_options_images_style, popt.products_options_type from " . TABLE_PRODUCTS_OPTIONS . " popt, " . TABLE_PRODUCTS_ATTRIBUTES . " patrib where patrib.products_id = :products_id: and popt.products_options_id = patrib.options_id and popt.language_id = :languages_id: :stocked_where: order by popt.products_options_sort_order";
$products_options_name_query = $db->bindVars($products_options_name_query, ':products_id:', $this->products_id, 'integer');
$products_options_name_query = $db->bindVars($products_options_name_query, ':languages_id:', $_SESSION['languages_id'], 'integer');
$products_options_name_query = $db->bindVars($products_options_name_query, ':stocked_where:', $stocked_where, 'passthru');
$products_options_name = $db->Execute($products_options_name_query);
$attributes = array();
while (!$products_options_name->EOF) {
$products_options_array = array();
$products_options_query = "select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.price_prefix from " . TABLE_PRODUCTS_ATTRIBUTES . " pa, " . TABLE_PRODUCTS_OPTIONS_VALUES . " pov where pa.products_id = :products_id: and pa.options_id = :products_options_id: and pa.options_values_id = pov.products_options_values_id and pov.language_id = :languages_id: order by pa.products_options_sort_order";
$products_options_query = $db->bindVars($products_options_query, ':products_id:', $this->products_id, 'integer');
$products_options_query = $db->bindVars($products_options_query, ':languages_id:', $_SESSION['languages_id'], 'integer');
$products_options_query = $db->bindVars($products_options_query, ':products_options_id:', $products_options_name->fields['products_options_id'], 'integer');
$products_options = $db->Execute($products_options_query);
while (!$products_options->EOF) {
/**** AGF - add logic to format colours ******/
$value_name = $products_options->fields['products_options_values_name'];
//if ( $products_options_name['products_options_name'] = 'Color' ) {
// $value_name="<span class=\"col" . $value_name . "\">" . $value_name . "</span>";
//}
$products_options_array[] = array('id' => $products_options->fields['products_options_values_id'], 'text' => $value_name);
/**** AGF - end of new logic ******/
// AGF commented out +/- amount to show actual price
if ($products_options->fields['options_values_price'] != '0') {
$products_options_array[sizeof($products_options_array) - 1]['text'] .= ' (' . $products_options->fields['price_prefix'] . $currencies->display_price($products_options->fields['options_values_price'], zen_get_tax_rate($this->products_tax_class_id)) . ')';
}
/// Start of Changes- display actual prices instead of +/- Actual Price Pull Down v1.2.3a
$new_price ? $original_price = $new_price : ($original_price = $this->products_original_price);
//// check if set special price note $this variable
$option_price = $products_options->fields['options_values_price'];
if ($products_options->fields['price_prefix'] == "-") {
$show_price = 0.0 + $original_price - $option_price;
// force float (in case) using the 0.0;
} else {
$show_price = 0.0 + $original_price + $option_price;
// force float (in case) using the 0.0;
}
$products_options_array[sizeof($products_options_array) - 1]['text'] .= ' ';
// note $this variable //HW: THIS WAS BROKEN - tax class ID was being used as the tax rate.. so a fixed 8 percent in my case.
// End Of MOD
$products_options->MoveNext();
}
if (isset($_GET['products_id']) && zen_not_null($_GET['products_id']) && isset($_SESSION['cart']->contents[$_GET['products_id']]['attributes'][$products_options_name->fields['products_options_id']])) {
$selected = $_SESSION['cart']->contents[$_GET['products_id']]['attributes'][$products_options_name->fields['products_options_id']];
} else {
$selected = 0;
}
$attributes[] = array('oid' => $products_options_name->fields['products_options_id'], 'oname' => $products_options_name->fields['products_options_name'], 'oimgstyle' => $products_options_name->fields['products_options_images_style'], 'ovals' => $products_options_array, 'otype' => $products_options_name->fields['products_options_type'], 'default' => $selected);
$products_options_name->MoveNext();
}
return $attributes;
}
开发者ID:badarac,项目名称:stock_by_attribute_1.5.4,代码行数:67,代码来源:pad_base.php
示例16: getLineItemDetails
/**
* Prepare subtotal and line-item detail content to send to PayPal
*/
function getLineItemDetails()
{
global $order, $currencies, $order_totals, $order_total_modules;
$optionsST = array();
$optionsLI = array();
$onetimeSum = 0;
$onetimeTax = 0;
$creditsApplied = 0;
$creditsTax_applied = 0;
$sumOfLineItems = 0;
$sumOfLineTax = 0;
// prepare subtotals
for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) {
if ($order_totals[$i]['code'] == 'ot_subtotal') {
$optionsST['ITEMAMT'] = round($order_totals[$i]['value'], 2);
}
if ($order_totals[$i]['code'] == 'ot_tax') {
$optionsST['TAXAMT'] = round($order_totals[$i]['value'], 2);
}
if ($order_totals[$i]['code'] == 'ot_shipping') {
$optionsST['SHIPPINGAMT'] = round($order_totals[$i]['value'], 2);
}
if ($order_totals[$i]['code'] == 'ot_total') {
$optionsST['AMT'] = round($order_totals[$i]['value'], 2);
}
$optionsST['HANDLINGAMT'] = 0;
global ${$order_totals[$i]['code']};
if (isset(${$order_totals[$i]['code']}->credit_class) && ${$order_totals[$i]['code']}->credit_class == true) {
$creditsApplied += round($order_totals[$i]['value'], 2);
}
// treat all other OT's as if they're related to handling fees
if (!in_array($order_totals[$i]['code'], array('ot_total', 'ot_subtotal', 'ot_tax', 'ot_shipping')) && !(isset(${$order_totals[$i]['code']}->credit_class) && ${$order_totals[$i]['code']}->credit_class == true)) {
$optionsST['HANDLINGAMT'] += $order_totals[$i]['value'];
}
}
// Move shipping tax amount from Tax subtotal into Shipping subtotal for submission to PayPal
$module = substr($_SESSION['shipping']['id'], 0, strpos($_SESSION['shipping']['id'], '_'));
if (zen_not_null($order->info['shipping_method'])) {
if ($GLOBALS[$module]->tax_class > 0) {
$shipping_tax_basis = !isset($GLOBALS[$module]->tax_basis) ? STORE_SHIPPING_TAX_BASIS : $GLOBALS[$module]->tax_basis;
$shippingOnBilling = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->billing['country']['id'], $order->billing['zone_id']);
$shippingOnDelivery = zen_get_tax_rate($GLOBALS[$module]->tax_class, $order->delivery['country']['id'], $order->delivery['zone_id']);
if ($shipping_tax_basis == 'Billing') {
$shipping_tax = $shippingOnBilling;
} elseif ($shipping_tax_basis == 'Shipping') {
$shipping_tax = $shippingOnDelivery;
} else {
if (STORE_ZONE == $order->billing['zone_id']) {
$shipping_tax = $shippingOnBilling;
} elseif (STORE_ZONE == $order->delivery['zone_id']) {
$shipping_tax = $shippingOnDelivery;
} else {
$shipping_tax = 0;
}
}
$taxAdjustmentForShipping = zen_calculate_tax($order->info['shipping_cost'], $shipping_tax);
$optionsST['SHIPPINGAMT'] += $taxAdjustmentForShipping;
$optionsST['TAXAMT'] -= $taxAdjustmentForShipping;
}
}
// loop thru all products to display quantity and price. Appends *** if out-of-stock.
for ($i = 0, $n = sizeof($order->products), $k = 0; $i < $n; $i++, $k++) {
$optionsLI["L_NUMBER{$k}"] = $order->products[$i]['model'];
$optionsLI["L_QTY{$k}"] = (int) $order->products[$i]['qty'];
$optionsLI["L_NAME{$k}"] = $order->products[$i]['name'];
$optionsLI["L_NAME{$k}"] .= zen_get_products_stock($order->products[$i]['id']) - $order->products[$i]['qty'] < 0 ? STOCK_MARK_PRODUCT_OUT_OF_STOCK : '';
// if there are attributes, loop thru them and add to description
if (isset($order->products[$i]['attributes']) && sizeof($order->products[$i]['attributes']) > 0) {
for ($j = 0, $n2 = sizeof($order->products[$i]['attributes']); $j < $n2; $j++) {
$optionsLI["L_NAME{$k}"] .= "\n " . $order->products[$i]['attributes'][$j]['option'] . ': ' . $order->products[$i]['attributes'][$j]['value'];
}
// end loop
}
// endif attribute-info
$optionsLI["L_AMT{$k}"] = $order->products[$i]['final_price'];
$optionsLI["L_TAXAMT{$k}"] = zen_calculate_tax($order->products[$i]['final_price'], $order->products[$i]['tax']);
// track one-time charges
if ($order->products[$i]['onetime_charges'] != 0) {
$onetimeSum += $order->products[$i]['onetime_charges'];
$onetimeTax += zen_calculate_tax($order->products[$i]['onetime_charges'], $order->products[$i]['tax']);
}
// Replace & and = with * if found.
$optionsLI["L_NAME{$k}"] = str_replace(array('&', '='), '*', $optionsLI["L_NAME{$k}"]);
$optionsLI["L_NAME{$k}"] = zen_clean_html($optionsLI["L_NAME{$k}"], 'strong');
// reformat properly
$optionsLI["L_NUMBER{$k}"] = substr($optionsLI["L_NUMBER{$k}"], 0, 127);
$optionsLI["L_NAME{$k}"] = substr($optionsLI["L_NAME{$k}"], 0, 127);
$optionsLI["L_AMT{$k}"] = $optionsLI["L_AMT{$k}"];
$optionsLI["L_TAXAMT{$k}"] = round($optionsLI["L_TAXAMT{$k}"], 2);
}
// end for loopthru all products
if ($onetimeSum > 0) {
$i++;
$k++;
$optionsLI["L_NUMBER{$k}"] = $k;
$optionsLI["L_NAME{$k}"] = 'One-Time Charges';
$optionsLI["L_AMT{$k}"] = $onetimeSum;
//.........这里部分代码省略.........
开发者ID:BGCX067,项目名称:ez-commerce-svn-to-git,代码行数:101,代码来源:paypalwpp.php
示例17: getLineItemDetails
/**
* Prepare subtotal and line-item detail content to send to PayPal
*/
function getLineItemDetails($restrictedCurrency)
{
global $order, $currencies, $order_totals, $order_total_modules;
// if not default currency, do not send subtotals or line-item details
if (DEFAULT_CURRENCY != $order->info['currency'] || $restrictedCurrency != DEFAULT_CURRENCY) {
$this->zcLog('getLineItemDetails 1', 'Not using default currency. Thus, no line-item details can be submitted.');
return array();
}
if ($currencies->currencies[$_SESSION['currency']]['value'] != 1 || $currencies->currencies[$order->info['currency']]['value'] != 1) {
$this->zcLog('getLineItemDetails 2', 'currency val not equal to 1.0000 - cannot proceed without coping with currency conversions. Aborting line-item details.');
return array();
}
$optionsST = array();
$optionsLI = array();
$optionsNB = array();
$numberOfLineItemsProcessed = 0;
$creditsApplied = 0;
$surcharges = 0;
$sumOfLineItems = 0;
$sumOfLineTax = 0;
$optionsST['AMT'] = 0;
$optionsST['ITEMAMT'] = 0;
$optionsST['TAXAMT'] = 0;
$optionsST['SHIPPINGAMT'] = 0;
$optionsST['SHIPDISCAMT'] = 0;
$optionsST['HANDLINGAMT'] = 0;
$optionsST['INSURANCEAMT'] = 0;
$flagSubtotalsUnknownYet = true;
$subTotalLI = 0;
$subTotalTax = 0;
$subTotalShipping = 0;
$subtotalPRE = array('no data');
$discountProblemsFlag = FALSE;
$flag_treat_as_partial = FALSE;
if (sizeof($order_totals)) {
// prepare subtotals
for ($i = 0, $n = sizeof($order_totals); $i < $n; $i++) {
if ($order_totals[$i]['code'] == '') {
continue;
}
if (in_array($order_totals[$i]['code'], array('ot_total', 'ot_subtotal', 'ot_tax', 'ot_shipping')) || strstr($order_totals[$i]['code'], 'insurance')) {
if ($order_totals[$i]['code'] == 'ot_shipping') {
$optionsST['SHIPPINGAMT'] = round($order_totals[$i]['value'], 2);
}
if ($order_totals[$i]['code'] == 'ot_total') {
$optionsST['AMT'] = round($order_totals[$i]['value'], 2);
}
if ($order_totals[$i]['code'] == 'ot_tax') {
$optionsST['TAXAMT'] = round($order_totals[$i]['value'], 2);
}
if ($order_totals[$i]['code'] == 'ot_subtotal') {
$optionsST['IT
|
请发表评论