if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/includes/admin_edit_product.php']['adminEditProductDescriptionSubstitudePreProc'])) { $params = array('markerArray' => &$markerArray, 'product' => &$product, 'language' => &$language, 'langKey' => &$key, 'lngproduct' => &$lngproduct); foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/includes/admin_edit_product.php']['adminEditProductDescriptionSubstitudePreProc'] as $funcRef) { \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this); } } $details_content .= $this->cObj->substituteMarkerArray($subparts['details_content'], $markerArray, '###|###'); } /* * options tab */ $input_vat_rate = '<select name="tax_id" id="tax_id" class="form-control"><option value="0">' . $this->pi_getLL('admin_no_tax') . '</option>'; $str = "SELECT trg.*, t.rate FROM `tx_multishop_tax_rule_groups` trg, `tx_multishop_tax_rules` tr, `tx_multishop_taxes` t where trg.rules_group_id=tr.rules_group_id and tr.tax_id=t.tax_id group by trg.rules_group_id order by trg.rules_group_id asc"; $qry = $GLOBALS['TYPO3_DB']->sql_query($str); $product_tax_rate = 0; $data = mslib_fe::getTaxRuleSet($product['tax_id'], $product['products_price']); $product_tax_rate = $data['total_tax_rate']; $tax_list_data = array(); while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) != false) { $tax_list_data[] = 'product_tax_rate_list_js["' . $row['rules_group_id'] . '"]="' . round(number_format($row['rate'], 2), 2) . '"'; if ($this->get['action'] == 'add_product') { $input_vat_rate .= '<option value="' . $row['rules_group_id'] . '" ' . ($row['default_status'] ? 'selected' : '') . '>' . htmlspecialchars($row['name']) . '</option>'; } else { $input_vat_rate .= '<option value="' . $row['rules_group_id'] . '" ' . ($row['rules_group_id'] == $product['tax_id'] ? 'selected' : '') . '>' . htmlspecialchars($row['name']) . '</option>'; } } $input_vat_rate .= '</select>'; // js definition for tax $product_tax_rate_js = array(); $product_tax_rate_js[] = 'var product_tax_rate_list_js=[];'; if (count($tax_list_data)) {
$content .= '<div class="panel-body">'; $zone_pid = $row['id'] . $zone['id']; $shipping_cost = array(); if (isset($row3['price']) && !empty($row3['price'])) { $row3['price'] = trim($row3['price'], ','); $shipping_cost = explode(",", $row3['price']); } $count_sc = count($shipping_cost); if ($count_sc > 0) { for ($i = 1; $i <= $count_sc; $i++) { $nextVal = $i + 1; $numKey = $i; $end_weight = 101; $zone_price = explode(":", $shipping_cost[$numKey - 1]); $sc_tax_rate = 0; $data = mslib_fe::getTaxRuleSet($row['tax_id'], 0); $sc_tax_rate = $data['total_tax_rate']; $sc_tax = mslib_fe::taxDecimalCrop($zone_price[1] * $sc_tax_rate / 100); $sc_price_display = mslib_fe::taxDecimalCrop($zone_price[1], 2, false); $sc_price_display_incl = mslib_fe::taxDecimalCrop($zone_price[1] + $sc_tax, 2, false); // custom hook that can be controlled by third-party plugin if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/admin_shipping_cost.php']['weightConversion'])) { $params = array('zone_price' => &$zone_price, 'end_weight' => &$end_weight); foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/admin_shipping_cost.php']['weightConversion'] as $funcRef) { \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this); } } $weight_next = $i > 1 ? $weight_old : '0'; $zone_price_display = $zone_price[0] == $end_weight ? 'End' : $zone_price[0]; $content .= ' <div id="' . $zone_pid . '_Row_' . $i . '" class="form-group">
</div> </div> '; } $cost_tax_rate = 0; $percentage_handling_cost = $row['handling_costs']; if (strpos($percentage_handling_cost, '%') === false) { $tmp_phc = explode('.', $percentage_handling_cost); if (isset($tmp_phc[1]) > 0) { $percentage_handling_cost = mslib_fe::taxDecimalCrop($percentage_handling_cost, 2, false) . '%'; } else { $percentage_handling_cost = $percentage_handling_cost . '%'; } } $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">
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']); } $json_data = json_encode($data, ENT_NOQUOTES); echo $json_data; exit;
$payment_methods = $payment_methods_product; } } if (!count($payment_methods)) { // nothing is loaded. this cant be valid so let's load the default methods. // load payment method based on store origin country $payment_methods = mslib_fe::loadPaymentMethods(0, $countries_id, true, true); } $data = array(); $k = 0; foreach ($payment_methods as $payment_name => $payment_data) { $vars = unserialize($payment_data['vars']); if ($countries_id > 0) { $tax_ruleset = mslib_fe::taxRuleSet($payment_data['tax_id'], 0, $countries_id, 0); } else { $tax_ruleset = mslib_fe::getTaxRuleSet($payment_data['tax_id'], 0); } $payment_data['tax_rate'] = $tax_ruleset['total_tax_rate'] / 100; //print_r($payment_data); if (!$tr_type or $tr_type == 'even') { $tr_type = 'odd'; } else { $tr_type = 'even'; } if (!$payment_data['sort_order']) { $payment_data['sort_order'] = $k; } // refine the payment data, only sent what it's need to rebuild the <li> on the client side $data[$payment_data['sort_order']]['payment_id'] = $payment_data['id']; $data[$payment_data['sort_order']]['payment_label'] = $payment_data['name']; $data[$payment_data['sort_order']]['payment_description'] = $payment_data['description'];