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


PHP zen_get_tax_rate函数代码示例

本文整理汇总了PHP中zen_get_tax_rate函数的典型用法代码示例。如果您正苦于以下问题:PHP zen_get_tax_rate函数的具体用法?PHP zen_get_tax_rate怎么用?PHP zen_get_tax_rate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了zen_get_tax_rate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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; ?>">&nbsp;  </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 . '&current_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 . '&current_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">&nbsp;</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


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