本文整理汇总了PHP中mslib_fe::taxDecimalCrop方法的典型用法代码示例。如果您正苦于以下问题:PHP mslib_fe::taxDecimalCrop方法的具体用法?PHP mslib_fe::taxDecimalCrop怎么用?PHP mslib_fe::taxDecimalCrop使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mslib_fe
的用法示例。
在下文中一共展示了mslib_fe::taxDecimalCrop方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: implode
if (!count($plugins_extra_tab['tabs_header']) && !count($plugins_extra_tab['tabs_content'])) {
$subpartArray['###LABEL_EXTRA_PLUGIN_TABS###'] = '';
$subpartArray['###CONTENT_EXTRA_PLUGIN_TABS###'] = '';
} else {
$subpartArray['###LABEL_EXTRA_PLUGIN_TABS###'] = implode("\n", $plugins_extra_tab['tabs_header']);
$subpartArray['###CONTENT_EXTRA_PLUGIN_TABS###'] = implode("\n", $plugins_extra_tab['tabs_content']);
}
$subpartArray['###ADMIN_LABEL_JS_PLEASE_SELECT_CATEGORY_FOR_THIS_PRODUCT###'] = $this->pi_getLL('admin_label_js_please_select_category_for_this_product');
$subpartArray['###ADMIN_LABEL_JS_PRODUCT_NAME_IS_EMPTY###'] = addslashes(htmlspecialchars($this->pi_getLL('admin_label_js_product_name_is_empty')));
$subpartArray['###ADMIN_LABEL_JS_DEFINE_PRODUCT_NAME_FIRST_IN_DETAILS_TABS###'] = addslashes(htmlspecialchars($this->pi_getLL('admin_label_js_define_product_name_first_in_details_tabs')));
$subpartArray['###ADMIN_LABEL_PRODUCT_NOT_LOADED_SORRY_WE_CANT_FIND_IT###'] = $this->pi_getLL('admin_label_product_not_loaded_sorry_we_cant_find_it');
if (!$this->ms['MODULES']['DISPLAY_MANUFACTURERS_ADVICE_PRICE_INPUT']) {
$subpartArray['###MANUFACTURERS_ADVICE_PRICE###'] = '';
} else {
$manufacturers_advice_price_tax = mslib_fe::taxDecimalCrop($product['manufacturers_advice_price'] * $product_tax_rate / 100);
$manufacturers_advice_price_excl_vat_display = mslib_fe::taxDecimalCrop($product['manufacturers_advice_price'], 2, false);
$manufacturers_advice_price_incl_vat_display = mslib_fe::taxDecimalCrop($product['manufacturers_advice_price'] + $manufacturers_advice_price_tax, 2, false);
$subpartArray['###LABEL_MANUFACTURERS_ADVIES_PRICE###'] = $this->pi_getLL('admin_label_manufacturers_advice_price');
$subpartArray['###LABEL_EXCLUDING_VAT3###'] = $this->pi_getLL('excluding_vat');
$subpartArray['###LABEL_INCLUDING_VAT3###'] = $this->pi_getLL('including_vat');
$subpartArray['###LABEL_CURRENCY6###'] = mslib_fe::currency();
$subpartArray['###LABEL_CURRENCY7###'] = mslib_fe::currency();
$subpartArray['###VALUE_EXCL_VAT_MANUFACTURERS_ADVICE_PRICE###'] = $manufacturers_advice_price_excl_vat_display;
$subpartArray['###VALUE_INCL_VAT_MANUFACTURERS_ADVICE_PRICE###'] = $manufacturers_advice_price_incl_vat_display;
$subpartArray['###VALUE_ORIGINAL_MANUFACTURERS_ADVICE_PRICE###'] = $product['manufacturers_advice_price'];
}
$content .= $this->cObj->substituteMarkerArrayCached($subparts['template'], array(), $subpartArray);
} else {
$content .= $this->pi_getLL('admin_label_product_not_loaded_sorry_we_cant_find_it');
}
}
示例2: array
$status .= '<a href="#" class="update_product_status" rel="' . $rs['products_id'] . '"><span class="admin_status_red disabled" alt="Disabled"></span></a>';
$status .= '<span class="admin_status_green" alt="Enable"></span>';
}
$product_tax_rate = 0;
$data = mslib_fe::getTaxRuleSet($rs['tax_id'], 0);
$product_tax_rate = $data['total_tax_rate'];
$product_tax_rate_js[] = 'product_tax_rate_js["' . $rs['products_id'] . '"]="' . $data['total_tax_rate'] . '";';
$product_tax = mslib_fe::taxDecimalCrop($rs['products_price'] * $product_tax_rate / 100);
$product_price_display = mslib_fe::taxDecimalCrop($rs['products_price'], 2, false);
$product_price_display_incl = mslib_fe::taxDecimalCrop($rs['products_price'] + $product_tax, 2, false);
$special_tax = mslib_fe::taxDecimalCrop($rs['specials_new_products_price'] * $product_tax_rate / 100);
$special_price_display = mslib_fe::taxDecimalCrop($rs['specials_new_products_price'], 2, false);
$special_price_display_incl = mslib_fe::taxDecimalCrop($rs['specials_new_products_price'] + $special_tax, 2, false);
$capital_tax = mslib_fe::taxDecimalCrop($rs['product_capital_price'] * $product_tax_rate / 100);
$capital_price_display = mslib_fe::taxDecimalCrop($rs['product_capital_price'], 2, false);
$capital_price_display_incl = mslib_fe::taxDecimalCrop($rs['product_capital_price'] + $capital_tax, 2, false);
$markerArray = array();
$markerArray['ROW_TYPE'] = $switch;
$markerArray['CATEGORY_ID0'] = $rs['categories_id'];
$markerArray['CHECKBOX_COUNTER0'] = $s;
$markerArray['CHECKBOX_COUNTER1'] = $s;
$markerArray['CELL_NUMBER'] = $p * $this->ms['MODULES']['PRODUCTS_LISTING_LIMIT'] + $s + 1;
$markerArray['PRODUCT_NAME'] = $rs['products_name'] ? $rs['products_name'] : $this->pi_getLL('no_name');
$markerArray['PRODUCT_CATEGORIES_CRUMBAR'] = $cat_crumbar;
$markerArray['PRODUCT_MODEL'] = $rs['products_model'];
$markerArray['PRODUCT_STATUS'] = $status;
$markerArray['LINK_EDIT_CAT'] = $link_edit_cat;
$markerArray['CATEGORY_NAME'] = $rs['categories_name'];
$markerArray['VALUE_TAX_ID'] = $rs['tax_id'];
$markerArray['CURRENCY0'] = mslib_fe::currency();
$markerArray['CURRENCY1'] = mslib_fe::currency();
示例3: list
</div>
</div>
</div>';
$row_counter++;
}
}
$freeshippingcosts_above = false;
$free_shippingcosts = 0;
$fsc_price_display = 0;
$fsc_price_display_incl = 0;
if (!empty($row3['override_shippingcosts'])) {
$freeshippingcosts_above = true;
list($free_shippingcosts, ) = explode(':', $row3['override_shippingcosts']);
$fsc_tax = mslib_fe::taxDecimalCrop($free_shippingcosts * $sc_tax_rate / 100);
$fsc_price_display = mslib_fe::taxDecimalCrop($free_shippingcosts, 2, false);
$fsc_price_display_incl = mslib_fe::taxDecimalCrop($free_shippingcosts + $fsc_tax, 2, false);
}
$content .= '<hr>
<div class="form-group">
<label id="' . $zone_pid . '_NivLevel' . $i . '" class="control-label col-md-4 secondLabel"><div class="checkbox checkbox-success"><input type="checkbox" name="freeshippingcostsabove[' . $zone_pid . ']" id="freeshippingcostsabove[' . $zone_pid . ']" value="1"' . ($freeshippingcosts_above ? ' checked="checked"' : '') . ' /><label for="freeshippingcostsabove[' . $zone_pid . ']">' . $this->pi_getLL('free_shippingcosts_for_order_amount_above') . '</label></div></label>
<div class="col-md-8">
<div class="msAttributesField"><div class="input-group"><span class="input-group-addon">' . mslib_fe::currency() . '</span><input type="text" id="display_name" name="display_name" class="form-control msProductsPriceExcludingVat priceInputDisplay" value="' . htmlspecialchars($fsc_price_display) . '" rel="' . $row['id'] . '" autocomplete="off"><span class="input-group-addon">' . $this->pi_getLL('excluding_vat') . '</span></div></div>
<div class="msAttributesField"><div class="input-group"><span class="input-group-addon">' . mslib_fe::currency() . '</span><input type="text" name="display_name" id="display_name" class="form-control msProductsPriceIncludingVat priceInputDisplay" value="' . htmlspecialchars($fsc_price_display_incl) . '" rel="' . $row['id'] . '" autocomplete="off"><span class="input-group-addon">' . $this->pi_getLL('including_vat') . '</span></div></div>
<div class="msAttributesField hidden"><input type="hidden" style="text-align:right" size="3" name="freeshippingcostsabove_value[' . $zone_pid . ']" class="priceInputReal" value="' . $free_shippingcosts . '"></div>
</div>
</div>
';
$content .= '</div>';
$content .= '<script type="text/javascript">';
$content .= "</script>";
$content .= '</div>';
示例4: explode
if (strpos($current_price, ':') !== false) {
$price_list_format = explode(',', $current_price);
$price_list_incl_tax = array();
foreach ($price_list_format as $price_format) {
$price_excl = explode(':', $price_format);
if ($price_excl[1] > 0) {
$data = mslib_fe::getTaxRuleSet($tax_group_id, $price_excl[1], $to_tax_include);
if ($to_tax_include == 'true') {
$price_excl[1] = str_replace(',', '', $data['price_including_tax']);
} else {
$price_excl[1] = str_replace(',', '', $data['price_excluding_tax']);
}
} else {
$price_excl[1] = 0;
}
$price_excl[1] = mslib_fe::taxDecimalCrop($price_excl[1]);
$price_list_incl_tax[] = implode(':', $price_excl);
}
//$sc_price_display_incl = $row3['price'];
if ($to_tax_include == 'true') {
$data['price_including_tax'] = implode(',', $price_list_incl_tax);
} else {
$data['price_excluding_tax'] = implode(',', $price_list_incl_tax);
}
} else {
if (strstr($current_price, ",")) {
$current_price = str_replace(",", ".", $current_price);
}
$data = mslib_fe::getTaxRuleSet($tax_group_id, $current_price, $to_tax_include);
$data['price_excluding_tax'] = str_replace(',', '', $data['price_excluding_tax']);
}
示例5: array
break;
default:
$multiple = 0;
$continue = 1;
break;
}
if ($continue) {
$array = array($attribute_values);
foreach ($array as $item) {
if ($product['tax_rate'] && $this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
if ($value['country_tax_rate'] && $value['region_tax_rate']) {
$country_tax_rate = mslib_fe::taxDecimalCrop($item['options_values_price'] * $value['country_tax_rate']);
$region_tax_rate = mslib_fe::taxDecimalCrop($item['options_values_price'] * $value['region_tax_rate']);
$item_tax_rate = $country_tax_rate + $region_tax_rate;
} else {
$item_tax_rate = mslib_fe::taxDecimalCrop($item['options_values_price'] * $value['tax_rate']);
}
$item['options_values_price'] = $item['options_values_price'] + $item_tax_rate;
} else {
$item['options_values_price'] = round($item['options_values_price'], 2);
}
if ($item['options_values_price'] > 0) {
$subprices .= mslib_fe::amount2Cents($value['qty'] * ($item['price_prefix'] . $item['options_values_price']));
}
$subprices .= '<br />';
$output['product_attributes'] .= '<div class="attributes-items"><span class="attribute-option">' . $item['products_options_name'] . ':</span><span class="attribute-value">' . $item['products_options_values_name'] . $t . '</span></div>';
$price = $price + $value['qty'] * ($item['price_prefix'] . $item['options_values_price']);
}
}
}
// loading the attributes eof
示例6:
$payment_tax['payment_country_tax'] = mslib_fe::taxDecimalCrop($updateArray['payment_method_costs'] * $payment_method['country_tax_rate']);
} else {
$payment_tax['payment_country_tax_rate'] = 0;
$payment_tax['payment_country_tax'] = 0;
}
if ($payment_method['region_tax_rate']) {
$payment_tax['payment_region_tax_rate'] = $payment_method['region_tax_rate'];
$payment_tax['payment_region_tax'] = mslib_fe::taxDecimalCrop($updateArray['payment_method_costs'] * $payment_method['region_tax_rate']);
} else {
$payment_tax['payment_region_tax_rate'] = 0;
$payment_tax['payment_region_tax'] = 0;
}
if ($payment_tax['payment_region_tax'] && $payment_tax['payment_country_tax']) {
$payment_tax['payment_tax'] = $payment_tax['payment_country_tax'] + $payment_tax['payment_region_tax'];
} else {
$payment_tax['payment_tax'] = mslib_fe::taxDecimalCrop($updateArray['payment_method_costs'] * $payment_method['tax_rate']);
}
} else {
$payment_tax['payment_tax'] = 0;
$payment_tax['payment_country_tax'] = 0;
$payment_tax['payment_region_tax'] = 0;
$payment_tax['payment_total_tax_rate'] = 0;
$payment_tax['payment_country_tax_rate'] = 0;
$payment_tax['payment_region_tax_rate'] = 0;
}
$updateArray['payment_method'] = $payment_method['code'];
$updateArray['payment_method_label'] = $payment_method['name'];
}
if (isset($this->post['edit_discount_value'])) {
$updateArray['discount'] = $this->post['edit_discount_value'];
}
示例7: while
//var_dump($sql_option);
$qry_option = $GLOBALS['TYPO3_DB']->sql_query($sql_option);
$ctr = 0;
if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry_option) > 0) {
while (($rs_option = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry_option)) != false) {
$product = mslib_fe::getProduct($this->get['pid'], '', '', 1, 1);
$data = mslib_fe::getTaxRuleSet($product['tax_id'], $product['products_price']);
$product_tax_rate = $data['total_tax_rate'];
$attributes_tax = mslib_fe::taxDecimalCrop($rs_option['options_values_price'] * $product_tax_rate / 100);
$attribute_price_display_incl = mslib_fe::taxDecimalCrop($rs_option['options_values_price'] + $attributes_tax, 2, false, false);
$option_data[$ctr]['sort_order'] = (int) $rs_option['sort_order_option_name'];
$option_data[$ctr]['optid'] = $this->get['optid'];
$option_data[$ctr]['valid'] = $rs_option['options_values_id'];
$option_data[$ctr]['valname'] = $rs_option['products_options_values_name'];
$option_data[$ctr]['values_price'] = $rs_option['options_values_price'];
$option_data[$ctr]['display_values_price'] = mslib_fe::taxDecimalCrop($rs_option['options_values_price'], 2, false, false);
$option_data[$ctr]['display_values_price_including_vat'] = $attribute_price_display_incl;
$option_data[$ctr]['price_prefix'] = $rs_option['price_prefix'];
$ctr++;
}
}
}
$content = $option_data;
$content = json_encode($content, ENT_NOQUOTES);
if ($this->ms['MODULES']['CACHE_FRONT_END']) {
$Cache_Lite->save($content);
}
//}
echo $content;
exit;
}
示例8: str_replace
}
}
$amount_handling_cost = str_replace('%', '', $row['handling_costs']);
$data = mslib_fe::getTaxRuleSet($row['tax_id'], $amount_handling_cost);
$cost_tax_rate = $data['total_tax_rate'];
$cost_tax = mslib_fe::taxDecimalCrop($amount_handling_cost * $cost_tax_rate / 100);
$cost_excl_vat_display = mslib_fe::taxDecimalCrop($amount_handling_cost, 2, false);
$cost_incl_vat_display = mslib_fe::taxDecimalCrop($amount_handling_cost + $cost_tax, 2, false);
$cart_minimum_amount = $row['cart_minimum_amount'];
$cart_minimum_amount_cost_tax = mslib_fe::taxDecimalCrop($cart_minimum_amount * $cost_tax_rate / 100);
$cart_minimum_amount_excl_vat_display = mslib_fe::taxDecimalCrop($cart_minimum_amount, 2, false);
$cart_minimum_amount_incl_vat_display = mslib_fe::taxDecimalCrop($cart_minimum_amount + $cart_minimum_amount_cost_tax, 2, false);
$cart_maximum_amount = $row['cart_maximum_amount'];
$cart_maximum_amount_cost_tax = mslib_fe::taxDecimalCrop($cart_maximum_amount * $cost_tax_rate / 100);
$cart_maximum_amount_excl_vat_display = mslib_fe::taxDecimalCrop($cart_maximum_amount, 2, false);
$cart_maximum_amount_incl_vat_display = mslib_fe::taxDecimalCrop($cart_maximum_amount + $cart_maximum_amount_cost_tax, 2, false);
$tmpcontent .= '<div class="form-group">
<label class="control-label col-md-2">' . $this->pi_getLL('code') . '</label>
<div class="col-md-10">
<p class="form-control-static">
<input name="custom_code" id="custom_code" type="hidden" value="' . htmlspecialchars($row['code']) . '" />
' . $row['code'] . '
</p>
</div>
</div>';
if (count($active_shop) > 1) {
$tmpcontent .= '<div class="form-group">
<label for="related_shop_pid" class="control-label col-md-2">' . $this->pi_getLL('relate_shipping_to_shop', 'Relate this method to') . '</label>
<div class="col-md-10">
<div class="radio radio-success radio-inline"><input name="related_shop_pid" id="related_shop_pid" type="radio" value="0"' . ($row['page_uid'] == 0 ? ' checked="checked"' : '') . ' /><label>' . $this->pi_getLL('relate_payment_to_all_shop', 'All shop') . '</label></div>';
foreach ($active_shop as $pageinfo) {
示例9: getHtmlCartContents
//.........这里部分代码省略.........
}
$item['ITEM_NAME'] .= trim($attribute_item['products_options_values_name']);
$price = $price + ($attribute_item['price_prefix'] . $attribute_item['options_values_price']) * $product['qty'];
if ($attribute_item['options_values_price'] > 0) {
$subPrices .= mslib_fe::amount2Cents(($attribute_item['price_prefix'] . $attribute_item['options_values_price']) * $product['qty']);
}
$subPrices .= '<br />';
if (isset($attribute_values[$counter])) {
$item['ITEM_NAME'] .= ', ';
}
}
break;
case 'input':
$item['ITEM_NAME'] .= '<br />' . $row['products_options_name'] . ': ' . $attribute_values['products_options_values_name'];
$multiple = 0;
$continue = 0;
break;
default:
$multiple = 0;
$continue = 1;
break;
}
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_cart.php']['getHtmlCartContentsAttributesIteratorPostType'])) {
$params = array('attribute_key' => &$attribute_key, 'attribute_values' => &$attribute_values, 'continue' => &$continue, 'multiple' => &$multiple, 'row' => &$row);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_cart.php']['getHtmlCartContentsAttributesIteratorPostType'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
}
if ($continue) {
$array = array($attribute_values);
foreach ($array as $attribute_item) {
if ($product['tax_rate'] && $this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
if ($product['country_tax_rate'] && $product['region_tax_rate']) {
$country_tax_rate = mslib_fe::taxDecimalCrop($attribute_item['options_values_price'] * $product['country_tax_rate']);
$region_tax_rate = mslib_fe::taxDecimalCrop($attribute_item['options_values_price'] * $product['region_tax_rate']);
$item_tax_rate = $country_tax_rate + $region_tax_rate;
} else {
$item_tax_rate = mslib_fe::taxDecimalCrop($attribute_item['options_values_price'] * $product['tax_rate']);
}
$attribute_item['options_values_price'] = $attribute_item['options_values_price'] + $item_tax_rate;
} else {
$attribute_item['options_values_price'] = round($attribute_item['options_values_price'], 2);
}
if ($attribute_item['options_values_price'] > 0) {
$subPrices .= mslib_fe::amount2Cents($product['qty'] * ($attribute_item['price_prefix'] . $attribute_item['options_values_price']));
}
$subPrices .= '<br />';
$item['ITEM_NAME'] .= '<div class="attributes-items"><span class="attribute-option">' . $row['products_options_name'] . ':</span><span class="attribute-value">' . $attribute_values['products_options_values_name'] . '</span></div>';
$price = $price + ($attribute_item['price_prefix'] . $attribute_item['options_values_price']) * $product['qty'];
}
}
}
// loading the attributes eof
}
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_cart.php']['getHtmlCartContentsItemPricePreProc'])) {
$params = array('product' => &$product, 'cart' => &$this->cart, 'c' => &$c, 'subPrices' => &$subPrices, 'sectionTemplateType' => &$sectionTemplateType);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_cart.php']['getHtmlCartContentsItemPricePreProc'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
}
if ($subPrices) {
$subPrices = '<div class="attribute_prices">' . $subPrices . '</div>';
}
// ITEM NAME EOF
// ITEM_MODEL
$item['ITEM_MODEL'] = $product['products_model'];
示例10: productFeedGeneratorGetShippingCosts
//.........这里部分代码省略.........
// example setting: 0:6.95,50:0
$split = explode(":", $step);
if (is_numeric($split[0])) {
if ($count == 0) {
if (isset($split[1])) {
$shipping_cost = $split[1];
$shipping_cost_method_box = $split[1];
} else {
$shipping_cost = $split[0];
$shipping_cost_method_box = $split[0];
continue;
}
}
if ($subtotal > $split[0] and isset($split[1])) {
$shipping_cost = $split[1];
$shipping_cost_method_box = $split[0];
continue;
}
}
$count++;
}
}
// custom code to change the shipping costs based on cart amount
if (!$this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
$shipping_cost = round($shipping_cost, 2);
$shipping_cost_method_box = round($shipping_cost_method_box, 2);
}
// shipping costs only for shipping method box display
if ($shipping_cost_method_box) {
if ($shipping_method['tax_id'] && $shipping_cost_method_box) {
$shipping_method_box_total_tax_rate = $shipping_method['tax_rate'];
if ($shipping_method['country_tax_rate']) {
$shipping_method_box_country_tax_rate = $shipping_method['country_tax_rate'];
$shipping_method_box_country_tax = mslib_fe::taxDecimalCrop($shipping_cost_method_box * $shipping_method['country_tax_rate']);
} else {
$shipping_method_box_country_tax_rate = 0;
$shipping_method_box_country_tax = 0;
}
if ($shipping_method['region_tax_rate']) {
$shipping_method_box_region_tax_rate = $shipping_method['region_tax_rate'];
$shipping_method_box_region_tax = mslib_fe::taxDecimalCrop($shipping_cost_method_box * $shipping_method['region_tax_rate']);
} else {
$shipping_method_box_region_tax_rate = 0;
$shipping_method_box_region_tax = 0;
}
if ($shipping_method_box_region_tax && $shipping_method_box_country_tax) {
$shipping_method_box_tax = $shipping_method_box_country_tax + $shipping_method_box_region_tax;
} else {
$shipping_method_box_tax = mslib_fe::taxDecimalCrop($shipping_cost_method_box * $shipping_method['tax_rate']);
}
}
}
if ($shipping_cost) {
if ($shipping_method['tax_id'] && $shipping_cost) {
$shipping_total_tax_rate = $shipping_method['tax_rate'];
if ($shipping_method['country_tax_rate']) {
$shipping_country_tax_rate = $shipping_method['country_tax_rate'];
$shipping_country_tax = mslib_fe::taxDecimalCrop($shipping_cost * $shipping_method['country_tax_rate']);
} else {
$shipping_country_tax_rate = 0;
$shipping_country_tax = 0;
}
if ($shipping_method['region_tax_rate']) {
$shipping_region_tax_rate = $shipping_method['region_tax_rate'];
$shipping_region_tax = mslib_fe::taxDecimalCrop($shipping_cost * $shipping_method['region_tax_rate']);
} else {
示例11: printOrderDetailsTable
//.........这里部分代码省略.........
}
$item['ITEM_NAME'] = $item_name;
$item['ITEM_MODEL'] = htmlspecialchars($product_db['products_model']);
// ITEM NAME EOF
// ITEM_QUANTITY
$item['ITEM_QUANTITY'] = round($product['qty'], 14);
// ITEM_SKU
$item['ITEM_SKU'] = htmlspecialchars($product_db['sku_code']);
// ITEM_TOTAL
if ($this->ms['MODULES']['FORCE_CHECKOUT_SHOW_PRICES_INCLUDING_VAT']) {
$tmp_tax = round($product['final_price'] * ($product['products_tax'] / 100), 2);
$final_price = $product['qty'] * ($product['final_price'] + $tmp_tax);
$item['ITEM_PRICE_SINGLE'] = mslib_fe::amount2Cents($product['final_price'] + $tmp_tax);
} else {
if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
$final_price = $product['qty'] * $product['final_price'];
$final_price = round($final_price * ($product['products_tax'] / 100), 4) + $final_price;
$item['ITEM_PRICE_SINGLE'] = mslib_fe::amount2Cents(round($product['final_price'] * ($product['products_tax'] / 100), 4) + $product['final_price']);
} else {
$final_price = $product['qty'] * $product['final_price'];
$item['ITEM_PRICE_SINGLE'] = mslib_fe::amount2Cents($product['final_price']);
}
}
$item['ITEM_TOTAL'] = mslib_fe::amount2Cents($final_price) . $subprices;
if ($this->ms['MODULES']['ADMIN_EDIT_ORDER_DISPLAY_ORDERS_PRODUCTS_STATUS'] > 0 && $template_type == 'order_history_site') {
$item['ITEM_PRODUCT_STATUS'] = htmlspecialchars(mslib_fe::getOrderStatusName($product['status']));
}
$item['ITEM_VAT_RATE'] = str_replace('.00', '', number_format($product['products_tax'], 2)) . '%';
// GRAND TOTAL CALCULATIONS
$subtotal = $subtotal + $price;
$subtotal_tax = $subtotal_tax + $product['products_tax_data']['total_tax'] + $product['products_tax_data']['total_attributes_tax'];
$subtotalIncludingVatArray[] = $product['total_price'];
if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
$subtotalIncludingVatArray[] = mslib_fe::taxDecimalCrop($product['qty'] * $product['products_tax_data']['total_tax'], 2, true);
} else {
$subtotalIncludingVatArray[] = mslib_fe::taxDecimalCrop($product['qty'] * $product['products_tax_data']['total_tax'], 2, false);
}
$subtotalIncludingVatArray[] = $product['qty'] * $product['products_tax_data']['total_attributes_tax'];
// GRAND TOTAL CALCULATIONS EOF
//hook to let other plugins further manipulate the replacers
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_order']['printOrderDetailsTableItemPreProc'])) {
$params = array('item' => &$item, 'order' => &$order, 'product' => &$product, 'template_type' => &$template_type, 'product_db' => $product_db);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_order']['printOrderDetailsTableItemPreProc'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
}
$itemsWrapper[] = $item;
}
// MERGE TO TEMPLATE
// Extract the subparts from the template
$subparts = array();
$subparts['template'] = $this->cObj->getSubpart($template, '###TEMPLATE###');
$subparts['ITEMS_HEADER_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###ITEMS_HEADER_WRAPPER###');
$subparts['ITEMS_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###ITEMS_WRAPPER###');
$subparts['SUBTOTAL_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###SUBTOTAL_WRAPPER###');
$subparts['SHIPPING_COSTS_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###SHIPPING_COSTS_WRAPPER###');
$subparts['PAYMENT_COSTS_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###PAYMENT_COSTS_WRAPPER###');
$subparts['GRAND_TOTAL_EXCLUDING_VAT_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###GRAND_TOTAL_EXCLUDING_VAT_WRAPPER###');
$subparts['GRAND_TOTAL_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###GRAND_TOTAL_WRAPPER###');
$subparts['TAX_COSTS_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###TAX_COSTS_WRAPPER###');
$subparts['DISCOUNT_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###DISCOUNT_WRAPPER###');
$subparts['NEWSUBTOTAL_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###NEWSUBTOTAL_WRAPPER###');
if (!$this->ms['MODULES']['ADMIN_EDIT_ORDER_DISPLAY_ORDERS_PRODUCTS_STATUS'] || $template_type != 'order_history_site') {
$subProductStatusPart = array();
$subProductStatusPart['ITEMS_HEADER_PRODUCT_STATUS_WRAPPER'] = $this->cObj->getSubpart($subparts['ITEMS_HEADER_WRAPPER'], '###ITEMS_HEADER_PRODUCT_STATUS_WRAPPER###');
$subProductStatus = array();
示例12: while
while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) != false) {
$data[] = array('id' => $row['products_options_values_id'], 'text' => $row['products_options_values_name']);
}
} else {
if (isset($this->get['preselected_id']) && !empty($this->get['preselected_id'])) {
$data[] = array('id' => $this->get['preselected_id'], 'text' => $this->get['preselected_id']);
} else {
$data[] = array('id' => $this->get['q'], 'text' => $this->get['q']);
}
}
$content = json_encode($data);
break;
// all calculation are based on excluding vat
// all calculation are based on excluding vat
case 'get_product_discount_price':
$return_data = array();
$discount_percentage = $this->get['discount_percentage'];
$current_price = $this->get['current_price'];
$return_data['status'] = 'NOTOK';
if (isset($discount_percentage) && is_numeric($discount_percentage) && $discount_percentage > 0 && $current_price > 0) {
$discount_amount = mslib_fe::taxDecimalCrop($current_price * $discount_percentage / 100, 2, false);
$return_data['status'] = 'OK';
$return_data['discount_amount'] = $discount_amount;
$return_data['price_after_discount'] = $current_price - $discount_amount;
$return_data['price_after_discount_format'] = mslib_fe::amount2Cents($current_price - $discount_amount);
}
$content = json_encode($return_data);
break;
}
echo $content;
exit;
示例13: round
break;
case 'products_old_price_excluding_vat':
//$tmpcontent .= $row['products_price'];
$tmpcontent .= round($row['products_price'], 14);
break;
case 'products_old_price':
$final_price = mslib_fe::final_products_price($row);
$old_product_price = $row['products_price'];
if ($row['tax_rate'] and $this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT'] || $this->ms['MODULES']['SHOW_PRICES_WITH_AND_WITHOUT_VAT']) {
// in this mode the stored prices in the tx_multishop_products are excluding VAT and we have to add it manually
if ($row['country_tax_rate'] && $row['region_tax_rate']) {
$country_tax_rate = mslib_fe::taxDecimalCrop($final_price * $row['country_tax_rate']);
$region_tax_rate = mslib_fe::taxDecimalCrop($final_price * $row['region_tax_rate']);
$old_product_price = $old_product_price + ($country_tax_rate + $region_tax_rate);
} else {
$tax_rate = mslib_fe::taxDecimalCrop($row['products_price'] * $row['tax_rate']);
$old_product_price = $old_product_price + $tax_rate;
}
}
if ($old_product_price != $final_price) {
//$tmpcontent .= round($old_product_price,14);
$tmpcontent .= round($old_product_price, 2);
} else {
$tmpcontent .= '';
}
break;
case 'products_price_excluding_vat':
$tmpcontent .= round($row['final_price'], 14);
break;
case 'products_price':
$tmpcontent .= mslib_fe::final_products_price($row);
示例14:
} else {
$order_products_body_data['products_normal_price']['value']='<div class="msAttributesField">'.mslib_fe::currency().' <input type="text" id="display_name" name="display_name_excluding_vat" class="msStaffelPriceExcludingVat" value="'.$order_products_price_display.'"><label for="display_name_excluding_vat">'.$this->pi_getLL('excluding_vat').'</label></div>';
$order_products_body_data['products_normal_price']['value'].='<div class="msAttributesField">'.mslib_fe::currency().' <input type="text" name="display_name" id="display_name_including_vat" class="msStaffelPriceIncludingVat" value="'.($order_products_price_display_incl).'"><label for="display_name_including_vat">'.$this->pi_getLL('including_vat').'</label></div>';
$order_products_body_data['products_normal_price']['value'].='<div class="msAttributesField hidden"><input class="text" style="width:44px" type="hidden" name="product_price" id="product_price" value="'.$order['final_price'].'" /></div>';
}*/
if (!$this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
// products vat col
$order_products_body_data['products_vat']['align'] = 'right';
$order_products_body_data['products_vat']['class'] = 'cellVat';
$order_products_body_data['products_vat']['value'] = $vat_sb;
}
if ($this->ms['MODULES']['ENABLE_DISCOUNT_ON_EDIT_ORDER_PRODUCT']) {
$order_products_body_data['products_discount']['class'] = 'cellPrice cellNoWrap';
//$order_products_body_data['products_discount']['value']=$this->pi_getLL('discount') . ' input';
$order_products_discount_amount_display = mslib_fe::taxDecimalCrop($order['discount_amount'], 2, false);
$order_products_discount_amount_display_incl = mslib_fe::taxDecimalCrop($order['discount_amount'] + $order['discount_amount'] * $order['products_tax'] / 100, 2, false);
$percentage_sb = '<div class="discount_percentage_wrapper">
<select name="product_discount_percentage" id="product_discount_percentage" style="width:210px">
<option value="">' . $this->pi_getLL('use_discount_amount') . '</option>
';
$selected_percentage = str_replace('.00', '', $order['discount_percentage']);
for ($p = 1; $p <= 100; $p++) {
if ($selected_percentage == $p) {
$percentage_sb .= '<option value="' . $p . '" selected="selected">' . $p . '%</option>';
} else {
$percentage_sb .= '<option value="' . $p . '">' . $p . '%</option>';
}
}
$percentage_sb .= '</select>
</div>';
$order_products_body_data['products_discount']['value'] = $percentage_sb . '<div class="msAttributesField"><div class="input-group"><span class="input-group-addon">' . mslib_fe::currency() . '</span><input type="text" id="display_name_discount_excluding_vat" name="display_name_discount_excluding_vat" class="form-control msOrderProductPriceExcludingVat priceInputDisplay" value="' . $order_products_discount_amount_display . '" autocomplete="off"><span class="input-group-addon">' . $this->pi_getLL('excluding_vat') . '</span></div></div>';