while ($rows = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
     if ($rows['relative_product_id'] != $product['products_id']) {
         if ($rows['relative_product_id'] > 0) {
             $relations_data[] = $rows['relative_product_id'];
         }
     } else {
         if ($rows['products_id'] != $product['products_id']) {
             if ($rows['products_id'] > 0) {
                 $relations_data[] = $rows['products_id'];
             }
         }
     }
 }
 $filter = array();
 if (strlen($this->post['keypas']) > 1) {
     $filter[] = "A.products_name LIKE '%" . trim(mslib_befe::strtolower($this->post['keypas'])) . "%'";
 }
 $filter[] = "p.page_uid='" . $this->showCatalogFromPage . "' and A.products_id=p.products_id";
 if (is_array($relations_data) and count($relations_data)) {
     $filter[] = 'A.products_id NOT IN (' . implode(', ', $relations_data) . ')';
 }
 $subcat_query = '';
 if ($this->post['s_cid'] > 0) {
     $subcats = mslib_fe::get_subcategory_ids($this->post['s_cid'], $subcats);
     $subcat_queries[] = 'B.categories_id = ' . $this->post['s_cid'];
     foreach ($subcats as $subcat_id) {
         $subcat_queries[] = 'B.categories_id = ' . $subcat_id;
     }
     $subcat_query = '(' . implode(' OR ', $subcat_queries) . ')';
     $filter[] = $subcat_query;
 }
									<thead><tr id="sp_end_row"><td align="right" colspan=4"><input type="hidden" id="sp_row_counter" value="0" /></td></tr></thead>
								</table>
							</div>
							</div>
						</div>';
            } else {
                $staffel_price_block .= '
					<div id="msEditProductInputStaffelPrice">
						<label for="products_price"class="control-label col-md-2">' . $this->pi_getLL('admin_staffel_price') . '</label>
						<div class="col-md-10 product_staffel_price ">
							<table class="table">
								<thead>
								<tr>
									<th>' . mslib_befe::strtolower($this->pi_getLL('admin_from')) . '</th>
									<th>' . mslib_befe::strtolower($this->pi_getLL('admin_till')) . '</th>
									<th>' . mslib_befe::strtolower($this->pi_getLL('admin_price')) . '</th>
									<th>&nbsp;</th>
								</tr></thead><tbody>';
                $sp_rows = explode(';', $product['staffel_price']);
                foreach ($sp_rows as $sp_idx => $sp_row) {
                    $sp_idx += 1;
                    list($sp_col, $sp_price) = explode(':', $sp_row);
                    list($sp_col_1, $sp_col_2) = explode('-', $sp_col);
                    $staffel_tax = mslib_fe::taxDecimalCrop($sp_price * $product_tax_rate / 100);
                    $sp_price_display = mslib_fe::taxDecimalCrop($sp_price, 2, false);
                    $staffel_price_display_incl = mslib_fe::taxDecimalCrop($sp_price + $staffel_tax, 2, false);
                    $staffel_price_block .= '
						<tr id="sp_' . $sp_idx . '">
							<td><div class="input-group"><span class="input-group-addon">' . $this->pi_getLL('admin_from') . '</span><input type="text" class="form-control price small_input" name="sp[' . $sp_idx . '][]" id="sp_' . $sp_idx . '_qty_1" readonly="readonly" value="' . $sp_col_1 . '" /></span></td>
							<td><div class="input-group"><span class="input-group-addon">' . $this->pi_getLL('admin_till2') . '</span><input type="text" class="form-control price small_input" name="sp[' . $sp_idx . '][]" id="sp_' . $sp_idx . '_qty_2" value="' . $sp_col_2 . '" /></span></td>
							<td>
$enabled_countries = array();
while (($row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry2)) != false) {
    $enabled_countries[] = $row2;
}
if (is_array($this->tta_shop_info) && $this->tta_shop_info['tt_uid'] == $this->conf['tt_address_record_id_store']) {
    $rs_store_details = $this->tta_shop_info;
    // build countries selectbox
    if (count($enabled_countries) == 1) {
        $countries_input = '<input name="country" type="hidden" value="' . mslib_befe::strtolower($enabled_countries[0]['cn_short_en']) . '" />';
        $countries_input .= '<input name="delivery_country" type="hidden" value="' . mslib_befe::strtolower($enabled_countries[0]['cn_short_en']) . '" />';
    } else {
        $billing_countries_option = array();
        $delivery_countries_option = array();
        foreach ($enabled_countries as $country) {
            $cn_localized_name = htmlspecialchars(mslib_fe::getTranslatedCountryNameByEnglishName($this->lang, $country['cn_short_en']));
            $billing_countries_option[$cn_localized_name] = '<option value="' . mslib_befe::strtolower($country['cn_short_en']) . '" ' . (mslib_befe::strtolower($rs_store_details['country']) == mslib_befe::strtolower($country['cn_short_en']) ? 'selected' : '') . '>' . $cn_localized_name . '</option>';
        }
        ksort($billing_countries_option);
        $tmpcontent_con = implode("\n", $billing_countries_option);
        if ($tmpcontent_con) {
            $countries_input = '<label for="country" id="account-country">' . ucfirst($this->pi_getLL('country')) . '</label>
			<select name="country" id="country" class="country" autocomplete="off" style="width:349px">
			<option value="">' . ucfirst($this->pi_getLL('choose_country')) . '</option>
			' . $tmpcontent_con . '
			</select>
			';
        }
    }
    $content .= '<div class="panel panel-default"><div class="panel-heading"><h3>' . $this->pi_getLL('edit_store_address') . '</h3></div><div class="panel-body">';
    if (is_array($erno) && count($erno)) {
        $content .= '<div class="alert alert-danger"><h3>The following errors occurred</h3><ul>';
    $params = array();
    foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/includes/admin_stats_orders/turn_over_per_month.php']['monthlyStatsOrdersPagePreProc'] as $funcRef) {
        \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
    }
}
// billing countries
$additional_where = array();
if (!$this->masterShop) {
    $additional_where[] = 'page_uid=\'' . $this->shop_pid . '\'';
}
$order_countries = mslib_befe::getRecords('', 'tx_multishop_orders', '', $additional_where, 'billing_country', 'billing_country asc');
$order_billing_country = array();
foreach ($order_countries as $order_country) {
    $cn_localized_name = htmlspecialchars(mslib_fe::getTranslatedCountryNameByEnglishName($this->lang, $order_country['billing_country']));
    if (!empty($cn_localized_name)) {
        $order_billing_country[] = '<option value="' . mslib_befe::strtolower($order_country['billing_country']) . '" ' . (mslib_befe::strtolower($this->get['country']) == strtolower($order_country['billing_country']) ? 'selected' : '') . '>' . $cn_localized_name . '</option>';
    }
}
ksort($order_billing_country);
$billing_countries_sb = '<select class="invoice_select2" name="country" id="country""><option value="">' . $this->pi_getLL('all_countries') . '</option>' . implode("\n", $order_billing_country) . '</select>';
$all_orders_status = mslib_fe::getAllOrderStatus($GLOBALS['TSFE']->sys_language_uid);
if ($this->post['Search'] and $this->get['payment_status'] != $this->cookie['payment_status']) {
    $this->cookie['payment_status'] = $this->get['payment_status'];
    $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_multishop_cookie', $this->cookie);
    $GLOBALS['TSFE']->storeSessionData();
}
if ($this->get['stats_year_sb'] > 0) {
    if ($this->get['stats_year_sb'] != $this->cookie['stats_year_sb']) {
        $this->cookie['stats_year_sb'] = $this->get['stats_year_sb'];
    }
} else {
Example #5
0
 function printInvoiceOrderDetailsTable($order, $invoice_number, $prefix = '', $display_currency_symbol = 1, $table_type = 'invoice')
 {
     switch ($table_type) {
         case 'invoice':
             if ($this->conf['order_details_table_invoice_pdf_tmpl_path']) {
                 $template = $this->cObj->fileResource($this->conf['order_details_table_invoice_pdf_tmpl_path']);
             } else {
                 $template = $this->cObj->fileResource(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('multishop') . 'templates/order_details_table_invoice_pdf.tmpl');
             }
             break;
         case 'packingslip':
             if ($this->conf['order_details_table_packingslip_pdf_tmpl_path']) {
                 $template = $this->cObj->fileResource($this->conf['order_details_table_packingslip_pdf_tmpl_path']);
             } else {
                 $template = $this->cObj->fileResource(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('multishop') . 'templates/order_details_table_packingslip_pdf.tmpl');
             }
             break;
     }
     if (is_array($order['products']) && count($order['products'])) {
         $contentItem = '';
         $displayDiscountColumn = 0;
         // First check if orders products rows have an discount amount
         foreach ($order['products'] as $product) {
             if ($product['discount_amount'] > 0) {
                 $displayDiscountColumn = 1;
                 break;
             }
         }
     }
     $customer_currency = 1;
     // Extract the subparts from the template
     $subparts = array();
     $subparts['template'] = $this->cObj->getSubpart($template, '###TEMPLATE###');
     $subparts['HEADER_NORMAL_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###HEADER_NORMAL_WRAPPER###');
     $subparts['HEADER_INCLUDE_VAT_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###HEADER_INCLUDE_VAT_WRAPPER###');
     $subparts['HEADER_EXCLUDE_VAT_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###HEADER_EXCLUDE_VAT_WRAPPER###');
     // items wrapper
     $subparts['ITEMS_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###ITEMS_WRAPPER###');
     $subparts['ITEM_WRAPPER'] = $this->cObj->getSubpart($subparts['ITEMS_WRAPPER'], '###ITEM_WRAPPER###');
     $subparts['ITEM_ATTRIBUTES_WRAPPER'] = $this->cObj->getSubpart($subparts['ITEMS_WRAPPER'], '###ITEM_ATTRIBUTES_WRAPPER###');
     //bottom row
     $subparts['SUBTOTAL_INCLUDE_VAT_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###SUBTOTAL_INCLUDE_VAT_WRAPPER###');
     $subparts['SUBTOTAL_EXCLUDE_VAT_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###SUBTOTAL_EXCLUDE_VAT_WRAPPER###');
     $subparts['DISCOUNT_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###DISCOUNT_WRAPPER###');
     $subparts['NEWSUBTOTAL_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###NEWSUBTOTAL_WRAPPER###');
     $subparts['TOTAL_VAT_ROW_INCLUDE_VAT'] = $this->cObj->getSubpart($subparts['template'], '###TOTAL_VAT_ROW_INCLUDE_VAT###');
     // single packing, shipping, payment costs line
     $subparts['SINGLE_SHIPPING_PACKING_COSTS_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###SINGLE_SHIPPING_PACKING_COSTS_WRAPPER###');
     // parsing
     $subpartArray = array();
     //ITEMS_HEADER_WRAPPER
     $markerArray = array();
     $markerArray['LABEL_HEADER_QTY'] = ucfirst($this->pi_getLL('qty'));
     $markerArray['LABEL_HEADER_PRODUCT_NAME'] = $this->pi_getLL('products_name');
     $markerArray['LABEL_HEADER_SKU'] = $this->pi_getLL('sku_number', 'SKU');
     $markerArray['LABEL_HEADER__QUANTITY'] = $this->pi_getLL('qty');
     $markerArray['LABEL_HEADER_TOTAL'] = $this->pi_getLL('total');
     $markerArray['LABEL_HEADER_PRICE'] = $this->pi_getLL('price');
     //hook to let other plugins further manipulate the replacers
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['printInvoiceOrderDetailsTableHeaderNormalPostProc'])) {
         $params_internal = array('markerArray' => &$markerArray, 'table_type' => $table_type);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['printInvoiceOrderDetailsTableHeaderNormalPostProc'] as $funcRef) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params_internal, $this);
         }
     }
     $subpartArray['###HEADER_NORMAL_WRAPPER###'] = $this->cObj->substituteMarkerArray($subparts['HEADER_NORMAL_WRAPPER'], $markerArray, '###|###');
     $markerArray = array();
     $markerArray['LABEL_HEADER_VAT'] = $this->pi_getLL('vat');
     $markerArray['LABEL_HEADER_ITEM_NORMAL_PRICE'] = $this->pi_getLL('normal_price');
     $markerArray['LABEL_HEADER_ITEM_DISCOUNT'] = '';
     //hook to let other plugins further manipulate the replacers
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['printInvoiceOrderDetailsTableHeaderIncludeExcludeVatPostProc'])) {
         $params_internal = array('markerArray' => &$markerArray, 'table_type' => $table_type);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['printInvoiceOrderDetailsTableHeaderIncludeExcludeVatPostProc'] as $funcRef) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params_internal, $this);
         }
     }
     if ($displayDiscountColumn) {
         $markerArray['LABEL_HEADER_ITEM_DISCOUNT'] = '<th align="right" class="cell_products_normal_price">' . $this->pi_getLL('discount') . '</th>';
     }
     if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
         $markerArray['LABEL_HEADER_ITEM_FINAL_PRICE'] = $this->pi_getLL('final_price_inc_vat');
         $subpartArray['###HEADER_INCLUDE_VAT_WRAPPER###'] = $this->cObj->substituteMarkerArray($subparts['HEADER_INCLUDE_VAT_WRAPPER'], $markerArray, '###|###');
     } else {
         $markerArray['LABEL_HEADER_ITEM_FINAL_PRICE'] = $this->pi_getLL('final_price_ex_vat');
         $subpartArray['###HEADER_EXCLUDE_VAT_WRAPPER###'] = $this->cObj->substituteMarkerArray($subparts['HEADER_EXCLUDE_VAT_WRAPPER'], $markerArray, '###|###');
     }
     // template wrapper
     // removal start
     $subpartsTemplateWrapperRemove = array();
     if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
         $subpartsTemplateWrapperRemove['###HEADER_EXCLUDE_VAT_WRAPPER###'] = '';
         $subpartsTemplateWrapperRemove['###SUBTOTAL_EXCLUDE_VAT_WRAPPER###'] = '';
     } else {
         $subpartsTemplateWrapperRemove['###HEADER_INCLUDE_VAT_WRAPPER###'] = '';
         $subpartsTemplateWrapperRemove['###SUBTOTAL_INCLUDE_VAT_WRAPPER###'] = '';
         $subpartsTemplateWrapperRemove['###TOTAL_VAT_ROW_INCLUDE_VAT###'] = '';
         if ($order['orders_tax_data']['shipping_tax'] || $order['orders_tax_data']['payment_tax']) {
             $subpartsTemplateWrapperRemove['###TOTAL_VAT_ROW_EXCLUDE_VAT_NO_SHIPPING_PAYMENT_TAX###'] = '';
         } else {
             $subpartsTemplateWrapperRemove['###TOTAL_VAT_ROW_EXCLUDE_VAT_HAVE_SHIPPING_PAYMENT_TAX###'] = '';
         }
     }
     if ($order['discount'] > -1 && $order['discount'] < 0.01) {
         $subpartsTemplateWrapperRemove['###DISCOUNT_WRAPPER###'] = '';
         $subpartsTemplateWrapperRemove['###NEWSUBTOTAL_WRAPPER###'] = '';
     }
     if (!empty($subparts['SINGLE_SHIPPING_PACKING_COSTS_WRAPPER'])) {
         $subpartsTemplateWrapperRemove['###SHIPPING_COSTS_WRAPPER###'] = '';
         $subpartsTemplateWrapperRemove['###PAYMENT_COSTS_WRAPPER###'] = '';
     }
     if (!$order['shipping_method_costs']) {
         // If shipping method costs are zero, then remove the whole subpart
         $subpartsTemplateWrapperRemove['###SHIPPING_COSTS_WRAPPER###'] = '';
     }
     if (!$order['payment_method_costs']) {
         // If payment method costs are zero, then remove the whole subpart
         $subpartsTemplateWrapperRemove['###PAYMENT_COSTS_WRAPPER###'] = '';
     }
     $subparts['template'] = $this->cObj->substituteMarkerArrayCached($subparts['template'], array(), $subpartsTemplateWrapperRemove);
     // items wrapper
     $subpartsItemsWrapperRemove = array();
     if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
         $subpartsItemsWrapperRemove['###ITEM_EXCLUDE_VAT_WRAPPER###'] = '';
     } else {
         $subpartsItemsWrapperRemove['###ITEM_INCLUDE_VAT_WRAPPER###'] = '';
     }
     $subparts['ITEM_WRAPPER'] = $this->cObj->substituteMarkerArrayCached($subparts['ITEM_WRAPPER'], array(), $subpartsItemsWrapperRemove);
     // item attributes wrapper
     $subpartsItemAttributesWrapperRemove = array();
     if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
         $subpartsItemAttributesWrapperRemove['###ITEM_ATTRIBUTE_EXCLUDE_VAT_WRAPPER###'] = '';
     } else {
         $subpartsItemAttributesWrapperRemove['###ITEM_ATTRIBUTE_INCLUDE_VAT_WRAPPER###'] = '';
     }
     $subparts['ITEM_ATTRIBUTES_WRAPPER'] = $this->cObj->substituteMarkerArrayCached($subparts['ITEM_ATTRIBUTES_WRAPPER'], array(), $subpartsItemAttributesWrapperRemove);
     // removal eol
     // tax subparts
     $subparts['TOTAL_VAT_ROW_EXCLUDE_VAT_NO_SHIPPING_PAYMENT_TAX'] = $this->cObj->getSubpart($subparts['template'], '###TOTAL_VAT_ROW_EXCLUDE_VAT_NO_SHIPPING_PAYMENT_TAX###');
     $subparts['TOTAL_VAT_ROW_EXCLUDE_VAT_HAVE_SHIPPING_PAYMENT_TAX'] = $this->cObj->getSubpart($subparts['template'], '###TOTAL_VAT_ROW_EXCLUDE_VAT_HAVE_SHIPPING_PAYMENT_TAX###');
     $subparts['TOTAL_VAT_ROW_INCLUDE_VAT'] = $this->cObj->getSubpart($subparts['template'], '###TOTAL_VAT_ROW_INCLUDE_VAT###');
     //print_r($subparts);
     //die();
     $total_tax = 0;
     $tr_type = 'even';
     $od_rows_count = 0;
     $product_counter = 1;
     $real_prefix = $prefix;
     if (is_array($order['products']) && count($order['products'])) {
         $contentItem = '';
         foreach ($order['products'] as $product) {
             $markerArray = array();
             $markerArray['ITEM_COUNTER'] = $product_counter;
             $od_rows_count++;
             if (!$tr_type or $tr_type == 'even') {
                 $tr_type = 'odd';
             } else {
                 $tr_type = 'even';
             }
             $markerArray['ITEM_ROW_TYPE'] = $tr_type;
             $markerArray['ITEM_PRODUCT_QTY'] = round($product['qty'], 2);
             $product_tmp = mslib_fe::getProduct($product['products_id']);
             $product_name = htmlspecialchars($product['products_name']);
             if ($product['products_article_number']) {
                 $product_name .= ' (' . htmlspecialchars($product['products_article_number']) . ')';
             }
             if ($this->ms['MODULES']['DISPLAY_SKU_IN_ORDER_DETAILS'] == '1' && !empty($product['sku_code'])) {
                 $product_name .= '<br/>' . htmlspecialchars($this->pi_getLL('admin_label_sku')) . ': ' . htmlspecialchars($product['sku_code']);
             }
             if ($this->ms['MODULES']['DISPLAY_PRODUCTS_MODEL_IN_ORDER_DETAILS'] == '1' && !empty($product['products_model'])) {
                 $product_name .= '<br/>Model: ' . htmlspecialchars($product['products_model']);
             }
             if ($product['products_description']) {
                 $product_name .= '<br/>' . nl2br(htmlspecialchars($product['products_description']));
             }
             if ($this->ms['MODULES']['DISPLAY_EAN_IN_ORDER_DETAILS'] == '1' && !empty($product['ean_code'])) {
                 $product_name .= '<br/>' . htmlspecialchars($this->pi_getLL('admin_label_ean')) . ': ' . htmlspecialchars($product['ean_code']);
             }
             if ($this->ms['MODULES']['DISPLAY_VENDOR_IN_ORDER_DETAILS'] == '1' && !empty($product['vendor_code'])) {
                 $product_name .= '<br/>' . htmlspecialchars($this->pi_getLL('admin_label_vendor_code')) . ': ' . htmlspecialchars($product['vendor_code']);
             }
             $markerArray['ITEM_PRODUCT_NAME'] = $product_name;
             // Seperate marker version
             $markerArray['ITEM_SEPERATE_PRODUCTS_NAME'] = htmlspecialchars($product['products_name']);
             $markerArray['ITEM_SEPERATE_PRODUCTS_DESCRIPTION'] = nl2br(htmlspecialchars($product['products_description']));
             $markerArray['ITEM_SEPERATE_PRODUCTS_MODEL'] = htmlspecialchars($product['products_model']);
             // Seperate marker version eol
             $markerArray['ITEM_VAT'] = str_replace('.00', '', number_format($product['products_tax'], 2)) . '%';
             $markerArray['ITEM_ORDER_UNIT'] = $product['order_unit_name'];
             // ITEM IMAGE
             $image_path = mslib_befe::getImagePath($product_tmp['products_image'], 'products', '50');
             if (isset($product_tmp['products_image']) && !empty($product_tmp['products_image'])) {
                 if (!strstr(mslib_befe::strtolower($product_tmp['products_image']), 'http://') and !strstr(mslib_befe::strtolower($product_tmp['products_image']), 'https://')) {
                     $product_tmp['products_image'] = $image_path;
                 }
                 $markerArray['ITEM_IMAGE'] = '<img src="' . $product_tmp['products_image'] . '" title="' . htmlspecialchars($product['products_name']) . '">';
             } else {
                 $markerArray['ITEM_IMAGE'] = '<div class="no_image_50"></div>';
             }
             if ($table_type == 'invoice' && $prefix == '-') {
                 if (strpos($product['final_price'], '-') !== false) {
                     $product['final_price'] = str_replace('-', '', $product['final_price']);
                 } else {
                     $product['final_price'] = $prefix . $product['final_price'];
                 }
             }
             if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
                 $markerArray['ITEM_NORMAL_PRICE'] = mslib_fe::amount2Cents($product['final_price'] + $product['products_tax_data']['total_tax'], $customer_currency, $display_currency_symbol, 0);
                 $markerArray['ITEM_FINAL_PRICE'] = mslib_fe::amount2Cents($product['qty'] * ($product['final_price'] + $product['products_tax_data']['total_tax']), $customer_currency, $display_currency_symbol, 0);
             } else {
                 $markerArray['ITEM_NORMAL_PRICE'] = mslib_fe::amount2Cents($product['final_price'], $customer_currency, $display_currency_symbol, 0);
                 $markerArray['ITEM_FINAL_PRICE'] = mslib_fe::amount2Cents($product['qty'] * $product['final_price'], $customer_currency, $display_currency_symbol, 0);
             }
             $markerArray['ITEM_DISCOUNT_AMOUNT'] = '';
             if ($displayDiscountColumn) {
                 $markerArray['ITEM_DISCOUNT_AMOUNT'] = '<td align="right" class="cell_products_normal_price">' . mslib_fe::amount2Cents($product['discount_amount'], 0) . '</td>';
                 if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
                     $markerArray['ITEM_DISCOUNT_AMOUNT'] = '<td align="right" class="cell_products_normal_price">' . mslib_fe::amount2Cents($product['discount_amount'] + $product['discount_amount'] * $product['products_tax'] / 100, 0) . '</td>';
                     $markerArray['ITEM_NORMAL_PRICE'] = mslib_fe::amount2Cents($product['final_price'] + $product['final_price'] * $product['products_tax'] / 100, $customer_currency, $display_currency_symbol, 0);
                     //$markerArray['ITEM_FINAL_PRICE'] = mslib_fe::amount2Cents($prefix . (($product['final_price'] - $product['discount_amount']) + $product['products_tax_data']['total_tax']), $customer_currency, $display_currency_symbol, 0);
                     $markerArray['ITEM_FINAL_PRICE'] = mslib_fe::amount2Cents($product['final_price'] + $product['products_tax_data']['total_tax'], $customer_currency, $display_currency_symbol, 0);
                 } else {
                     $markerArray['ITEM_NORMAL_PRICE'] = mslib_fe::amount2Cents($product['final_price'], $customer_currency, $display_currency_symbol, 0);
                     //$markerArray['ITEM_FINAL_PRICE'] = mslib_fe::amount2Cents($prefix . ($product['qty'] * ($product['final_price'] - $product['discount_amount'])), $customer_currency, $display_currency_symbol, 0);
                     $markerArray['ITEM_FINAL_PRICE'] = mslib_fe::amount2Cents($product['qty'] * $product['final_price'], $customer_currency, $display_currency_symbol, 0);
                 }
             }
             //hook to let other plugins further manipulate the replacers
             if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['printInvoiceOrderDetailsTableProductIteratorPostProc'])) {
                 $params_internal = array('markerArray' => &$markerArray, 'table_type' => $table_type, 'product' => $product_tmp, 'order_product' => $product);
                 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['printInvoiceOrderDetailsTableProductIteratorPostProc'] as $funcRef) {
                     \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params_internal, $this);
                 }
             }
             $append_attributes_label_to_product_name = false;
             if (empty($subparts['ITEM_ATTRIBUTES_WRAPPER'])) {
                 $append_attributes_label_to_product_name = true;
             } else {
                 $contentItem .= $this->cObj->substituteMarkerArray($subparts['ITEM_WRAPPER'], $markerArray, '###|###');
             }
             if (is_array($product['attributes']) && count($product['attributes'])) {
                 foreach ($product['attributes'] as $tmpkey => $options) {
                     if ($options['products_options_values']) {
                         if ($table_type == 'invoice' && $prefix == '-') {
                             if (strpos($options['options_values_price'], '-') !== false) {
                                 $options['options_values_price'] = str_replace('-', '', $options['options_values_price']);
                             } else {
                                 $options['options_values_price'] = $prefix . $options['options_values_price'];
                             }
                         }
                         $attributeMarkerArray = array();
                         $attributeMarkerArray['ITEM_ATTRIBUTE_ROW_TYPE'] = $tr_type;
                         $attributeMarkerArray['ITEM_ATTRIBUTE'] = '';
                         if ($options['products_options'] && $options['products_options_values']) {
                             if ($append_attributes_label_to_product_name) {
                                 $markerArray['ITEM_PRODUCT_NAME'] .= ' <br />' . $options['products_options'] . ': ' . $options['products_options_values'];
                             }
                             $attributeMarkerArray['ITEM_ATTRIBUTE'] = htmlspecialchars($options['products_options']) . ': ' . htmlspecialchars($options['products_options_values']);
                         }
                         $attributeMarkerArray['ITEM_ATTRIBUTE_VAT'] = '';
                         // calculating
                         $od_rows_count++;
                         $cell_products_normal_price = '';
                         $cell_products_vat = '';
                         $cell_products_final_price = '';
                         if ($options['options_values_price'] > 0) {
                             if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
                                 $attributes_price = $options['price_prefix'] . $options['options_values_price'] + $options['attributes_tax_data']['tax'];
                                 $total_attributes_price = $attributes_price * $product['qty'];
                                 $cell_products_normal_price = mslib_fe::amount2Cents($attributes_price, $customer_currency, $display_currency_symbol, 0);
                                 $cell_products_final_price = mslib_fe::amount2Cents($total_attributes_price, $customer_currency, $display_currency_symbol, 0);
                             } else {
                                 $cell_products_normal_price = mslib_fe::amount2Cents($options['price_prefix'] . $options['options_values_price'], $customer_currency, $display_currency_symbol, 0);
                                 $cell_products_final_price = mslib_fe::amount2Cents(($options['price_prefix'] . $options['options_values_price']) * $product['qty'], $customer_currency, $display_currency_symbol, 0);
                             }
                         }
                         $attributeMarkerArray['ITEM_ATTRIBUTE_NORMAL_PRICE'] = $cell_products_normal_price;
                         $attributeMarkerArray['ITEM_ATTRIBUTE_DISCOUNT_AMOUNT'] = '';
                         if ($displayDiscountColumn) {
                             $attributeMarkerArray['ITEM_ATTRIBUTE_DISCOUNT_AMOUNT'] = '<td align="right" class="cell_products_normal_price">&nbsp;</td>';
                         }
                         $attributeMarkerArray['ITEM_ATTRIBUTE_FINAL_PRICE'] = $cell_products_final_price;
                     }
                     $contentItem .= $this->cObj->substituteMarkerArray($subparts['ITEM_ATTRIBUTES_WRAPPER'], $attributeMarkerArray, '###|###');
                 }
             }
             if (empty($subparts['ITEM_ATTRIBUTES_WRAPPER'])) {
                 $contentItem .= $this->cObj->substituteMarkerArray($subparts['ITEM_WRAPPER'], $markerArray, '###|###');
             }
             $subpartArray['###ITEM_ATTRIBUTES_WRAPPER###'] = '';
             // count the vat
             if ($order['final_price'] and $order['products_tax']) {
                 $item_tax = $order['qty'] * ($order['final_price'] * $order['products_tax'] / 100);
                 $total_tax = $total_tax + $item_tax;
             }
             $product_counter++;
         }
     } else {
         $subpartArray['###ITEM_ATTRIBUTES_WRAPPER###'] = '';
     }
     $subpartArray['###ITEM_WRAPPER###'] = $contentItem;
     if ($table_type == 'invoice' && $prefix == '-') {
         if (strpos($order['shipping_method_costs'], '-') !== false) {
             $prefix = '';
             $order['shipping_method_costs'] = str_replace('-', '', $order['shipping_method_costs']);
             $order['orders_tax_data']['shipping_tax'] = str_replace('-', '', $order['orders_tax_data']['shipping_tax']);
         } else {
             $prefix = '-';
         }
         if (strpos($order['payment_method_costs'], '-') !== false) {
             $prefix = '';
             $order['payment_method_costs'] = str_replace('-', '', $order['payment_method_costs']);
             $order['orders_tax_data']['payment_tax'] = str_replace('-', '', $order['orders_tax_data']['payment_tax']);
         } else {
             $prefix = '-';
         }
         if (strpos($order['orders_tax_data']['sub_total'], '-') !== false) {
             $prefix = '';
             $order['orders_tax_data']['sub_total'] = str_replace('-', '', $order['orders_tax_data']['sub_total']);
         } else {
             $prefix = '-';
         }
         if (strpos($order['subtotal_amount'], '-') !== false) {
             $prefix = '';
             $order['subtotal_amount'] = str_replace('-', '', $order['subtotal_amount']);
         } else {
             $prefix = '-';
         }
         if (strpos($order['discount'], '-') !== false) {
             $prefix = '';
             $order['discount'] = str_replace('-', '', $order['discount']);
         } else {
             $prefix = '-';
         }
         if (strpos($order['orders_tax_data']['grand_total'], '-') !== false) {
             $prefix = '';
             $order['orders_tax_data']['grand_total'] = str_replace('-', '', $order['orders_tax_data']['grand_total']);
         } else {
             $prefix = '-';
         }
     }
     if (!empty($subparts['SINGLE_SHIPPING_PACKING_COSTS_WRAPPER'])) {
         /*
         * special subparts
         <!-- ###SINGLE_SHIPPING_PACKING_COSTS_WRAPPER### begin -->
         				<tr class="###ITEM_SHIPPING_PAYMENT_COSTS_ROW_TYPE###">
         					<td align="right" class="cell_products_counter valign_top">###ITEM_SHIPPING_PAYMENT_COSTS_COUNTER###</td>
         					<td align="left" class="cell_products_name valign_top">###ITEM_SHIPPING_PAYMENT_COSTS_LABEL###</td>
         					<td align="right" class="cell_products_normal_price valign_top">###ITEM_SHIPPING_PAYMENT_COSTS_NORMAL_PRICE###</td>
         					<td align="right" class="cell_products_vat valign_top">###ITEM_SHIPPING_PAYMENT_COSTS_VAT###</td>
         					<td align="right" class="cell_products_final_price valign_top">###ITEM_SHIPPING_PAYMENT_COSTS_FINAL_PRICE###</td>
         				</tr>
         				<!-- ###SINGLE_SHIPPING_PACKING_COSTS_WRAPPER### end -->
         */
         $shipping_payment_costs_line = '';
         // payment costs
         if (!$tr_type or $tr_type == 'even') {
             $tr_type = 'odd';
         } else {
             $tr_type = 'even';
         }
         $payment_tax_rate = '-';
         if (!empty($order['orders_tax_data']['payment_total_tax_rate'])) {
             $payment_tax_rate = $order['orders_tax_data']['payment_total_tax_rate'] * 100 . '%';
         }
         $markerArray = array();
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_COUNTER'] = $product_counter;
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_LABEL'] = $this->pi_getLL('payment_costs') . ' (' . $order['payment_method_label'] . ')';
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_ROW_TYPE'] = $tr_type;
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_VAT'] = $payment_tax_rate;
         $payment_costs = '0';
         if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
             if ($order['payment_method_costs'] !== 0) {
                 $payment_costs = $prefix . ($order['payment_method_costs'] + $order['orders_tax_data']['payment_tax']);
             }
         } else {
             if ($order['payment_method_costs'] !== 0) {
                 $payment_costs = $prefix . $order['payment_method_costs'];
             }
         }
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_NORMAL_PRICE'] = mslib_fe::amount2Cents($payment_costs, $customer_currency, $display_currency_symbol, 0);
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_FINAL_PRICE'] = mslib_fe::amount2Cents($payment_costs, $customer_currency, $display_currency_symbol, 0);
         $shipping_payment_costs_line .= $this->cObj->substituteMarkerArray($subparts['SINGLE_SHIPPING_PACKING_COSTS_WRAPPER'], $markerArray, '###|###');
         $product_counter++;
         // shipping costs
         if (!$tr_type or $tr_type == 'even') {
             $tr_type = 'odd';
         } else {
             $tr_type = 'even';
         }
         $shipping_tax_rate = '0%';
         if (!empty($order['orders_tax_data']['shipping_total_tax_rate'])) {
             $shipping_tax_rate = $order['orders_tax_data']['shipping_total_tax_rate'] * 100 . '%';
         }
         $markerArray = array();
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_COUNTER'] = $product_counter;
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_LABEL'] = $this->pi_getLL('shipping_costs') . ' (' . $order['shipping_method_label'] . ')';
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_ROW_TYPE'] = $tr_type;
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_VAT'] = $shipping_tax_rate;
         $shipping_costs = '0';
         if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
             if ($order['shipping_method_costs'] !== 0) {
                 $shipping_costs = $prefix . ($order['shipping_method_costs'] + $order['orders_tax_data']['shipping_tax']);
             }
         } else {
             if ($order['shipping_method_costs'] !== 0) {
                 $shipping_costs = $prefix . $order['shipping_method_costs'];
             }
         }
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_NORMAL_PRICE'] = mslib_fe::amount2Cents($shipping_costs, $customer_currency, $display_currency_symbol, 0);
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_FINAL_PRICE'] = mslib_fe::amount2Cents($shipping_costs, $customer_currency, $display_currency_symbol, 0);
         $shipping_payment_costs_line .= $this->cObj->substituteMarkerArray($subparts['SINGLE_SHIPPING_PACKING_COSTS_WRAPPER'], $markerArray, '###|###');
         $product_counter++;
         $subpartArray['###SINGLE_SHIPPING_PACKING_COSTS_WRAPPER###'] = $shipping_payment_costs_line;
     }
     // bottom row
     // taxes row renderer
     $vat_wrapper_keys = array();
     $vat_wrapper_keys[] = 'TOTAL_VAT_ROW_INCLUDE_VAT';
     $vat_wrapper_keys[] = 'TOTAL_VAT_ROW_EXCLUDE_VAT_NO_SHIPPING_PAYMENT_TAX';
     $vat_wrapper_keys[] = 'TOTAL_VAT_ROW_EXCLUDE_VAT_HAVE_SHIPPING_PAYMENT_TAX';
     foreach ($vat_wrapper_keys as $vat_wrapper_key) {
         if (!empty($subparts[$vat_wrapper_key])) {
             $vatItem = '';
             if (isset($order['orders_tax_data']['tax_separation']) && count($order['orders_tax_data']['tax_separation']) && !$order['discount']) {
                 foreach ($order['orders_tax_data']['tax_separation'] as $tax_sep_rate => $tax_sep_data) {
                     $markerArray = array();
                     if (isset($tax_sep_rate)) {
                         // If TAX seperation has only 1 entry always print it (0% TAX for example)
                         // Else only print the current TAX rate if it is higher than zero
                         if (count($order['orders_tax_data']['tax_separation']) == 1 || count($order['orders_tax_data']['tax_separation']) > 1 && $tax_sep_rate > 0) {
                             if (empty($tax_sep_data['shipping_tax'])) {
                                 $tax_sep_data['shipping_tax'] = 0;
                             }
                             if (empty($tax_sep_data['payment_tax'])) {
                                 $tax_sep_data['payment_tax'] = 0;
                             }
                             if ($table_type == 'invoice' && $real_prefix == '-') {
                                 if (strpos($tax_sep_data['products_total_tax'], '-') !== false) {
                                     $prefix = '';
                                     $tax_sep_data['products_total_tax'] = str_replace('-', '', $tax_sep_data['products_total_tax']);
                                     $tax_sep_data['shipping_tax'] = str_replace('-', '', $tax_sep_data['shipping_tax']);
                                     $tax_sep_data['payment_tax'] = str_replace('-', '', $tax_sep_data['payment_tax']);
                                 } else {
                                     $prefix = '-';
                                 }
                             }
                             $tax_sep_total = $prefix . ($tax_sep_data['products_total_tax'] + $tax_sep_data['shipping_tax'] + $tax_sep_data['payment_tax']);
                             if (count($order['orders_tax_data']['tax_separation']) == 1 || $tax_sep_total > 0) {
                                 // only print TAX rate if there is only 1 seperation OR if there are multiple seperations where each seperation amount is higher than 0
                                 if ($vat_wrapper_key == 'TOTAL_VAT_ROW_INCLUDE_VAT') {
                                     $markerArray['LABEL_INCLUDED_VAT_AMOUNT'] = $this->pi_getLL('included_vat_amount') . ' ' . $tax_sep_rate . '%';
                                 } else {
                                     // todo: add typoscript constant to enable/disable the view
                                     // Show the taken amount for the seperated VAT (i.e. BTW 21% from 10 Euro)
                                     //$markerArray['LABEL_VAT']=sprintf($this->pi_getLL('vat_nn_from_subtotal_nn'), $tax_sep_rate.'%', ($display_currency_symbol ? '' : 'EUR ').mslib_fe::amount2Cents($prefix.($tax_sep_data['products_sub_total_excluding_vat']+$tax_sep_data['shipping_costs']+$tax_sep_data['payment_costs']), $customer_currency, $display_currency_symbol, 0));
                                     // Show traditional label (i.e. BTW 21%)
                                     $markerArray['LABEL_VAT'] = $this->pi_getLL('vat') . ' ' . $tax_sep_rate . '%';
                                 }
                                 $markerArray['TOTAL_VAT'] = mslib_fe::amount2Cents($tax_sep_total, $customer_currency, $display_currency_symbol, 0);
                                 $vatItem .= $this->cObj->substituteMarkerArray($subparts[$vat_wrapper_key], $markerArray, '###|###');
                             }
                         }
                     }
                 }
             } else {
                 $markerArray = array();
                 if ($vat_wrapper_key == 'TOTAL_VAT_ROW_INCLUDE_VAT') {
                     $markerArray['LABEL_INCLUDED_VAT_AMOUNT'] = $this->pi_getLL('included_vat_amount');
                 } else {
                     $markerArray['LABEL_VAT'] = $this->pi_getLL('vat');
                 }
                 if ($table_type == 'invoice' && $real_prefix == '-') {
                     if (strpos($order['orders_tax_data']['total_orders_tax'], '-') !== false) {
                         $prefix = '';
                         $order['orders_tax_data']['total_orders_tax'] = str_replace('-', '', $order['orders_tax_data']['total_orders_tax']);
                     } else {
                         $prefix = '-';
                     }
                 }
                 $markerArray['TOTAL_VAT'] = mslib_fe::amount2Cents($prefix . $order['orders_tax_data']['total_orders_tax'], $customer_currency, $display_currency_symbol, 0);
                 $vatItem .= $this->cObj->substituteMarkerArray($subparts[$vat_wrapper_key], $markerArray, '###|###');
             }
             $subpartArray['###' . $vat_wrapper_key . '###'] = $vatItem;
             break;
         }
     }
     $hr_colspan = 3;
     $colspan = 5;
     if ($displayDiscountColumn) {
         $hr_colspan = 4;
         $colspan = 6;
     }
     $subpartArray['###INVOICE_HR_COLSPAN###'] = $hr_colspan;
     $subpartArray['###INVOICE_TOTAL_COLSPAN###'] = $colspan;
     $subpartArray['###LABEL_SUBTOTAL###'] = $this->pi_getLL('sub_total');
     //$subpartArray['###LABEL_VAT###']=$this->pi_getLL('vat');
     $subpartArray['###LABEL_SHIPPING_COSTS###'] = $this->pi_getLL('shipping_costs');
     $subpartArray['###LABEL_PAYMENT_COSTS###'] = $this->pi_getLL('payment_costs');
     $subpartArray['###LABEL_PAYMENT_COSTS###'] = $this->pi_getLL('payment_costs');
     if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
         if (!empty($subparts['SINGLE_SHIPPING_PACKING_COSTS_WRAPPER'])) {
             $subpartArray['###SUBTOTAL###'] = mslib_fe::amount2Cents($prefix . ($order['orders_tax_data']['sub_total'] + $shipping_costs + $payment_costs), $customer_currency, $display_currency_symbol, 0);
             $subpartArray['###SUBTOTAL_EXTRA###'] = mslib_fe::amount2Cents($prefix . ($order['orders_tax_data']['sub_total'] + $shipping_costs + $payment_costs), $customer_currency, $display_currency_symbol, 0);
         } else {
             $subpartArray['###SUBTOTAL###'] = mslib_fe::amount2Cents($prefix . $order['orders_tax_data']['sub_total'], $customer_currency, $display_currency_symbol, 0);
             $subpartArray['###SUBTOTAL_EXTRA###'] = mslib_fe::amount2Cents($prefix . $order['orders_tax_data']['sub_total'], $customer_currency, $display_currency_symbol, 0);
         }
         //$subpartArray['###TOTAL_VAT###']=mslib_fe::amount2Cents($prefix.($order['orders_tax_data']['total_orders_tax']), 0,$display_currency_symbol,0);
         $subpartArray['###TOTAL_SHIPPING_COSTS###'] = mslib_fe::amount2Cents($prefix . ($order['shipping_method_costs'] + $order['orders_tax_data']['shipping_tax']), $customer_currency, $display_currency_symbol, 0);
         $subpartArray['###TOTAL_PAYMENT_COSTS###'] = mslib_fe::amount2Cents($prefix . ($order['payment_method_costs'] + $order['orders_tax_data']['payment_tax']), $customer_currency, $display_currency_symbol, 0);
     } else {
         if (!empty($subparts['SINGLE_SHIPPING_PACKING_COSTS_WRAPPER'])) {
             $subpartArray['###SUBTOTAL###'] = mslib_fe::amount2Cents($prefix . ($order['subtotal_amount'] + $shipping_costs + $payment_costs), $customer_currency, $display_currency_symbol, 0);
             $subpartArray['###SUBTOTAL_EXTRA###'] = mslib_fe::amount2Cents($prefix . ($order['subtotal_amount'] + $shipping_costs + $payment_costs), $customer_currency, $display_currency_symbol, 0);
         } else {
             $subpartArray['###SUBTOTAL###'] = mslib_fe::amount2Cents($prefix . $order['subtotal_amount'], $customer_currency, $display_currency_symbol, 0);
             $subpartArray['###SUBTOTAL_EXTRA###'] = mslib_fe::amount2Cents($prefix . $order['subtotal_amount'], $customer_currency, $display_currency_symbol, 0);
         }
         //$subpartArray['###TOTAL_VAT###']=mslib_fe::amount2Cents($prefix.($order['orders_tax_data']['total_orders_tax']), 0,$display_currency_symbol,0);
         $subpartArray['###TOTAL_SHIPPING_COSTS###'] = mslib_fe::amount2Cents($prefix . $order['shipping_method_costs'], $customer_currency, $display_currency_symbol, 0);
         $subpartArray['###TOTAL_PAYMENT_COSTS###'] = mslib_fe::amount2Cents($prefix . $order['payment_method_costs'], $customer_currency, $display_currency_symbol, 0);
     }
     if ($order['discount'] < 0 || $order['discount'] > 0) {
         $subpartArray['###LABEL_DISCOUNT###'] = $this->pi_getLL('discount');
         $subpartArray['###TOTAL_DISCOUNT###'] = mslib_fe::amount2Cents($prefix . $order['discount'], $customer_currency, $display_currency_symbol, 0);
         //
         $subpartArray['###PRODUCTS_NEWSUB_TOTAL_PRICE_LABEL###'] = $this->pi_getLL('subtotal');
         $subpartArray['###PRODUCTS_NEWTOTAL_PRICE###'] = mslib_fe::amount2Cents($order['subtotal_amount'] - $order['discount'], $customer_currency, $display_currency_symbol, 0);
     }
     //$subpartArray['###LABEL_INCLUDED_VAT_AMOUNT###']=$this->pi_getLL('included_vat_amount');
     $subpartArray['###LABEL_GRAND_TOTAL_EXCLUDING_VAT###'] = $this->pi_getLL('grand_total_excluding_vat') . ' ';
     $subpartArray['###GRAND_TOTAL_EXCLUDING_VAT###'] = mslib_fe::amount2Cents($prefix . $order['orders_tax_data']['grand_total_excluding_vat'], $customer_currency, $display_currency_symbol, 0);
     $subpartArray['###LABEL_GRAND_TOTAL###'] = $this->pi_getLL('total');
     $subpartArray['###GRAND_TOTAL###'] = mslib_fe::amount2Cents($prefix . $order['orders_tax_data']['grand_total'], $customer_currency, $display_currency_symbol, 0);
     $tmpcontent = $this->cObj->substituteMarkerArrayCached($subparts['template'], null, $subpartArray);
     return $tmpcontent;
 }
                 if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry2) > 0) {
                     $tmpcontent .= 'checked';
                 }
                 $tmpcontent .= ' /><label></label></div></td>';
             }
             $tmpcontent .= '</tr>';
         }
         $tmpcontent .= '</table>';
         $tmpcontent .= '<input name="param" type="hidden" value="update_mapping" /></form>';
     } else {
         $tmpcontent .= $this->pi_getLL('admin_label_currently_no_payment_method_defined');
     }
 } else {
     $tmpcontent .= $this->pi_getLL('admin_label_currently_no_payment_method_defined');
 }
 $tabs[] = array('label' => ucfirst(mslib_befe::strtolower($this->pi_getLL('payment_to_shipping_mapping'))), 'id' => 'admin_shipping_payment_mappings', 'content' => mslib_fe::returnBoxedHTML(ucfirst(mslib_befe::strtolower($this->pi_getLL('payment_to_shipping_mapping'))), $tmpcontent));
 // render the tabs
 $tab_button = '';
 $tab_content = '';
 foreach ($tabs as $tab) {
     $tab_button .= '<li role="presentation"><a href="#' . $tab['id'] . '" aria-controls="profile" role="tab" data-toggle="tab">' . $tab['label'] . '</a></li>';
     $tab_content .= '<div id="' . $tab['id'] . '" class="tab-pane">';
     $tab_content .= $tab['content'];
     $tab_content .= '</div>';
 }
 $tabs_element = '<div class="panel panel-default"><div class="panel-body"><div id="tab-container">';
 $tabs_element .= '<ul class="nav nav-tabs" id="admin_orders" role="tablist">';
 $tabs_element .= $tab_button;
 $tabs_element .= '</ul>';
 $tabs_element .= '<div class="tab-content">';
 $tabs_element .= $tab_content;
Example #7
0
        $country_block = '';
        $delivery_country_block = '';
        if (count($enabled_countries) == 1) {
            $country_block .= '<input name="country" type="hidden" value="' . mslib_befe::strtolower($enabled_countries[0]['cn_short_en']) . '" />';
            $delivery_country_block .= '<input name="delivery_country" type="hidden" value="' . mslib_befe::strtolower($enabled_countries[0]['cn_short_en']) . '" />';
        } else {
            $default_country = mslib_fe::getCountryByIso($this->ms['MODULES']['COUNTRY_ISO_NR']);
            if (!$user['country']) {
                $user['country'] = $default_country['cn_short_en'];
            }
            if (!$user['delivery_country']) {
                $user['delivery_country'] = $default_country['cn_short_en'];
            }
            foreach ($enabled_countries as $country) {
                $tmpcontent_con .= '<option value="' . mslib_befe::strtolower($country['cn_short_en']) . '" ' . (mslib_befe::strtolower($user['country']) == mslib_befe::strtolower($country['cn_short_en']) ? 'selected' : '') . '>' . htmlspecialchars(mslib_fe::getTranslatedCountryNameByEnglishName($this->lang, $country['cn_short_en'])) . '</option>';
                $tmpcontent_con_delivery .= '<option value="' . mslib_befe::strtolower($country['cn_short_en']) . '" ' . (mslib_befe::strtolower($user['delivery_country']) == mslib_befe::strtolower($country['cn_short_en']) ? 'selected' : '') . '>' . htmlspecialchars(mslib_fe::getTranslatedCountryNameByEnglishName($this->lang, $country['cn_short_en'])) . '</option>';
            }
            if ($tmpcontent_con) {
                $country_block .= '
				<div class="account-field col-sm-' . ($this->conf['multistep_checkout_address_tmpl_path'] ? '12' : '8') . '" id="input-country">
					<label for="country" id="account-country">' . ucfirst($this->pi_getLL('country')) . '*</label>
					<select name="country" id="country" class="country" required="required" data-h5-errorid="invalid-country" title="' . $this->pi_getLL('country_is_required') . '">
						<option value="">' . ucfirst($this->pi_getLL('choose_country')) . '</option>
						' . $tmpcontent_con . '
					</select>
					<div id="invalid-country" class="error-space" style="display:none"></div>
		        </div>
				';
            }
        }
        // country eof
    function renderInterface($params, &$that)
    {
        mslib_fe::init($that);
        if ($that->post['job_id']) {
            $that->get['job_id'] = $that->post['job_id'];
        }
        if ($that->get['delete'] and is_numeric($that->get['job_id'])) {
            // delete job
            $query = $GLOBALS['TYPO3_DB']->DELETEquery('tx_multishop_import_jobs', 'id=' . $that->get['job_id'] . ' and type=\'' . addslashes($params['importKey']) . '\'');
            $res = $GLOBALS['TYPO3_DB']->sql_query($query);
        }
        if (is_numeric($that->get['job_id']) and is_numeric($that->get['status'])) {
            // update the status of a job
            $updateArray = array();
            $updateArray['status'] = $that->get['status'];
            $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_import_jobs', 'id=\'' . $that->get['job_id'] . '\' and type=\'' . addslashes($params['importKey']) . '\'', $updateArray);
            $res = $GLOBALS['TYPO3_DB']->sql_query($query);
            // update the status of a job eof
        }
        if (isset($that->get['download']) && $that->get['download'] == 'task' && is_numeric($that->get['job_id'])) {
            $sql = $GLOBALS['TYPO3_DB']->SELECTquery('*', 'tx_multishop_import_jobs ', 'id= \'' . $that->get['job_id'] . '\'', '', '', '');
            $qry = $GLOBALS['TYPO3_DB']->sql_query($sql);
            if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry)) {
                $data = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry);
                $jobArray = $row;
                $serial_value = array();
                foreach ($data as $key_idx => $key_val) {
                    if ($key_idx != 'id' && $key_idx != 'page_uid') {
                        $serial_value[$key_idx] = $key_val;
                    }
                }
                $serial_data = '';
                if (count($serial_value) > 0) {
                    $serial_data = serialize($serial_value);
                }
                $filename = 'multishop_' . $params['importKey'] . '_import_task_' . date('YmdHis') . '_' . $that->get['job_id'] . '.txt';
                $filepath = $that->DOCUMENT_ROOT . 'uploads/tx_multishop/' . $filename;
                file_put_contents($filepath, $serial_data);
                header("Content-disposition: attachment; filename={$filename}");
                //Tell the filename to the browser
                header('Content-type: application/octet-stream');
                //Stream as a binary file! So it would force browser to download
                readfile($filepath);
                //Read and stream the file
                @unlink($filepath);
                exit;
            }
        }
        if (isset($that->get['upload']) && $that->get['upload'] == 'task' && $_FILES) {
            if (!$_FILES['task_file']['error']) {
                $filename = $_FILES['task_file']['name'];
                $target = $that->DOCUMENT_ROOT . '/uploads/tx_multishop' . $filename;
                if (move_uploaded_file($_FILES['task_file']['tmp_name'], $target)) {
                    $task_content = file_get_contents($target);
                    $unserial_task_data = unserialize($task_content);
                    $insertArray = array();
                    $insertArray['page_uid'] = $that->showCatalogFromPage;
                    foreach ($unserial_task_data as $col_name => $col_val) {
                        if ($col_name == 'code') {
                            $insertArray[$col_name] = md5(uniqid());
                        } else {
                            if ($col_name == 'name' && isset($that->post['new_cron_name']) && !empty($that->post['new_cron_name'])) {
                                $insertArray[$col_name] = $that->post['new_cron_name'];
                            } else {
                                if ($col_name == 'prefix_source_name' && isset($that->post['new_prefix_source_name']) && !empty($that->post['new_prefix_source_name'])) {
                                    $insertArray[$col_name] = $that->post['new_prefix_source_name'];
                                } else {
                                    $insertArray[$col_name] = $col_val;
                                }
                            }
                        }
                    }
                    $query = $GLOBALS['TYPO3_DB']->INSERTquery('tx_multishop_import_jobs', $insertArray);
                    $res = $GLOBALS['TYPO3_DB']->sql_query($query);
                    @unlink($target);
                }
            }
            header('Location: ' . $that->FULL_HTTP_URL . $params['postForm']['actionUrl'] . '#tasks');
        }
        $GLOBALS['TSFE']->additionalHeaderData['tx_multishop_pi1_block_ui'] = mslib_fe::jQueryBlockUI();
        if (is_numeric($that->post['job_id']) && $that->post['action'] == 'import-preview') {
            if ($that->post['job_id']) {
                $that->get['job_id'] = $that->post['job_id'];
            }
            $str = "SELECT * from tx_multishop_import_jobs where id='" . $that->post['job_id'] . "' and type='" . addslashes($params['importKey']) . "'";
            $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
            $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry);
            $jobArray = $row;
            $updateArray = array();
            $cron_data = array();
            $cron_data[0] = array();
            $that->post['cron_period'] = '';
            $cron_data[1] = $that->post;
            $updateArray['data'] = serialize($cron_data);
            $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_import_jobs', 'id=' . $that->post['job_id'], $updateArray);
            $res = $GLOBALS['TYPO3_DB']->sql_query($query);
        }
        if ($that->post['action'] == 'import-preview' or is_numeric($that->get['job_id']) and $_REQUEST['action'] == 'edit_job') {
            // preview
            if (is_numeric($that->get['job_id'])) {
                $that->ms['mode'] = 'edit';
                // load the job
                $str = "SELECT * from tx_multishop_import_jobs where id='" . $that->get['job_id'] . "' and type='" . addslashes($params['importKey']) . "'";
                $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
                $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry);
                $jobArray = $row;
                $data = unserialize($row['data']);
                // copy the previous post data to the current post so it can run the job
                // again
                $that->post = $data[1];
                $that->post['cid'] = $row['categories_id'];
                // enable file logging
                if ($that->get['relaxed_import']) {
                    $that->post['relaxed_import'] = $that->get['relaxed_import'];
                }
                // update the last run time
                $updateArray = array();
                $updateArray['last_run'] = time();
                $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_import_jobs', 'id=' . $row['id'], $updateArray);
                $res = $GLOBALS['TYPO3_DB']->sql_query($query);
                // update the last run time eof
            }
            if ($that->post['database_name']) {
                $file_location = $that->post['database_name'];
            } elseif ($that->post['file_url']) {
                if (strstr($that->post['file_url'], "../")) {
                    die;
                }
                $filename = time();
                $file_location = $that->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/' . $filename;
                $file_content = mslib_fe::file_get_contents($that->post['file_url']);
                if (!$file_content or !file_put_contents($file_location, $file_content)) {
                    die('cannot save the file or the file is empty');
                }
            } elseif ($that->ms['mode'] == 'edit') {
                $filename = $that->post['filename'];
                $file_location = $that->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/' . $filename;
            }
            if ($_FILES['file']['tmp_name']) {
                $file = $_FILES['file']['tmp_name'];
                $filename = time() . '.import';
                $file_location = $that->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/' . $filename;
                $that->post['filename'] = $filename;
                move_uploaded_file($file, $file_location);
                if (preg_match("/\\.gz\$/", $_FILES['file']['name'])) {
                    // lets uncompress realtime
                    $str = mslib_fe::file_get_contents($file_location, 1);
                    file_put_contents($file_location, $str);
                }
            }
            if ($this->ms['mode'] == 'edit' and is_array($data) and count($data) and $filename) {
                if ($filename) {
                    $data[1]['filename'] = $filename;
                    $this->post['filename'] = $filename;
                }
                $string = serialize($data);
                $updateArray = array();
                $updateArray['data'] = $string;
                $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_import_jobs', 'id=' . $_REQUEST['job_id'], $updateArray);
                $res = $GLOBALS['TYPO3_DB']->sql_query($query);
            }
            if ($file_location and $this->ms['mode'] == 'edit') {
                // if file not exists then show form to upload new file
                if (!file_exists($file_location)) {
                    $content .= '<h2>Feed no longer available</h2>' . $file_location . ' is not existing.';
                }
            }
            if (file_exists($file_location) or $that->post['database_name']) {
                if (!$that->post['database_name']) {
                    $str = mslib_fe::file_get_contents($file_location);
                }
                if ($that->post['parser_template']) {
                    $processed = 0;
                    $rows = array();
                } else {
                    if ($str && mslib_befe::isSerializedString($str)) {
                        $tmpData = unserialize($str);
                        $counter = 0;
                        foreach ($tmpData as $data) {
                            $colCounter = 0;
                            if ($counter == 0) {
                                $row = array();
                                foreach ($data as $key => $val) {
                                    $row[] = $key;
                                }
                                $table_cols = $row;
                            }
                            $row = array();
                            foreach ($data as $key => $val) {
                                $row[] = $val;
                            }
                            $rows[] = $row;
                            $counter++;
                            if ($counter == 5) {
                                break;
                            }
                        }
                    } elseif ($that->post['database_name']) {
                        if ($that->ms['mode'] == 'edit') {
                            $limit = 10;
                        } else {
                            $limit = '10';
                        }
                        if (strstr(mslib_befe::strtolower($that->post['database_name']), 'select ')) {
                            // its not a table name, its a full query
                            $that->databaseMode = 'query';
                            $str = $that->post['database_name'] . ' LIMIT ' . $limit;
                            $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
                            if ($that->conf['debugEnabled'] == '1') {
                                $logString = 'Load records for importer query: ' . $str;
                                \TYPO3\CMS\Core\Utility\GeneralUtility::devLog($logString, 'multishop', -1);
                            }
                            $datarows = array();
                            while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) != false) {
                                $datarows[] = $row;
                            }
                        } else {
                            $datarows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('*', $that->post['database_name'], '', '', '', $limit);
                        }
                        $i = 0;
                        $table_cols = array();
                        foreach ($datarows as $datarow) {
                            $s = 0;
                            foreach ($datarow as $colname => $datacol) {
                                $table_cols[$s] = $colname;
                                $rows[$i][$s] = $datacol;
                                $s++;
                            }
                            $i++;
                            if ($i == 5) {
                                break;
                            }
                        }
                    } elseif ($that->post['format'] == 'excel') {
                        if (!$that->ms['mode'] == 'edit') {
                            $filename = 'tmp-file-' . $GLOBALS['TSFE']->fe_user->user['uid'] . '-cat-' . $that->post['cid'] . '-' . time() . '.txt';
                            if (!($handle = fopen($that->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/' . $filename, 'w'))) {
                                exit;
                            }
                            if (fwrite($handle, $str) === false) {
                                exit;
                            }
                            fclose($handle);
                        }
                        // excel
                        $paths = array();
                        $paths[] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('phpexcel_service') . 'Resources/Private/Contributed/PHPExcel/IOFactory.php';
                        $paths[] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('phpexcel_service') . 'Classes/PHPExcel/IOFactory.php';
                        foreach ($paths as $path) {
                            if (file_exists($path)) {
                                require_once $path;
                                break;
                            }
                        }
                        $phpexcel = PHPExcel_IOFactory::load($file_location);
                        foreach ($phpexcel->getWorksheetIterator() as $worksheet) {
                            $counter = 0;
                            foreach ($worksheet->getRowIterator() as $row) {
                                $cellIterator = $row->getCellIterator();
                                $cellIterator->setIterateOnlyExistingCells(false);
                                foreach ($cellIterator as $cell) {
                                    $clean_products_data = ltrim(rtrim($cell->getCalculatedValue(), " ,"), " ,");
                                    $clean_products_data = trim($clean_products_data);
                                    if ($row->getRowIndex() > 1) {
                                        $rows[$counter - 1][] = $clean_products_data;
                                    } else {
                                        $table_cols[] = mslib_befe::strtolower($clean_products_data);
                                    }
                                }
                                $counter++;
                                if ($counter == 5) {
                                    break;
                                }
                            }
                        }
                        // excel eol
                    } elseif ($that->post['format'] == 'xml') {
                        // try the generic way
                        if (!$that->ms['mode'] == 'edit') {
                            $filename = 'tmp-file-' . $GLOBALS['TSFE']->fe_user->user['uid'] . '-cat-' . $that->post['cid'] . '-' . time() . '.txt';
                            if (!($handle = fopen($that->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/' . $filename, 'w'))) {
                                exit;
                            }
                            if (fwrite($handle, $str) === false) {
                                exit;
                            }
                            fclose($handle);
                        }
                        // try the generic way
                        $objXML = new xml2Array();
                        $arrOutput = $objXML->parse($str);
                        $i = 0;
                        $s = 0;
                        $rows = array();
                        foreach ($arrOutput[0]['children'] as $item) {
                            foreach ($item['children'] as $internalitem) {
                                $rows[$i][$s] = $internalitem['tagData'];
                                $s++;
                            }
                            //					foreach ($item['attrs'] as $key => $value)
                            //					{
                            //						$rows[$i][$s] = $value;
                            //						$s++;
                            //					}
                            $i++;
                            $s = 0;
                            if ($i == 5) {
                                break;
                            }
                        }
                    } else {
                        if ($that->post['os'] == 'linux') {
                            $splitter = "\n";
                        } else {
                            $splitter = "\r\n";
                        }
                        // csv
                        if ($that->post['delimiter'] == "tab") {
                            $delimiter = "\t";
                        } elseif ($that->post['delimiter'] == "dash") {
                            $delimiter = "|";
                        } elseif ($that->post['delimiter'] == "dotcomma") {
                            $delimiter = ";";
                        } elseif ($that->post['delimiter'] == "comma") {
                            $delimiter = ",";
                        } else {
                            $delimiter = "\t";
                        }
                        if ($that->post['backquotes']) {
                            $backquotes = '"';
                        } else {
                            $backquotes = '"';
                        }
                        if ($that->post['format'] == 'txt') {
                            $row = 1;
                            $rows = array();
                            if (($handle = fopen($file_location, "r")) !== false) {
                                $counter = 0;
                                while (($data = fgetcsv($handle, '', $delimiter, $backquotes)) !== false) {
                                    //print_r($data);
                                    if ($that->post['escape_first_line']) {
                                        if ($counter == 0) {
                                            $table_cols = $data;
                                        } else {
                                            $rows[] = $data;
                                        }
                                    } else {
                                        $rows[] = $data;
                                    }
                                    $counter++;
                                    if ($counter == 5) {
                                        break;
                                    }
                                }
                                fclose($handle);
                            }
                        }
                        // csv
                    }
                    // try the generic way eol
                }
                $tmpcontent = '';
                $tmpcontent .= '<div class="panel-body">
		<form id="product_import_form" class="form-horizontal" name="form1" method="post" action="' . $params['postForm']['actionUrl'] . '">
		<input name="consolidate" type="hidden" value="' . $that->post['consolidate'] . '" />
		<input name="os" type="hidden" value="' . $that->post['os'] . '" />
		<input name="escape_first_line" type="hidden" value="' . $that->post['escape_first_line'] . '" />
		<input name="parser_template" type="hidden" value="' . $that->post['parser_template'] . '" />
		<input name="format" type="hidden" value="' . $that->post['format'] . '" />
		<input name="action" type="hidden" value="import" />
		<input name="delimiter" type="hidden"  value="' . $that->post['delimiter'] . '" />
		<input name="backquotes" type="hidden"  value="' . $that->post['backquotes'] . '" />
		<input name="filename" type="hidden" value="' . $filename . '" />
		<input name="file_url" type="hidden" value="' . $that->post['file_url'] . '" />
		';
                if ($that->ms['mode'] == 'edit' or $that->post['preProcExistingTask']) {
                    // if the existing import task is rerunned indicate it so we dont save the task double
                    $tmpcontent .= '<input name="preProcExistingTask" type="hidden" value="1" />';
                }
                if (!$rows) {
                    $tmpcontent .= '<div class="alert alert-danger"><h3>No data available.</h3></div>';
                } else {
                    $tmpcontent .= '<table id="product_import_table" class="table table-striped table-bordered">';
                    $header = '<thead><tr><th>' . $that->pi_getLL('target_column') . '</th><th>' . $that->pi_getLL('source_column') . '</th>';
                    for ($x = 1; $x < 6; $x++) {
                        $header .= '<th>' . $that->pi_getLL('row') . ' ' . $x . '</th>';
                    }
                    $header .= '</tr></thead>';
                    $tmpcontent .= $header;
                    $cols = count($rows[0]);
                    $preview_listing = array();
                    for ($i = 0; $i < $cols; $i++) {
                        if ($switch == 'odd') {
                            $switch = 'even';
                        } else {
                            $switch = 'odd';
                        }
                        $tmpcontent .= '
				<tr class="' . $switch . '">
					<td class="cellAux">
					<div class="form-inline">
					<select name="select[' . $i . ']" id="select[' . $i . ']" class="select_columns_fields">
						<option value="">' . $that->pi_getLL('skip') . '</option>
						';
                        foreach ($params['importColumns'] as $key => $value) {
                            $tmpcontent .= '<option value="' . $key . '" ' . ($that->post['select'][$i] != '' && $that->post['select'][$i] == $key ? 'selected' : '') . '>' . htmlspecialchars($value) . '</option>';
                        }
                        $tmpcontent .= '
					</select>&nbsp;<input name="advanced_settings" class="btn btn-primary importer_advanced_settings" type="button" value="' . $that->pi_getLL('admin_advanced_settings') . '" />
					</div>
					<div class="advanced_settings_container" style="display:none;">
						<div class="form-group no-mb">
							<div class="col-md-12">
								<label class="control-label">aux</label>
								<input name="input[' . $i . ']" class="form-control" type="text" value="' . htmlspecialchars($this->post['input'][$i]) . '">
							</div>
						</div>
					</fieldset>
				</td>
				<td class="column_name"><strong>' . htmlspecialchars($table_cols[$i]) . '</strong></td>
				';
                        // now 5 records
                        $teller = 0;
                        foreach ($rows as $row) {
                            foreach ($row as $key => $col) {
                                if (!mb_detect_encoding($col, 'UTF-8', true)) {
                                    $row[$key] = mslib_befe::convToUtf8($col);
                                }
                            }
                            $teller++;
                            $tmpitem = $row;
                            $cols = count($tmpitem);
                            if ($that->post['backquotes']) {
                                $tmpitem[$i] = trim($tmpitem[$i], "\"");
                            }
                            if (strlen($tmpitem[$i]) > 100) {
                                $tmpitem[$i] = substr($tmpitem[$i], 0, 100) . '...';
                            }
                            $tmpcontent .= '<td class="cellBreak product_' . $teller . '">' . htmlspecialchars($tmpitem[$i]) . '</td>';
                            if ($teller == 5 or $teller == count($rows)) {
                                break;
                            }
                        }
                        if ($teller < 5) {
                            for ($x = $teller; $x < 5; $x++) {
                                $tmpcontent .= '<td class="cellBreak product_' . $x . '">&nbsp;</td>';
                            }
                        }
                        // now 5 products eof
                        $tmpcontent .= '
			</tr>';
                        /*
                         * prefix '.$i.': <input name="input['.$i.']" type="text"
                         * value="'.htmlspecialchars($that->post['input'][$i]).'" />
                         */
                    }
                    $importer_add_aux_input = '
			<div class="form-field ms_dynamic_add_property">
				<label>type</label>
				<select name="type">
					<option value="append">append content with value</option>
					<option value="prepend">prepend content with value</option>
					<option value="find_and_replace">find and replace</option>
					<option value="custom_code">custom php code</option>
				</select>
				<label>aux</label>
				<input name="aux_input[]" type="text" value="' . htmlspecialchars($that->post['aux_input']) . '" />
				<input name="delete" class="delete_property" type="button" value="delete" /><input name="disable" type="button" value="enable" />
			</div>
			';
                    $importer_add_aux_input = str_replace("\r\n", '', $importer_add_aux_input);
                    $importer_add_aux_input = str_replace("\n", '', $importer_add_aux_input);
                    $tmpcontent .= $header . '</table>';
                    $tmpcontent .= '
					<script type="text/javascript">
					jQuery(document).ready(function($) {
						var add_property_html=\'' . addslashes($importer_add_aux_input) . '\';
						$(document).on("click", ".delete_property", function() {
							$(this).parent().hide("fast");
						});
						$(".importer_add_property").click(function(event) {
							$(this).prev().append(add_property_html);
						});
						$(".importer_advanced_settings").click(function(event) {
							$(this).parent().next().toggle();
						});
						$(\'.select_columns_fields\').select2({
							dropdownCssClass: "bigdropWider", // apply css that makes the dropdown taller
							width:\'250px\'
						});
					});
					</script>
						';
                }
                //$tmpcontent.=self::renderImportJobProperties($params,$that);
                $tmpcontent .= '
				<div class="panel panel-default">
					<div class="panel-heading"><h3>' . $that->pi_getLL('save_import_task') . '</h3></div>
					<div class="panel-body">
					<div class="form-group">
						<label for="cron_name" class="control-label col-md-2">' . $that->pi_getLL('name') . '</label>
						<div class="col-md-10">
							<input name="cron_name" type="text" class="form-control" value="' . htmlspecialchars($that->post['cron_name']) . '" />
						</div>
					</div>
';
                if ($that->get['action'] == 'edit_job') {
                    $tmpcontent .= '
							<div class="form-group">
								<label for="duplicate" class="control-label col-md-2">' . $that->pi_getLL('duplicate') . '</label>
								<div class="col-md-10">
									<div class="checkbox checkbox-success checkbox-inline">
										<input name="duplicate" id="duplicate" type="checkbox" value="1" /><label for="duplicate"></label>
										<input name="skip_import" type="hidden" value="1" />
										<input name="job_id" type="hidden" value="' . $that->get['job_id'] . '" />
										<input name="file_url" type="hidden" value="' . $that->post['file_url'] . '" />
									</div>
								</div>
							</div>
			';
                }
                $tmpcontent .= '
		<div class="form-group">
			<label for="cron_period" class="control-label col-md-2">' . $that->pi_getLL('schedule') . '</label>
			<div class="col-md-10">
				<select name="cron_period" id="cron_period" class="form-control">
				<option value="" ' . (!$that->post['cron_period'] ? 'selected' : '') . '>' . $that->pi_getLL('manual') . '</option>
				<option value="' . 3600 * 24 . '" ' . ($that->post['cron_period'] == 3600 * 24 ? 'selected' : '') . '>' . $that->pi_getLL('daily') . '</option>
				<option value="' . 3600 * 24 * 7 . '" ' . ($that->post['cron_period'] == 3600 * 24 * 7 ? 'selected' : '') . '>' . $that->pi_getLL('weekly') . '</option>
				<option value="' . 3600 * 24 * 30 . '" ' . ($that->post['cron_period'] == 3600 * 24 * 30 ? 'selected' : '') . '>' . $that->pi_getLL('monthly') . '</option>
				</select>
			</div>
		</div>
		<div class="form-group">
			<label for="prefix_source_name" class="control-label col-md-2">' . $that->pi_getLL('source_name') . '</label>
			<div class="col-md-10">
				<input name="prefix_source_name" type="text" class="form-control" value="' . htmlspecialchars($that->post['prefix_source_name']) . '" />
			</div>
		</div>
		<input name="database_name" type="hidden" value="' . $that->post['database_name'] . '" />
		<input name="cron_data" type="hidden" value="' . htmlspecialchars(serialize($that->post)) . '" />
		<div class="form-group">
			<div class="col-md-10 col-md-offset-2">
				<button type="submit" class="btn btn-success submit_block" id="cl_submit" name="AdSubmit" value=""><i class="fa fa-save"></i> ' . ($that->get['action'] == 'edit_job' ? $that->pi_getLL('save') : $that->pi_getLL('import')) . '</button>
			</div>
		</div>
		</div>
		</div>

		</form>

		';
                $content = '' . mslib_fe::shadowBox($tmpcontent) . '';
                // $content='<div
                // class="fullwidth_div">'.mslib_fe::shadowBox($tmpcontent).'</div>';
            }
            // preview eof
        } elseif (is_numeric($that->get['job_id']) and $that->get['action'] == 'run_job' or $that->post['action'] == 'import' and ($that->post['filename'] and file_exists($that->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/' . $that->post['filename']) or $that->post['database_name'])) {
            if (!$that->post['preProcExistingTask'] and $that->post['cron_name'] and !$that->post['skip_import'] or $that->post['skip_import'] and $that->post['duplicate']) {
                // we have to save the import job
                $updateArray = array();
                $updateArray['name'] = $that->post['cron_name'];
                $updateArray['status'] = 1;
                $updateArray['last_run'] = time();
                $updateArray['code'] = md5(uniqid());
                $updateArray['period'] = $that->post['cron_period'];
                $updateArray['prefix_source_name'] = $that->post['prefix_source_name'];
                $cron_data = array();
                $cron_data[0] = unserialize($that->post['cron_period']);
                $that->post['cron_period'] = '';
                $cron_data[1] = $that->post;
                $updateArray['data'] = serialize($cron_data);
                $updateArray['page_uid'] = $that->shop_pid;
                $updateArray['categories_id'] = $that->post['cid'];
                $updateArray['type'] = $params['importKey'];
                $query = $GLOBALS['TYPO3_DB']->INSERTquery('tx_multishop_import_jobs', $updateArray);
                $res = $GLOBALS['TYPO3_DB']->sql_query($query);
                // we have to save the import job eof
                $that->ms['show_default_form'] = 1;
            } elseif ($that->post['skip_import']) {
                // we have to update the import job
                $updateArray = array();
                $updateArray['name'] = $that->post['cron_name'];
                $updateArray['status'] = 1;
                $updateArray['last_run'] = time();
                $updateArray['period'] = $that->post['cron_period'];
                $updateArray['prefix_source_name'] = $that->post['prefix_source_name'];
                $cron_data = array();
                $cron_data[0] = unserialize($that->post['cron_period']);
                $that->post['cron_period'] = '';
                $cron_data[1] = $that->post;
                $updateArray['data'] = serialize($cron_data);
                $updateArray['page_uid'] = $that->shop_pid;
                $updateArray['categories_id'] = $that->post['cid'];
                $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_import_jobs', 'id=' . $that->post['job_id'] . ' and type=\'' . addslashes($params['importKey']) . '\'', $updateArray);
                $res = $GLOBALS['TYPO3_DB']->sql_query($query);
                // we have to update the import job eof
                $that->ms['show_default_form'] = 1;
            }
            if (!$that->post['skip_import']) {
                if (!$that->get['job_id'] && $that->post['cron_data']) {
                    $data = unserialize($that->post['cron_data']);
                    if (is_numeric($data['job_id'])) {
                        // NEW STUFF FOR 123 IMPORT APPROACH WITH PREDEFINED VALUES TEST
                        $that->get['job_id'] = $data['job_id'];
                        // load the job
                        $str = "SELECT * from tx_multishop_import_jobs where id='" . $that->get['job_id'] . "'" . ' and type=\'' . addslashes($params['importKey']) . '\'';
                        $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
                        $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry);
                        $jobArray = $row;
                        $cron_data = array();
                        $cron_data[0] = array();
                        $that->post['cron_period'] = '';
                        $cron_data[1] = $that->post;
                        $updateArray['data'] = serialize($cron_data);
                        $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_import_jobs', 'id=' . $that->get['job_id'], $updateArray);
                        $res = $GLOBALS['TYPO3_DB']->sql_query($query);
                    }
                }
                if (is_numeric($that->get['job_id'])) {
                    // load the job
                    $str = "SELECT * from tx_multishop_import_jobs where id='" . $that->get['job_id'] . "'" . ' and type=\'' . addslashes($params['importKey']) . '\'';
                    $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
                    $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry);
                    $jobArray = $row;
                    $data = unserialize($row['data']);
                    // copy the previous post data to the current post so it can run the
                    // job again
                    $that->post = $data[1];
                    if ($row['categories_id']) {
                        $that->post['cid'] = $row['categories_id'];
                    }
                    // update the last run time
                    $updateArray = array();
                    $updateArray['last_run'] = time();
                    $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_import_jobs', 'id=' . $row['id'] . ' and type=\'' . addslashes($params['importKey']) . '\'', $updateArray);
                    $res = $GLOBALS['TYPO3_DB']->sql_query($query);
                    // update the last run time eof
                    if ($log_file) {
                        file_put_contents($log_file, $that->FULL_HTTP_URL . ' - cron job settings loaded.(' . date("Y-m-d G:i:s") . ")\n", FILE_APPEND);
                    }
                }
                if ($that->post['file_url']) {
                    if (strstr($that->post['file_url'], "../")) {
                        die;
                    }
                    $filename = time();
                    $file = $that->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/' . $filename;
                    file_put_contents($file, mslib_fe::file_get_contents($that->post['file_url']));
                }
                if ($that->post['filename']) {
                    $file = $that->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/' . $that->post['filename'];
                }
                if ($that->post['database_name'] or $file) {
                    if ($file) {
                        $str = mslib_fe::file_get_contents($file);
                    }
                    if ($that->post['parser_template']) {
                        $processed = 0;
                        $rows = array();
                        /*
                        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/admin_import.php']['TmpproductImportParserTemplateProc'])) {
                            $params=array(
                                'parser_template'=>&$that->post['parser_template'],
                                'prefix_source_name'=>$that->post['prefix_source_name'],
                                'str'=>$str,
                                'rows'=>&$rows,
                                'file_location'=>&$file,
                                'table_cols'=>&$table_cols,
                                'processed'=>&$processed
                            );
                            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/admin_import.php']['TmpproductImportParserTemplateProc'] as $funcRef) {
                                 \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $that);
                            }
                        }
                        */
                    } else {
                        if ($str && mslib_befe::isSerializedString($str)) {
                            $tmpData = unserialize($str);
                            $counter = 0;
                            foreach ($tmpData as $data) {
                                $colCounter = 0;
                                if ($counter == 0) {
                                    $row = array();
                                    foreach ($data as $key => $val) {
                                        $row[] = $key;
                                    }
                                    $table_cols = $row;
                                }
                                $row = array();
                                foreach ($data as $key => $val) {
                                    $row[] = $val;
                                }
                                $rows[] = $row;
                                $counter++;
                            }
                        } elseif ($that->post['database_name']) {
                            if (is_numeric($that->get['limit'])) {
                                $limit = $that->get['limit'];
                            } else {
                                $limit = 2000;
                            }
                            if (strstr(mslib_befe::strtolower($that->post['database_name']), 'select ')) {
                                $that->databaseMode = 'query';
                                // its not a table name, its a full query
                                $that->databaseMode = 'query';
                                $str = $that->post['database_name'] . ' LIMIT ' . $limit;
                                $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
                                if ($that->conf['debugEnabled'] == '1') {
                                    $logString = 'Load records for importer query: ' . $str;
                                    \TYPO3\CMS\Core\Utility\GeneralUtility::devLog($logString, 'multishop', -1);
                                }
                                $datarows = array();
                                while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) != false) {
                                    $datarows[] = $row;
                                }
                            } else {
                                // get primary key first
                                $str = "show index FROM " . $that->post['database_name'] . ' where Key_name = \'PRIMARY\'';
                                $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
                                $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry);
                                $primaryKeyColumn = $row['Column_name'];
                                $query = $GLOBALS['TYPO3_DB']->SELECTquery('*', $that->post['database_name'], '', '', '', $limit);
                                $qry = $GLOBALS['TYPO3_DB']->sql_query($query);
                                $datarows = array();
                                while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) != false) {
                                    $datarows[] = $row;
                                    if ($primaryKeyColumn and isset($row[$primaryKeyColumn])) {
                                        $str2 = "delete from " . $that->post['database_name'] . " where " . $primaryKeyColumn . "='" . $row[$primaryKeyColumn] . "'";
                                        $qry2 = $GLOBALS['TYPO3_DB']->sql_query($str2);
                                    }
                                }
                            }
                            $total_datarows = count($datarows);
                            if ($that->msLogFile) {
                                file_put_contents($that->msLogFile, $that->HTTP_HOST . ' - loaded (' . $total_datarows . ') records. (' . date("Y-m-d G:i:s") . ")\n", FILE_APPEND);
                            }
                            $i = 0;
                            $rows = array();
                            foreach ($datarows as $datarow) {
                                $s = 0;
                                foreach ($datarow as $datacol) {
                                    $rows[$i][$s] = $datacol;
                                    $s++;
                                }
                                $i++;
                            }
                        } elseif ($that->post['format'] == 'excel') {
                            // excel
                            $paths = array();
                            $paths[] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('phpexcel_service') . 'Resources/Private/Contributed/PHPExcel/IOFactory.php';
                            $paths[] = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('phpexcel_service') . 'Classes/PHPExcel/IOFactory.php';
                            foreach ($paths as $path) {
                                if (file_exists($path)) {
                                    require_once $path;
                                    break;
                                }
                            }
                            $phpexcel = PHPExcel_IOFactory::load($file);
                            foreach ($phpexcel->getWorksheetIterator() as $worksheet) {
                                $counter = 0;
                                foreach ($worksheet->getRowIterator() as $row) {
                                    $cellIterator = $row->getCellIterator();
                                    $cellIterator->setIterateOnlyExistingCells(false);
                                    foreach ($cellIterator as $cell) {
                                        $clean_products_data = ltrim(rtrim($cell->getCalculatedValue(), " ,"), " ,");
                                        $clean_products_data = trim($clean_products_data);
                                        if ($row->getRowIndex() > 1) {
                                            $rows[$counter - 1][] = $clean_products_data;
                                        } else {
                                            $table_cols[] = mslib_befe::strtolower($clean_products_data);
                                        }
                                    }
                                    $counter++;
                                }
                            }
                            // excel eof
                        } elseif ($that->post['format'] == 'xml') {
                            $objXML = new xml2Array();
                            $arrOutput = $objXML->parse($str);
                            $i = 0;
                            $s = 0;
                            $rows = array();
                            foreach ($arrOutput[0]['children'] as $item) {
                                // image
                                foreach ($item['children'] as $internalitem) {
                                    $rows[$i][$s] = $internalitem['tagData'];
                                    $s++;
                                }
                                foreach ($item['attrs'] as $key => $value) {
                                    $rows[$i][$s] = $value;
                                    $s++;
                                }
                                $i++;
                                $s = 0;
                            }
                        } else {
                            if ($that->post['os'] == 'linux') {
                                $splitter = "\n";
                            } else {
                                $splitter = "\r\n";
                            }
                            $str = trim($str, $splitter);
                            if ($that->post['escape_first_line']) {
                                $pos = strpos($str, $splitter);
                                $str = substr($str, $pos + strlen($splitter));
                            }
                            // csv
                            if ($that->post['delimiter'] == "tab") {
                                $delimiter = "\t";
                            } elseif ($that->post['delimiter'] == "dash") {
                                $delimiter = "|";
                            } elseif ($that->post['delimiter'] == "dotcomma") {
                                $delimiter = ";";
                            } elseif ($that->post['delimiter'] == "comma") {
                                $delimiter = ",";
                            } else {
                                $delimiter = "\t";
                            }
                            if ($that->post['backquotes']) {
                                $backquotes = '"';
                            } else {
                                $backquotes = '"';
                            }
                            if ($that->post['format'] == 'txt') {
                                $row = 1;
                                $rows = array();
                                if (($handle = fopen($file, "r")) !== false) {
                                    $counter = 0;
                                    while (($data = fgetcsv($handle, '', $delimiter, $backquotes)) !== false) {
                                        if ($that->post['escape_first_line']) {
                                            if ($counter == 0) {
                                                $table_cols = $data;
                                            } else {
                                                $rows[] = $data;
                                            }
                                        } else {
                                            $rows[] = $data;
                                        }
                                        $counter++;
                                    }
                                    fclose($handle);
                                }
                            }
                            // csv
                        }
                    }
                    $item_counter = 0;
                    $inserteditems = array();
                    $global_start_time = microtime(true);
                    $start_time = microtime(true);
                    $total_datarows = count($rows);
                    if ($that->msLogFile) {
                        if ($total_datarows) {
                            // sometimes the preload takes so long that the database connection is lost.
                            $GLOBALS['TYPO3_DB']->connectDB();
                            file_put_contents($that->msLogFile, $that->HTTP_HOST . ' - ' . $params['importKey'] . ' importer loaded, now starting the import. (' . date("Y-m-d G:i:s") . ")\n", FILE_APPEND);
                        } else {
                            file_put_contents($that->msLogFile, $that->HTTP_HOST . ' - no records needed to be imported' . "\n", FILE_APPEND);
                        }
                    }
                    // $global_start_time = microtime();
                    foreach ($rows as $row) {
                        foreach ($row as $key => $col) {
                            if (!mb_detect_encoding($col, 'UTF-8', true)) {
                                if ($col == 'NULL' || $col == 'null') {
                                    $col = '';
                                }
                                $row[$key] = mslib_befe::convToUtf8($col);
                            }
                        }
                        $that->ms['target-cid'] = $that->post['cid'];
                        $teller++;
                        if ($that->post['escape_first_line'] and $teller > 1 or !$that->post['escape_first_line']) {
                            $tmpitem = $row;
                            $cols = count($tmpitem);
                            $flipped_select = array_flip($that->post['select']);
                            // if($tmpitem[$that->post['select'][0]] and $cols > 0)
                            // {
                            $item = array();
                            // if the source is a database table name add the unique id
                            // so we can delete it after the import
                            if ($that->post['database_name']) {
                                $item['table_unique_id'] = $row[0];
                            }
                            // aux
                            $input = array();
                            // name
                            for ($i = 0; $i < $cols; $i++) {
                                $tmpitem[$i] = trim($tmpitem[$i]);
                                $char = '';
                                $item[$that->post['select'][$i]] = $tmpitem[$i];
                                if ($item[$that->post['select'][$i]] == $char and $char) {
                                    $item[$that->post['select'][$i]] = '';
                                }
                                $input[$that->post['select'][$i]] = $that->post['input'][$i];
                            }
                            if ($jobArray['predefined_variables']) {
                                $array = unserialize($jobArray['predefined_variables']);
                                foreach ($array as $col => $val) {
                                    $item[$col] = $val;
                                }
                            }
                            // custom hook that can be controlled by third-party plugin
                            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_admin_import.php']['msAdminImportItemIterateProc'])) {
                                $params = array('importKey' => &$params['importKey'], 'row' => &$row, 'item' => &$item, 'prefix_source_name' => $that->post['prefix_source_name'], 'params' => &$params, 'content' => &$content);
                                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_admin_import.php']['msAdminImportItemIterateProc'] as $funcRef) {
                                    \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $that);
                                }
                            }
                        }
                        if ($log_file) {
                            $content = '';
                        }
                        // end foreach
                    }
                    // if($file_location and file_exists($file_location))
                    // @unlink($file_location);
                }
            }
            // end import
        } else {
            $that->ms['show_default_form'] = 1;
        }
        if ($that->ms['show_default_form']) {
            $that->ms['upload_' . $params['importKey'] . 'feed_form'] .= self::renderImportJobProperties($params, $that);
            $content .= '<div class="panel-body"><form action="' . $params['postForm']['actionUrl'] . '" method="post" enctype="multipart/form-data" name="form1" id="form1" class="form-horizontal">';
            $content .= $that->ms['upload_' . $params['importKey'] . 'feed_form'];
            $content .= '</form>';
            // load the jobs templates
            $str = "SELECT * from tx_multishop_import_jobs where page_uid='" . $that->shop_pid . "' and type='" . addslashes($params['importKey']) . "' order by prefix_source_name asc, id desc";
            $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
            $jobs = array();
            while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) != false) {
                $jobs[] = $row;
            }
            if (count($jobs) > 0) {
                $schedule_content .= '
		<div class="panel panel-default" id="scheduled_import_jobs_form"><div class="panel-heading"><h3>' . $that->pi_getLL('import_tasks') . '</h3></div>
		<div class="panel-body">
		<table class="table table-striped table-bordered no-mb" id="msAdminImportTableInterface">
		<thead>
		<tr>
		<th>' . $that->pi_getLL('source_name') . '</th>
		<th class="cellName">' . $that->pi_getLL('name') . '</th>
		<th class="cellDate">' . $that->pi_getLL('last_run') . '</th>
		<th>' . $that->pi_getLL('action') . '</th>
		<th class="cellStatus">' . ucfirst($that->pi_getLL('status')) . '</th>
		<th class="cellAction">' . ucfirst($that->pi_getLL('delete')) . '</th>
		<th class="cellStatus">' . $that->pi_getLL('file_exists') . '</th>
		<th>' . $that->pi_getLL('upload_file') . '</th>
		<th>' . $that->pi_getLL('download_import_task') . '</th>
		</tr>
		</thead>
		';
                $switch = '';
                $schedule_content .= '<tbody>';
                foreach ($jobs as $job) {
                    if ($switch == 'odd') {
                        $switch = 'even';
                    } else {
                        $switch = 'odd';
                    }
                    $schedule_content .= '<tr class="' . $switch . '">';
                    $schedule_content .= '<td>' . $job['prefix_source_name'] . '</td>
			<td class="cellName"><a href="' . $params['postForm']['actionUrl'] . '&job_id=' . $job['id'] . '&action=edit_job">' . $job['name'] . '</a></td>
			';
                    $lastRun = '';
                    if ($job['last_run'] > 0) {
                        $lastRun = date("Y-m-d", $job['last_run']) . '<br />' . date("G:i:s", $job['last_run']);
                    }
                    $schedule_content .= '<td class="cellDate">' . $lastRun . '</td>';
                    if (!$job['period']) {
                        $schedule_content .= '<td>manual<br /><a href="' . $params['postForm']['actionUrl'] . '&job_id=' . $job['id'] . '&action=run_job&limit=99999999" class="btn btn-success" onClick="return CONFIRM(\'' . addslashes($that->pi_getLL('are_you_sure_you_want_to_run_the_import_job')) . ': ' . htmlspecialchars(addslashes($job['name'])) . '?\')"><i>' . $that->pi_getLL('run_now') . '</i></a><br /><a href="" class="copy_to_clipboard" rel="' . htmlentities('/usr/bin/wget -O /dev/null --tries=1 --timeout=30 -q "' . $that->FULL_HTTP_URL . $params['postForm']['actionUrl'] . '&job_id=' . $job['id'] . '&code=' . $job['code'] . '&action=run_job&run_as_cron=1&limit=99999999" >/dev/null 2>&1') . '" ><i>' . $that->pi_getLL('run_by_crontab') . '</i></a></td>';
                    } else {
                        $schedule_content .= '<td>' . date("Y-m-d G:i:s", $job['last_run'] + $job['period']) . '</td>';
                    }
                    $schedule_content .= '<td class="cellStatus">';
                    if (!$job['status']) {
                        $schedule_content .= '<span class="admin_status_red" alt="Disable"></span>';
                        $schedule_content .= '<a href="' . $params['postForm']['actionUrl'] . '&job_id=' . $job['id'] . '&status=1"><span class="admin_status_green disabled" alt="Enabled"></span></a>';
                    } else {
                        $schedule_content .= '<a href="' . $params['postForm']['actionUrl'] . '&job_id=' . $job['id'] . '&status=0"><span class="admin_status_red disabled" alt="Disabled"></span></a>';
                        $schedule_content .= '<span class="admin_status_green" alt="Enable"></span>';
                    }
                    $schedule_content .= '</td>
			<td class="cellAction">
			<a href="' . $params['postForm']['actionUrl'] . '&delete=1&&job_id=' . $job['id'] . '&action=delete_job" onClick="return CONFIRM(\'Are you sure you want to delete the import job: ' . htmlspecialchars($job['name']) . '?\')" alt="Remove ' . htmlspecialchars($job['name']) . '" class="btn btn-danger btn-sm admin_menu_remove" title="Remove ' . htmlspecialchars($job['name']) . '"><i class="fa fa-trash-o"></i></a>
			</td>
			<td class="cellStatus">
				';
                    $data = unserialize($job['data']);
                    if ($data[1]['filename']) {
                        $file_location = $that->DOCUMENT_ROOT . 'uploads/tx_multishop/tmp/' . $data[1]['filename'];
                        if (file_exists($file_location)) {
                            $schedule_content .= '<span class="admin_status_green" alt="Enable"></span>';
                        } else {
                            $schedule_content .= '<span class="admin_status_red" alt="Disable"></span>';
                        }
                    }
                    $schedule_content .= '
			</td>
			<td>
			 	<form action="' . $params['postForm']['actionUrl'] . '" method="post" enctype="multipart/form-data" name="form1" id="form1">
			 		<div class="input-group">
					<input type="file" name="file" class="form-control" style="width:300px" />
					<input name="skip_import" type="hidden" value="1" />
					<input name="preProcExistingTask" type="hidden" value="1" />
					<input name="job_id" type="hidden" value="' . $job['id'] . '" />
					<input name="action" type="hidden" value="edit_job" />
					<span class="input-group-btn">
					<input type="submit" name="Submit" class="submit btn btn-success" id="cl_submit" value="' . $that->pi_getLL('upload') . '" />
					</span>
					</div>
				</form>
			</td>
			<td>
				<a href="' . $params['postForm']['actionUrl'] . '&download=task&job_id=' . $job['id'] . '" class="btn btn-success"><i class="fa fa-download"></i> ' . $that->pi_getLL('download_import_task') . '</a>
			</td>
			';
                    $schedule_content .= '</tr>';
                }
                $schedule_content .= '</tbody>';
                $schedule_content .= '</table>
		</div>
		</div>
		<script type="text/javascript">
		jQuery(document).ready(function($) {
			$(".copy_to_clipboard").click(function(event) {
				event.preventDefault();
				var string=$(this).attr("rel");
				$.blockUI({
				theme:     true,
				title:    \'' . addslashes($that->pi_getLL('copy_below_text_and_add_it_to_crontab')) . '\',
				message:  \'<p>\'+string+\'</p>\',
				timeout:   8000
				});
			});
		});
		</script>
		';
                $tmptab = '';
                $content .= $schedule_content;
                //$tabs['tasks']=array($that->pi_getLL('import_tasks'),$schedule_content);
            }
            // load the jobs templates eof
            if ($this->ROOTADMIN_USER) {
                $content .= '
				<div id="scheduled_import_jobs_form" class="panel panel-default">
				<div class="panel-heading"><h3>' . $that->pi_getLL('upload_import_task') . '</h3></div>
				<div class="panel-body">
					<form action="' . $params['postForm']['actionUrl'] . '&upload=task" method="post" enctype="multipart/form-data" name="upload_task" id="upload_task" class="form-horizontal blockSubmitForm">
						<div class="form-group">
							<label for="new_cron_name" class="control-label col-md-2">' . $that->pi_getLL('name') . '</label>
							<div class="col-md-10">
								<input name="new_cron_name" type="text" class="form-control" value="" size="125">
							</div>
						</div>
						<div class="form-group">
							<label for="new_prefix_source_name" class="control-label col-md-2">' . $that->pi_getLL('source_name') . '</label>
							<div class="col-md-10">
								<input name="new_prefix_source_name" type="text" class="form-control" value="" />
							</div>
						</div>
						<div class="form-group">
							<label for="upload_task_file" class="control-label col-md-2">' . $that->pi_getLL('file') . '</label>
							<div class="col-md-10">
								<input type="file" name="task_file" class="form-control">
							</div>
						</div>
						<div class="form-group">
							<div class="col-md-10 col-md-offset-2">
								<input type="submit" name="upload_task_file" class="submit btn btn-success" id="upload_task_file" value="upload">
							</div>
						</div>
					</form>
				</div>
				</div>';
            }
        }
        $content .= '<hr><div class="clearfix"><a class="btn btn-success msAdminBackToCatalog" href="' . mslib_fe::typolink() . '"><span class="fa-stack"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-arrow-left fa-stack-1x"></i></span> ' . $that->pi_getLL('admin_close_and_go_back_to_catalog') . '</a></div></div>';
        $content = '<div class="panel panel-default">' . mslib_fe::shadowBox($content) . '</div>';
        return $content;
    }
Example #9
0
 //
 $markerArray['###TELEPHONE_VALIDATION###'] = $telephone_validation;
 $markerArray['###LABEL_MOBILE###'] = ucfirst($this->pi_getLL('mobile'));
 $markerArray['###VALUE_MOBILE###'] = htmlspecialchars($user['mobile']);
 $markerArray['###LABEL_EMAIL###'] = ucfirst($this->pi_getLL('e-mail_address')) . '<span class="text-danger">*</span>';
 $markerArray['###VALUE_EMAIL###'] = htmlspecialchars($user['email']);
 $markerArray['###LABEL_ERROR_EMAIL_IS_REQUIRED###'] = $this->pi_getLL('email_is_required');
 $markerArray['###LABEL_DELIVERY_ADDRESS_TITLE###'] = ucfirst($this->pi_getLL('delivery_address'));
 $markerArray['###LABEL_DELIVERY_TITLE###'] = ucfirst($this->pi_getLL('title')) . '<span class="text-danger">*</span>';
 $markerArray['###DELIVERY_GENDER_MR_CHECKED###'] = $user['delivery_gender'] == 'm' ? 'checked' : '';
 $markerArray['###LABEL_DELIVERY_GENDER_MR###'] = ucfirst($this->pi_getLL('mr'));
 $markerArray['###DELIVERY_GENDER_MRS_CHECKED###'] = $user['delivery_gender'] == 'f' ? 'checked' : '';
 $markerArray['###LABEL_DELIVERY_GENDER_MRS###'] = ucfirst($this->pi_getLL('mrs'));
 $markerArray['###LABEL_DELIVERY_COMPANY###'] = ucfirst($this->pi_getLL('company')) . ($this->ms['MODULES']['CHECKOUT_REQUIRED_COMPANY'] ? '*' : '');
 $markerArray['###VALUE_DELIVERY_COMPANY###'] = htmlspecialchars($user['delivery_company']);
 $markerArray['###DELIVERY_COMPANY_VALIDATION###'] = $this->ms['MODULES']['CHECKOUT_REQUIRED_COMPANY'] ? ' required="required" data-h5-errorid="invalid-delivery_company" title="' . $this->pi_getLL('company_is_required') . ' (' . mslib_befe::strtolower($this->pi_getLL('delivery_address')) . ')"' : '';
 $markerArray['###LABEL_DELIVERY_FIRST_NAME###'] = ucfirst($this->pi_getLL('first_name')) . '<span class="text-danger">*</span>';
 $markerArray['###VALUE_DELIVERY_FIRST_NAME###'] = htmlspecialchars($user['delivery_first_name']);
 $markerArray['###LABEL_DELIVERY_MIDDLE_NAME###'] = ucfirst($this->pi_getLL('middle_name'));
 $markerArray['###VALUE_DELIVERY_MIDDLE_NAME###'] = htmlspecialchars($user['delivery_middle_name']);
 $markerArray['###LABEL_DELIVERY_LAST_NAME###'] = ucfirst($this->pi_getLL('last_name') . '<span class="text-danger">*</span>');
 $markerArray['###VALUE_DELIVERY_LAST_NAME###'] = htmlspecialchars($user['delivery_last_name']);
 $markerArray['###INPUT_DELIVERY_COUNTRY_BLOCK###'] = $delivery_country_block;
 $markerArray['###LABEL_DELIVERY_ZIP###'] = ucfirst($this->pi_getLL('zip')) . '<span class="text-danger">*</span>';
 $markerArray['###VALUE_DELIVERY_ZIP###'] = htmlspecialchars($user['delivery_zip']);
 $markerArray['###LABEL_DELIVERY_ADDRESS###'] = ucfirst($this->pi_getLL('street_address')) . '<span class="text-danger">*</span>';
 $markerArray['###VALUE_DELIVERY_ADDRESS###'] = htmlspecialchars($user['delivery_street_name']);
 $markerArray['###LABEL_DELIVERY_ADDRESS_NUMBER###'] = ucfirst($this->pi_getLL('street_address_number')) . '<span class="text-danger">*</span>';
 $markerArray['###VALUE_DELIVERY_ADDRESS_NUMBER###'] = htmlspecialchars($user['delivery_address_number']);
 $markerArray['###LABEL_DELIVERY_ADDRESS_EXT###'] = ucfirst($this->pi_getLL('address_extension'));
 $markerArray['###VALUE_DELIVERY_ADDRESS_EXT###'] = htmlspecialchars($user['delivery_address_ext']);
Example #10
0
     foreach ($payment_methods as $key => $value) {
         $types['email_order_confirmation_' . $key] = htmlspecialchars($this->pi_getLL('email_order_confirmation_letter')) . ' (' . $key . ')';
     }
 }
 $types['email_order_paid_letter'] = htmlspecialchars($this->pi_getLL('email_order_paid_letter'));
 if (is_array($payment_methods)) {
     foreach ($payment_methods as $key => $value) {
         $types['email_order_paid_letter_' . $key] = htmlspecialchars($this->pi_getLL('email_order_paid_letter')) . ' (' . $key . ')';
     }
 }
 $types['email_order_status_changed'] = htmlspecialchars($this->pi_getLL('email_order_status_changed_letter'));
 $types['email_order_status_changed'] = $this->pi_getLL('email_order_status_changed_letter') . ' (' . $this->pi_getLL('default') . ')';
 $orders_status = mslib_fe::getAllOrderStatus(0);
 if (is_array($orders_status) and count($orders_status)) {
     foreach ($orders_status as $item) {
         $types['email_order_status_changed_' . mslib_befe::strtolower($item['name'])] = $this->pi_getLL('email_order_status_changed_letter') . ' (' . $item['name'] . ')';
     }
 }
 $types['order_received_thank_you_page'] = htmlspecialchars($this->pi_getLL('checkout_finished_page'));
 if (is_array($payment_methods)) {
     foreach ($payment_methods as $key => $value) {
         $types['order_received_thank_you_page_' . $key] = htmlspecialchars($this->pi_getLL('checkout_finished_page')) . ' (' . $key . ')';
     }
 }
 // payment reminder email templates
 $types['payment_reminder_email_templates'] = htmlspecialchars($this->pi_getLL('payment_reminder_email_templates', 'Payment reminder email templates'));
 if (is_array($payment_methods)) {
     foreach ($payment_methods as $key => $value) {
         $types['payment_reminder_email_templates_' . $key] = htmlspecialchars($this->pi_getLL('payment_reminder_email_templates', 'Payment reminder email templates')) . ' (' . $key . ')';
     }
 }
Example #11
0
    }
}
$customer_groups_input .= '</select>' . "\n";
$searchCharNav = '<div id="msAdminSearchByCharNav" class="no-mb"><ul class="pagination">';
$chars = array();
$chars = array('0-9', 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', '#', 'all');
foreach ($chars as $char) {
    $searchCharNav .= '<li><a href="' . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[searchByChar]=' . $char . '&tx_multishop_pi1[page_section]=admin_customers') . '">' . mslib_befe::strtoupper($char) . '</a></li>';
}
$searchCharNav .= '</ul></div>';
$user_countries = mslib_befe::getRecords('', 'fe_users f', '', array(), 'f.country', 'f.country asc');
$fe_user_country = array();
foreach ($user_countries as $user_country) {
    if (!empty($user_country['country'])) {
        $cn_localized_name = htmlspecialchars(mslib_fe::getTranslatedCountryNameByEnglishName($this->lang, $user_country['country']));
        $fe_user_country[$cn_localized_name] = $fe_user_countries[] = '<option value="' . mslib_befe::strtolower($user_country['country']) . '" ' . (mslib_befe::strtolower($this->get['country']) == mslib_befe::strtolower($user_country['country']) ? 'selected' : '') . '>' . $cn_localized_name . '</option>';
    }
}
ksort($fe_user_country);
$user_countries_sb = '<select class="invoice_select2" name="country" id="country""><option value="">' . $this->pi_getLL('all') . '</option>' . implode("\n", $fe_user_country) . '</select>';
$formTopSearch = '
<form id="form1" name="form1" method="get" action="index.php">
<div class="panel panel-default no-mb">
    <div class="panel-heading">
            <div class="form-inline form-collapse">
                <div class="input-group">
                    <input class="form-control" type="text" name="tx_multishop_pi1[keyword]" id="advance-skeyword" value="' . htmlspecialchars($this->get['tx_multishop_pi1']['keyword']) . '" placeholder="' . htmlspecialchars($this->pi_getLL('keyword')) . '" />
                    <i class="fa fa-search 2x form-control-inputsearch"></i>
                    <span class="input-group-btn">
                        <input type="submit" name="Search" id="advanceSearchSubmit" value="' . htmlspecialchars($this->pi_getLL('search')) . '" class="btn btn-success" />
                    </span>
Example #12
0
 // delivery address
 if (!empty($order['delivery_company'])) {
     $markerArray['###DELIVERY_COMPANY###'] = '<strong>' . $order['delivery_company'] . '</strong><br/>';
 } else {
     $markerArray['###DELIVERY_COMPANY###'] = '';
 }
 $markerArray['###DELIVERY_NAME###'] = $order['delivery_name'];
 $markerArray['###DELIVERY_BUILDING###'] = $order['delivery_building'];
 if (strpos($template, '###DELIVERY_BUILDING###') === false && $order['delivery_building'] != '') {
     $order['delivery_address'] = $order['delivery_building'] . '<br/>' . $order['delivery_address'];
 }
 $markerArray['###DELIVERY_ADDRESS###'] = $order['delivery_address'];
 $markerArray['###DELIVERY_ZIP###'] = $order['delivery_zip'];
 $markerArray['###DELIVERY_CITY###'] = mslib_befe::strtoupper($order['delivery_city']);
 $markerArray['###DELIVERY_COUNTRY###'] = '';
 if (mslib_befe::strtolower($order['delivery_country']) != mslib_befe::strtolower($this->tta_shop_info['country'])) {
     // ONLY PRINT COUNTRY IF THE COUNTRY OF THE CUSTOMER IS DIFFERENT THAN FROM THE SHOP
     $markerArray['###DELIVERY_COUNTRY###'] = mslib_fe::getTranslatedCountryNameByEnglishName($this->lang, $order['delivery_country']) . '<br/>';
 }
 $markerArray['###LABEL_CUSTOMER_ID###'] = $this->pi_getLL('admin_customer_id');
 $markerArray['###CUSTOMER_ID###'] = $order['customer_id'];
 $markerArray['###LABEL_ORDER_ID###'] = $this->pi_getLL('orders_id');
 $markerArray['###ORDER_ID###'] = $invoice['orders_id'];
 $markerArray['###LABEL_ORDER_DATE###'] = $this->pi_getLL('admin_order_date');
 $markerArray['###ORDER_DATE###'] = strftime("%x", $order['crdate']);
 $markerArray['###LABEL_INVOICE_DATE###'] = $this->pi_getLL('invoice_date');
 $markerArray['###INVOICE_DATE###'] = strftime("%x", $invoice['crdate']);
 $markerArray['###LABEL_INVOICE_NUMBER###'] = $this->pi_getLL('invoice_number');
 $markerArray['###INVOICE_NUMBER###'] = $invoice['invoice_id'];
 $markerArray['###LABEL_INVOICE_SHIPPING_METHOD###'] = '';
 $markerArray['###INVOICE_SHIPPING_METHOD###'] = '';
 /**
  * Init Function: here all the needed configuration values are stored in class variables
  * @param    array $conf : configuration array from TS
  * @return   void
  */
 function construct($conf)
 {
     $this->conf = $conf;
     $this->pi_setPiVarDefaults();
     $this->pi_USER_INT_obj = 1;
     $this->pi_initPIflexForm();
     require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('multishop') . 'pi1/classes/class.mslib_fe.php';
     require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('multishop') . 'pi1/classes/class.mslib_befe.php';
     $this->HTTP_HOST = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('HTTP_HOST');
     // Get the vhost full path (example: /var/www/html/domain.com/public_html/my_cms/)
     $this->DOCUMENT_ROOT = PATH_site;
     // Get the vhost full path to multishop (example: /var/www/html/domain.com/public_html/my_cms/typo3conf/ext/multishop/)
     $this->DOCUMENT_ROOT_MS = PATH_site . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey);
     // Get the vhost full path to TYPO3 (example: /var/www/html/domain.com/public_html/my_cms/typo3/)
     $this->DOCUMENT_ROOT_TYPO3 = PATH_site . TYPO3_mainDir;
     // Get the site full URL (example: http://domain.com/my_cms/)
     $this->FULL_HTTP_URL = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL');
     // Get the multishop full URL (example: http://domain.com/my_cms/typo3/ext/multishop/ or http://domain.com/my_cms/typo3conf/ext/multishop/)
     $this->FULL_HTTP_URL_MS = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey);
     // Get the full URL (example: http://domain.com/my_cms/typo3/)
     $this->FULL_HTTP_URL_TYPO3 = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_SITE_URL') . TYPO3_mainDir;
     $this->get = \TYPO3\CMS\Core\Utility\GeneralUtility::_GET();
     $this->post = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST();
     $this->server = array();
     $this->server['HTTP_ACCEPT_LANGUAGE'] = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('HTTP_ACCEPT_LANGUAGE');
     $this->server['HTTP_USER_AGENT'] = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('HTTP_USER_AGENT');
     $this->server['HTTP_REFERER'] = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('HTTP_REFERER');
     if (!$this->server['HTTP_ACCEPT_LANGUAGE']) {
         $this->server['HTTP_ACCEPT_LANGUAGE'] = 'en';
     }
     $this->server['DOCUMENT_ROOT'] = $this->DOCUMENT_ROOT;
     $this->server['REQUEST_URI'] = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI');
     $this->server['REDIRECT_URL'] = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REDIRECT_URL');
     $this->server['QUERY_STRING'] = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('QUERY_STRING');
     if ($_SERVER['HTTP_X_FORWARDED_FOR']) {
         // For passing through the IP-address of the client, through reverse proxy server
         $this->REMOTE_ADDR = $_SERVER['HTTP_X_FORWARDED_FOR'];
         $this->server['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
     } else {
         $this->REMOTE_ADDR = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REMOTE_ADDR');
         $this->server['REMOTE_ADDR'] = \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REMOTE_ADDR');
     }
     $this->server['HTTP_HOST'] = mslib_befe::strtolower(\TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('TYPO3_HOST_ONLY'));
     $tmp = explode("?", $this->server['REQUEST_URI']);
     $this->server['REQUEST_URI'] = $tmp[0];
     $this->server['REQUEST_URI'] = preg_replace("/^\\//is", '', $this->server['REQUEST_URI']);
     // load language cookie for the backend
     $this->cookie = $GLOBALS['TSFE']->fe_user->getKey('ses', 'tx_multishop_cookie');
     //		if (!isset($this->cookie['multishop_admin_language']) and !isset($this->post['multishop_admin_language'])) $this->post['multishop_admin_language']='';
     if (isset($this->post['multishop_admin_language']) and $this->post['multishop_admin_language'] != $this->cookie['multishop_admin_language']) {
         if ($this->post['multishop_admin_language'] == 'default') {
             $this->post['multishop_admin_language'] = '';
         }
         $this->cookie['multishop_admin_language'] = $this->post['multishop_admin_language'];
         $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_multishop_cookie', $this->cookie);
         $GLOBALS['TSFE']->storeSessionData();
     }
     if ($this->server['HTTP_REFERER'] and !$this->cookie['HTTP_REFERER']) {
         $host = @parse_url($this->server['HTTP_REFERER']);
         if (is_array($host) and mslib_befe::strtolower($host['host']) != $this->server['HTTP_HOST']) {
             $this->cookie['HTTP_REFERER'] = $this->server['HTTP_REFERER'];
             $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_multishop_cookie', $this->cookie);
             $GLOBALS['TSFE']->storeSessionData();
         }
     }
     $this->cookie = $GLOBALS['TSFE']->fe_user->getKey('ses', 'tx_multishop_cookie');
     if (strlen($this->cookie['multishop_admin_language']) == 2) {
         $this->customLang = $this->cookie['multishop_admin_language'];
     }
     // able to change language by get parameters
     if (strlen($this->get['language']) == 2) {
         $this->customLang = $this->get['language'];
     }
     if ($this->customLang) {
         $this->LLkey = $this->customLang;
         $this->config['config']['language'] = $this->customLang;
         $GLOBALS['TSFE']->config['config']['language'] = $this->customLang;
         $sys_language_uid = mslib_befe::getSysLanguageUidByIsoString($this->customLang);
         if (!$sys_language_uid) {
             // try by flag
             $sys_language_uid = mslib_befe::getSysLanguageUidByFlagString($this->customLang);
             //echo $sys_language_uid;
             //die();
         }
         if ($sys_language_uid) {
             $GLOBALS['TSFE']->config['config']['sys_language_uid'] = $sys_language_uid;
             $GLOBALS['TSFE']->sys_language_uid = $sys_language_uid;
         }
     }
     if (!$this->LLkey) {
         $this->LLkey = 'default';
     }
     if (!$GLOBALS['TSFE']->config['config']['locale_all']) {
         $GLOBALS['TSFE']->config['config']['locale_all'] = $this->pi_getLL('locale_all');
     }
     $this->lang = $GLOBALS['TSFE']->config['config']['language'];
     setlocale(LC_TIME, $GLOBALS['TSFE']->config['config']['locale_all']);
     // In TYPO3 7.6.5 suddenly caused buggy calculations, because the dot is returned as a comma. Below line is added to force numeric to be in default system locale.
     setlocale(LC_NUMERIC, 'en_US.UTF-8');
     $this->sys_language_uid = $GLOBALS['TSFE']->config['config']['sys_language_uid'];
     if (!isset($this->sys_language_uid)) {
         $this->sys_language_uid = 0;
     }
     $this->LOCAL_LANG_loaded = 0;
     $this->pi_loadLL();
     // Preload additional languages
     $preloadLanguagesArray = array();
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/class.tx_multishop_pi1.php']['preloadAdditionalLanguages'])) {
         $params = array('preloadLanguagesArray' => &$preloadLanguagesArray);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/class.tx_multishop_pi1.php']['preloadAdditionalLanguages'] as $funcRef) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
         }
     }
     if (count($preloadLanguagesArray)) {
         $tempLLkey = $this->LLkey;
         foreach ($preloadLanguagesArray as $item) {
             $this->LLkey = $item;
             $this->LOCAL_LANG_loaded = 0;
             $this->pi_loadLL();
         }
         $this->LLkey = $tempLLkey;
     }
     mslib_befe::setDefaultSystemLanguage();
     // load language cookie for the backend eof
     // disabled the code so developer can work with config.absRefPrefix too
     /*
     if (!$GLOBALS['TSFE']->config['config']['baseURL']) {
         echo 'config.baseURL='.$this->FULL_HTTP_URL.' is not set yet. Please go to the TYPO3 template setup field editor and add it.';
         die();
     }
     */
     // setting coming from typoscript or from flexform
     if ($this->conf['method']) {
         $this->method = $this->conf['method'];
     } else {
         $this->method = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'method', 'sDEFAULT');
     }
     // shop pid
     $this->shop_pid = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'page_uid', 'sDEFAULT');
     if (!$this->shop_pid and $this->conf['shop_pid'] > 0) {
         $this->shop_pid = $this->conf['shop_pid'];
     }
     if (!$this->shop_pid) {
         $this->shop_pid = $GLOBALS["TSFE"]->id;
     }
     // shop pid eof
     $this->admin_group = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'admin_group', 'sDEFAULT');
     // var for the tabbed navigation menu
     $this->maxDELIMITED = $this->pi_getFFvalue($this->cObj->data['pi_flexform'], 'maxDELIMITED', 's_listing');
     // Autoloader works great in TYPO3 4.7.7. But in TYPO3 4.5.X the invalid namespace classes are not autoloaded so lets load it manually then too
     // PHP Fatal error:  Access to undeclared static property: t3lib_autoloader::$classNameToFileMapping in /shopcvs/skeleton/typo3_src-4.7.5/t3lib/class.t3lib_autoloader.php on line 151
     if (!class_exists('Cache_Lite')) {
         require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('multishop') . 'res/Cache_Lite-1.7.16/Cache/Lite.php';
     }
     require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('multishop') . 'pi1/classes/class.mslib_payment.php';
     require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('multishop') . 'pi1/classes/class.tx_mslib_catalog.php';
 }
Example #14
0
					$(\'#delivery_address_category\').show();
				} else {
					$(\'#delivery_country\').removeAttr(\'required\');
					$(\'#delivery_country\').removeAttr(\'data-h5-errorid\');
					$(\'#delivery_country\').removeAttr(\'title\');

					$(\'#delivery_address_category\').hide();
				}

				jQuery("#checkboxdifferent_delivery_address").click(function(event) {
					jQuery(\'#delivery_address_category\').slideToggle(\'slow\', function(){});

					if ($("#checkboxdifferent_delivery_address").is(\':checked\')) {
						$(\'#delivery_country\').attr(\'required\', \'required\');
						$(\'#delivery_country\').attr(\'data-h5-errorid\', \'invalid-delivery_country\');
						$(\'#delivery_country\').attr(\'title\', \'' . addslashes($this->pi_getLL('country_is_required')) . ' (' . mslib_befe::strtolower(addslashes($this->pi_getLL('delivery_address'))) . ')\');

						$(\'#delivery_address_category\').show();
					} else {
						$(\'#delivery_country\').removeAttr(\'required\');
						$(\'#delivery_country\').removeAttr(\'data-h5-errorid\');
						$(\'#delivery_country\').removeAttr(\'title\');

						$(\'#delivery_address_category\').hide();
					}
				});
			});
			</script>
			<div class="form-group">
				<span id="delivery_ValidRadio" class="delivery_InputGroup">
					<label for="delivery_gender" id="account-gender">' . ucfirst($this->pi_getLL('title')) . '</label>
 }
 if (!empty($order['delivery_building'])) {
     $markerArray['###DELIVERY_BUILDING###'] = '<strong>' . $order['delivery_building'] . '</strong><br/>';
 } else {
     $markerArray['###DELIVERY_BUILDING###'] = '';
 }
 $markerArray['###DELIVERY_NAME###'] = $order['delivery_name'];
 $markerArray['###DELIVERY_BUILDING###'] = $order['delivery_building'];
 if (strpos($template, '###DELIVERY_BUILDING###') === false && $order['delivery_building'] != '') {
     $order['delivery_address'] = $order['delivery_building'] . '<br/>' . $order['delivery_address'];
 }
 $markerArray['###DELIVERY_ADDRESS###'] = $order['delivery_address'];
 $markerArray['###DELIVERY_ZIP###'] = $order['delivery_zip'];
 $markerArray['###DELIVERY_CITY###'] = mslib_befe::strtoupper($order['delivery_city']);
 $markerArray['###DELIVERY_COUNTRY###'] = '';
 if (mslib_befe::strtolower($order['billing_country']) != mslib_befe::strtolower($this->tta_shop_info['country'])) {
     // ONLY PRINT COUNTRY IF THE COUNTRY OF THE CUSTOMER IS DIFFERENT THAN FROM THE SHOP
     $markerArray['###DELIVERY_COUNTRY###'] = mslib_fe::getTranslatedCountryNameByEnglishName($this->lang, $order['delivery_country']);
 }
 $markerArray['###LABEL_CUSTOMER_ID###'] = $this->pi_getLL('admin_customer_id');
 $markerArray['###CUSTOMER_ID###'] = $order['customer_id'];
 $markerArray['###LABEL_ORDER_ID###'] = $this->pi_getLL('orders_id');
 $markerArray['###ORDER_ID###'] = $order['orders_id'];
 $markerArray['###LABEL_ORDER_DATE###'] = $this->pi_getLL('admin_order_date');
 $markerArray['###ORDER_DATE###'] = strftime("%x", $order['crdate']);
 $markerArray['###LABEL_PACKINGSLIP_PAYMENT_METHOD###'] = '';
 $markerArray['###PACKINGSLIP_PAYMENT_METHOD###'] = '';
 if ($order['payment_method_label']) {
     $markerArray['###LABEL_PACKINGSLIP_PAYMENT_METHOD###'] = $this->pi_getLL('payment_method');
     $markerArray['###PACKINGSLIP_PAYMENT_METHOD###'] = $order['payment_method_label'];
 }
Example #16
0
    if ($discount_percentage) {
        $mslib_cart = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_mslib_cart');
        $mslib_cart->init($this);
        $cart = $mslib_cart->getCart();
        $cart['coupon_code'] = '';
        $cart['discount'] = $discount_percentage;
        $cart['discount_type'] = 'percentage';
        //$GLOBALS['TSFE']->fe_user->setKey('ses', $this->cart_page_uid, $cart);
        //$GLOBALS['TSFE']->fe_user->storeSessionData();
        tx_mslib_cart::storeCart($cart);
        $content = number_format($discount_percentage) . '%';
    }
}
//if(!$discount_percentage)
if (!empty($_POST['code']) && $_POST['code'] != 'undefined') {
    $code = mslib_fe::RemoveXSS(mslib_befe::strtolower($_POST['code']));
    $time = time();
    $str = "SELECT * from tx_multishop_coupons where code = '" . addslashes($code) . "' and status = 1 and (page_uid=0 or page_uid='" . $this->showCatalogFromPage . "') and (startdate <= '" . $time . "' and enddate >= '" . $time . "')";
    $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
    if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry) > 0) {
        $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry);
        $continue_calculate_discount = true;
        if ($row['max_usage'] > 0) {
            if ($row['times_used'] >= $row['max_usage']) {
                $content = "0%";
                $continue_calculate_discount = false;
            }
        }
        if ($continue_calculate_discount) {
            switch ($row['discount_type']) {
                case 'percentage':
Example #17
0
							<input type="file" name="task_file" class="form-control">
						</div>
					</div>
					<div class="form-group">
						<div class="col-md-10 col-md-offset-2">
							<input type="submit" name="upload_task_file" class="submit btn btn-success" id="upload_task_file" value="upload">
						</div>
					</div>
				</form>
			</div>
			</div>';
        }
        $tabs['tasks'] = array($this->pi_getLL('import_tasks'), $schedule_content);
        // load the jobs templates eof
        $content .= '
		<div class="panel-heading"><h3>' . ucfirst(mslib_befe::strtolower($this->pi_getLL('admin_import_products'))) . '</h3></div>
		<script type="text/javascript">
		jQuery(document).ready(function($) {
var url = document.location.toString();
if (url.match("#")) {
    $(".nav-tabs a[href=#"+url.split("#")[1]+"]").tab("show") ;
} else {
		$(".nav-tabs a:first").tab("show");
	}

// Change hash for page-reload
	$(".nav-tabs a").on("shown.bs.tab", function (e) {
		window.location.hash = e.target.hash;
		$("body,html,document").scrollTop(0);
	})
			<option value="status_last_modified"' . ($post_data['order_by'] == 'status_last_modified' ? ' selected="selected"' : '') . '>' . $this->pi_getLL('status_last_modified') . '</option>
			<option value="billing_name"' . ($post_data['order_by'] == 'billing_name' ? ' selected="selected"' : '') . '>' . $this->pi_getLL('billing_name') . '</option>
			<option value="crdate"' . ($post_data['order_by'] == 'crdate' ? ' selected="selected"' : '') . '>' . $this->pi_getLL('creation_date') . '</option>
			<option value="grand_total"' . ($post_data['order_by'] == 'grand_total' ? ' selected="selected"' : '') . '>' . $this->pi_getLL('grand_total') . '</option>
			<option value="shipping_method_label"' . ($post_data['order_by'] == 'shipping_method_label' ? ' selected="selected"' : '') . '>' . $this->pi_getLL('shipping_method_label') . '</option>
			<option value="payment_method_label"' . ($post_data['order_by'] == 'payment_method_label' ? ' selected="selected"' : '') . '>' . $this->pi_getLL('payment_method_label') . '</option>
		</select>';
        // sort direction selectbox
        $sort_direction_sb = '<select class="form-control" name="sort_direction">
			<option value="desc"' . ($post_data['sort_direction'] == 'desc' ? ' selected="selected"' : '') . '>' . $this->pi_getLL('sort_direction_desc') . '</option>
			<option value="asc"' . ($post_data['sort_direction'] == 'asc' ? ' selected="selected"' : '') . '>' . $this->pi_getLL('sort_direction_asc') . '</option>
		</select>';
        // order type selectbox
        $order_type_sb = '<select class="form-control" name="order_type">
			<option value="all"' . ($post_data['order_type'] == 'desc' ? ' selected="selected"' : '') . '>' . $this->pi_getLL('orders') . '</option>
			<option value="by_phone"' . ($post_data['order_type'] == 'by_phone' ? ' selected="selected"' : '') . '>' . ucfirst(mslib_befe::strtolower($this->pi_getLL('admin_manual_order'))) . '</option>
			<option value="proposal"' . ($post_data['order_type'] == 'proposal' ? ' selected="selected"' : '') . '>' . $this->pi_getLL('admin_proposals') . '</option>
		</select>';
        // delimeter type selectbox
        $delimeter_type_sb = '<select class="form-control" name="delimeter_type">
			<option value=";"' . ($post_data['order_type'] == ';' ? ' selected="selected"' : '') . '>semicolon (;)</option>
			<option value=","' . ($post_data['order_type'] == ',' ? ' selected="selected"' : '') . '>comma (,)</option>
			<option value="\\t"' . ($post_data['order_type'] == '\\t' ? ' selected="selected"' : '') . '>tabs (\\t)</option>
			<option value="|"' . ($post_data['order_type'] == '|' ? ' selected="selected"' : '') . '>pipe (|)</option>
		</select>';
        $content .= '
		<div class="form-group">
			<label class="control-label col-md-2">' . htmlspecialchars($this->pi_getLL('order_type')) . '</label>
			<div class="col-md-10">
				' . $order_type_sb . '
			</div>
 function getHtmlCartContents($sectionTemplateType = '')
 {
     if ($this->ms['MODULES']['FORCE_CHECKOUT_SHOW_PRICES_INCLUDING_VAT']) {
         $this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT'] = 1;
     }
     $disable_product_status_col = false;
     $content = '';
     switch ($sectionTemplateType) {
         case 'adminNotificationPopup':
             if ($this->conf['order_details_table_adminNotificationPopup_tmpl_path']) {
                 $template = $this->cObj->fileResource($this->conf['order_details_table_adminNotificationPopup_tmpl_path']);
             } else {
                 $template = $this->cObj->fileResource(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('multishop') . 'templates/order_details_table_adminNotificationPopup.tmpl');
             }
             break;
         case 'ajaxGetMethodCosts':
             if ($this->conf['order_details_table_ajaxGetMethodCosts_tmpl_path']) {
                 $template = $this->cObj->fileResource($this->conf['order_details_table_ajaxGetMethodCosts_tmpl_path']);
             } else {
                 $disable_product_status_col = true;
                 if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
                     $template = $this->cObj->fileResource(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('multishop') . 'templates/order_details_table_site.tmpl');
                 } else {
                     $template = $this->cObj->fileResource(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('multishop') . 'templates/order_details_table_site_excluding_vat.tmpl');
                 }
             }
             break;
         default:
             if ($sectionTemplateType) {
                 if ($this->conf['order_details_table_' . $sectionTemplateType . '_tmpl_path']) {
                     $template = $this->cObj->fileResource($this->conf['order_details_table_' . $sectionTemplateType . '_tmpl_path']);
                 } else {
                     $disable_product_status_col = true;
                     $template = $this->cObj->fileResource(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('multishop') . 'templates/order_details_table_site.tmpl');
                 }
             } else {
                 if ($this->conf['order_details_table_site_tmpl_path']) {
                     $template = $this->cObj->fileResource($this->conf['order_details_table_site_tmpl_path']);
                 } else {
                     $disable_product_status_col = true;
                     $template = $this->cObj->fileResource(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('multishop') . 'templates/order_details_table_site.tmpl');
                 }
             }
             break;
     }
     // hook to rewrite the whole methods
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_cart.php']['getHtmlCartContents'])) {
         $params = array('sectionTemplateType' => &$sectionTemplateType, 'template' => &$template, 'disable_product_status_col' => &$disable_product_status_col, 'content' => &$content);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_cart.php']['getHtmlCartContents'] as $funcRef) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
         }
     } else {
         $itemsWrapper = array();
         $c = true;
         if (is_array($this->cart['products']) && count($this->cart['products'])) {
             foreach ($this->cart['products'] as $shopping_cart_item => $product) {
                 $subPrices = '';
                 if (!$product['products_image']) {
                     $image = '<div class="no_image_50"></div>';
                 } else {
                     $image = '<img src="' . $product['products_image'] . '">';
                 }
                 $item = array();
                 // ITEM CLASS
                 $item['ITEM_CLASS'] = ($c = !$c) ? 'odd' : 'even';
                 // ITEM IMAGE
                 if (!$product['products_image']) {
                     $item['ITEM_IMAGE'] = '<div class="no_image_50"></div>';
                 } else {
                     if (!strstr(mslib_befe::strtolower($product['products_image']), 'http://') and !strstr(mslib_befe::strtolower($product['products_image']), 'https://')) {
                         $item['products_image'] = mslib_befe::getImagePath($product['products_image'], 'products', '50');
                     }
                     $item['ITEM_IMAGE'] = '<img src="' . $product['products_image'] . '" title="' . htmlspecialchars($product['products_name']) . '">';
                 }
                 // ITEM_NAME
                 if ($this->ms['MODULES']['ADD_LINK_TO_PRODUCT_NAME_IN_CHECKOUT_REVIEW'] > 0) {
                     $item['ITEM_NAME'] = '<a href="' . $product['link'] . '">' . $product['products_name'] . '</a>';
                 } else {
                     $item['ITEM_NAME'] = $product['products_name'];
                 }
                 if ($product['products_model']) {
                     $item['ITEM_NAME'] .= ' (' . $product['products_model'] . ') ';
                 }
                 /*
                 					if (!empty($product['ean_code'])) {
                 						$item['ITEM_NAME'] .= '<br/>EAN: '.$product['ean_code'];
                 					}
                 					if (!empty($product['sku_code'])) {
                 						$item['ITEM_NAME'] .= '<br/>SKU: '.$product['sku_code'];
                 					}
                 					if (!empty($product['vendor_code'])) {
                 						$item['ITEM_NAME'] .= '<br/>Vendor: '.$product['vendor_code'];
                 					}*/
                 //print_r($product['attributes']);
                 if (is_array($product['attributes'])) {
                     // loading the attributes
                     foreach ($product['attributes'] as $attribute_key => $attribute_values) {
                         $continue = 0;
                         if (is_numeric($attribute_key)) {
                             $str = "SELECT products_options_name,listtype from tx_multishop_products_options o where o.products_options_id='" . $attribute_key . "' ";
                             $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
                             $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry);
                         }
                         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_cart.php']['getHtmlCartContentsAttributesIteratorPreType'])) {
                             $params = array('attribute_key' => &$attribute_key, 'attribute_values' => &$attribute_values, 'row' => &$row);
                             foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_cart.php']['getHtmlCartContentsAttributesIteratorPreType'] as $funcRef) {
                                 \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
                             }
                         }
                         switch ($row['listtype']) {
                             case 'checkbox':
                                 $item['ITEM_NAME'] .= '<br />' . $row['products_options_name'] . ': ' . $attribute_values['products_options_values_name'];
                                 $continue = 0;
                                 $total = count($attribute_values);
                                 $counter = 0;
                                 foreach ($attribute_values as $attribute_item) {
                                     $counter++;
                                     if ($product['tax_rate'] && $this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
                                         $attribute_item['options_values_price'] = round($attribute_item['options_values_price'] * (1 + $product['tax_rate']), 2);
                                     } else {
                                         $attribute_item['options_values_price'] = round($attribute_item['options_values_price'], 2);
                                     }
                                     $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'];
                 // ITEM_QUANTITY
                 $item['SHOPPING_CART_KEY'] = $shopping_cart_item;
                 $item['ITEM_LINK'] = $product['link'];
                 $item['ITEM_ORDER_UNIT_CODE'] = $product['order_unit_code'];
                 $item['ITEM_ORDER_UNIT_NAME'] = $product['order_unit_name'];
                 $item['ITEM_MANUFACTURERS_NAME'] = $product['manufacturers_name'];
                 $item['ITEM_QUANTITY'] = round($product['qty'], 14);
                 $item['ITEM_VAT_RATE'] = str_replace('.00', '', number_format($product['tax_rate'] * 100, 2)) . '%';
                 // ITEM_SKU
                 $item['ITEM_SKU'] = $product['sku_code'];
                 // ITEM_TOTAL
                 if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
                     $totalPrice = $product['total_price_including_vat'];
                 } else {
                     $totalPrice = $product['total_price'];
                 }
                 if ($product['tax_rate'] && $this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
                     $product['final_price'] = round($product['final_price'] * (1 + $product['tax_rate']), 2);
                 }
                 if ($subPrices) {
                     $totalPrice = $product['final_price'] * $product['qty'];
                 }
                 $item['ITEM_TOTAL'] = mslib_fe::amount2Cents($totalPrice) . $subPrices;
                 $item['ITEM_PRICE_SINGLE'] = mslib_fe::amount2Cents($product['final_price']);
                 //.$subPrices;
                 if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_cart.php']['getHtmlCartContentsItemPreProc'])) {
                     $params = array('item' => &$item, 'product' => &$product, 'cart' => &$this->cart, 'c' => &$c, 'sectionTemplateType' => &$sectionTemplateType);
                     foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_cart.php']['getHtmlCartContentsItemPreProc'] 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###');
         // remove the status col
         if ($disable_product_status_col) {
             $subProductStatusPart = array();
             $subProductStatusPart['ITEMS_HEADER_PRODUCT_STATUS_WRAPPER'] = $this->cObj->getSubpart($subparts['ITEMS_HEADER_WRAPPER'], '###ITEMS_HEADER_PRODUCT_STATUS_WRAPPER###');
             $subProductStatus = array();
             $subProductStatus['###ITEMS_HEADER_PRODUCT_STATUS_WRAPPER###'] = '';
             $subparts['ITEMS_HEADER_WRAPPER'] = $this->cObj->substituteMarkerArrayCached($subparts['ITEMS_HEADER_WRAPPER'], array(), $subProductStatus);
             $subProductStatusPart = array();
             $subProductStatusPart['ITEMS_PRODUCT_STATUS_WRAPPER'] = $this->cObj->getSubpart($subparts['ITEMS_WRAPPER'], '###ITEMS_PRODUCT_STATUS_WRAPPER###');
             $subProductStatus = array();
             $subProductStatus['###ITEMS_PRODUCT_STATUS_WRAPPER###'] = '';
             $subparts['ITEMS_WRAPPER'] = $this->cObj->substituteMarkerArrayCached($subparts['ITEMS_WRAPPER'], array(), $subProductStatus);
         }
         // end of remove
         $subpartArray = array();
         //ITEMS_HEADER_WRAPPER
         $markerArray['HEADING_PRODUCTS_NAME'] = ucfirst($this->pi_getLL('product'));
         $markerArray['HEADING_QUANTITY'] = $this->pi_getLL('qty');
         $markerArray['HEADING_PRICE'] = $this->pi_getLL('price');
         if (!$this->cart['summarize']['grand_total_vat']) {
             $markerArray['HEADING_TOTAL'] = ucfirst($this->pi_getLL('total_excl_vat'));
         } else {
             $markerArray['HEADING_TOTAL'] = $this->pi_getLL('total');
         }
         $markerArray['HEADING_VAT_RATE'] = $this->pi_getLL('vat');
         $subpartArray['###ITEMS_HEADER_WRAPPER###'] = $this->cObj->substituteMarkerArray($subparts['ITEMS_HEADER_WRAPPER'], $markerArray, '###|###');
         //ITEMS_HEADER_WRAPPER EOF
         //ITEMS_WRAPPER
         $keys = array();
         $keys[] = 'ITEM_CLASS';
         $keys[] = 'ITEM_IMAGE';
         $keys[] = 'ITEM_NAME';
         $keys[] = 'ITEM_MODEL';
         $keys[] = 'ITEM_QUANTITY';
         $keys[] = 'ITEM_LINK';
         $keys[] = 'SHOPPING_CART_KEY';
         $keys[] = 'ITEM_MANUFACTURERS_NAME';
         $keys[] = 'ITEM_ORDER_UNIT_CODE';
         $keys[] = 'ITEM_ORDER_UNIT_NAME';
         $keys[] = 'ITEM_SKU';
         $keys[] = 'ITEM_VAT_RATE';
         $keys[] = 'ITEM_TOTAL';
         $keys[] = 'ITEM_PRICE_SINGLE';
         if (is_array($itemsWrapper) && count($itemsWrapper)) {
             foreach ($itemsWrapper as $item) {
                 $markerArray = array();
                 foreach ($keys as $key) {
                     $markerArray[$key] = $item[$key];
                 }
                 foreach ($item as $key => $val) {
                     // hooked plugins wants to add more types. lets find them and add them
                     if (!in_array($key, $keys)) {
                         $markerArray[$key] = $item[$key];
                     }
                 }
                 $contentItem .= $this->cObj->substituteMarkerArray($subparts['ITEMS_WRAPPER'], $markerArray, '###|###');
             }
         }
         $subpartArray['###ITEMS_WRAPPER###'] = $contentItem;
         //ITEMS_WRAPPER EOF
         //SUBTOTAL_WRAPPER
         $key = 'SUBTOTAL_WRAPPER';
         $markerArray = array();
         $markerArray['PRODUCTS_TOTAL_PRICE_LABEL'] = $this->pi_getLL('total_price');
         $markerArray['PRODUCTS_SUB_TOTAL_PRICE_LABEL'] = $this->pi_getLL('subtotal');
         $markerArray['PRODUCTS_TOTAL_PRICE_INCLUDING_VAT_LABEL'] = $this->pi_getLL('subtotal');
         $markerArray['PRODUCTS_TOTAL_PRICE_INCLUDING_VAT'] = mslib_fe::amount2Cents($this->cart['summarize']['sub_total_including_vat']);
         $markerArray['PRODUCTS_TOTAL_PRICE'] = mslib_fe::amount2Cents($this->cart['summarize']['sub_total']);
         $subpartArray['###' . $key . '###'] = $this->cObj->substituteMarkerArray($subparts[$key], $markerArray, '###|###');
         //SUBTOTAL_WRAPPER EOF
         //SHIPPING_COSTS_WRAPPER
         $key = 'SHIPPING_COSTS_WRAPPER';
         //if ($this->cart['user']['shipping_method_costs_including_vat']>0) {
         if ($this->cart['user']['shipping_method_label']) {
             $markerArray = array();
             $shipping_price_value = $order['shipping_method_costs'] + $order['orders_tax_data']['shipping_tax'];
             $markerArray['SHIPPING_COSTS_INCLUDING_VAT_LABEL'] = $this->pi_getLL('shipping_costs') . ' (' . $this->cart['user']['shipping_method_label'] . ')';
             $markerArray['SHIPPING_COSTS_INCLUDING_VAT'] = mslib_fe::amount2Cents($this->cart['user']['shipping_method_costs_including_vat']);
             $markerArray['SHIPPING_COSTS'] = mslib_fe::amount2Cents($this->cart['user']['shipping_method_costs']);
             $shippingCostsLineContent = $this->cObj->substituteMarkerArray($subparts[$key], $markerArray, '###|###');
             if (!$this->cart['user']['shipping_method_costs']) {
                 if ($this->ms['MODULES']['CHECKOUT_HIDE_ZERO_SHIPPING_COSTS_IN_SUMMARY'] == '1') {
                     $shippingCostsLineContent = '';
                 }
             }
             $subpartArray['###' . $key . '###'] = $shippingCostsLineContent;
         } else {
             $subpartArray['###' . $key . '###'] = '';
         }
         //SHIPPING_COSTS_WRAPPER EOF
         //PAYMENT_COSTS_WRAPPER
         $key = 'PAYMENT_COSTS_WRAPPER';
         //if ($this->cart['user']['payment_method_costs_including_vat']>0) {
         if ($this->cart['user']['payment_method_label']) {
             $markerArray = array();
             $markerArray['PAYMENT_COSTS_INCLUDING_VAT_LABEL'] = $this->pi_getLL('payment_costs') . ' (' . $this->cart['user']['payment_method_label'] . ')';
             $markerArray['PAYMENT_COSTS_INCLUDING_VAT'] = mslib_fe::amount2Cents($this->cart['user']['payment_method_costs_including_vat']);
             $markerArray['PAYMENT_COSTS'] = mslib_fe::amount2Cents($this->cart['user']['payment_method_costs']);
             $paymentCostsLineContent = $this->cObj->substituteMarkerArray($subparts[$key], $markerArray, '###|###');
             if (!$this->cart['user']['payment_method_costs']) {
                 if ($this->ms['MODULES']['CHECKOUT_HIDE_ZERO_PAYMENT_COSTS_IN_SUMMARY'] == '1') {
                     $paymentCostsLineContent = '';
                 }
             }
             $subpartArray['###' . $key . '###'] = $paymentCostsLineContent;
         } else {
             $subpartArray['###' . $key . '###'] = '';
         }
         //PAYMENT_COSTS_WRAPPER EOF
         //GRAND_TOTAL_WRAPPER
         $key = 'GRAND_TOTAL_WRAPPER_EXCLUDING_VAT';
         $markerArray['GRAND_TOTAL_COSTS_EXCLUDING_VAT_LABEL'] = ucfirst($this->pi_getLL('grand_total_excluding_vat'));
         //$markerArray['GRAND_TOTAL_COSTS_EXCLUDING_VAT']=mslib_fe::amount2Cents(($this->cart['summarize']['grand_total']-$this->cart['total_orders_tax_including_discount']));
         $markerArray['PRODUCTS_GRAND_TOTAL_EXCLUDING_VAT_PRICE'] = mslib_fe::amount2Cents($this->cart['summarize']['grand_total'] - $this->cart['summarize']['grand_total_vat']);
         $subpartArray['###' . $key . '###'] = $this->cObj->substituteMarkerArray($subparts[$key], $markerArray, '###|###');
         // Duplicate to make all tmpl files consistent
         $key = 'GRAND_TOTAL_EXCLUDING_VAT_WRAPPER';
         $markerArray['PRODUCTS_GRAND_TOTAL_EXCLUDING_VAT_LABEL'] = ucfirst($this->pi_getLL('grand_total_excluding_vat'));
         //$markerArray['PRODUCTS_GRAND_TOTAL_EXCLUDING_VAT_PRICE']=mslib_fe::amount2Cents(($this->cart['summarize']['grand_total']-$this->cart['total_orders_tax_including_discount']));
         $markerArray['PRODUCTS_GRAND_TOTAL_EXCLUDING_VAT_PRICE'] = mslib_fe::amount2Cents($this->cart['summarize']['grand_total'] - $this->cart['summarize']['grand_total_vat']);
         $subpartArray['###' . $key . '###'] = $this->cObj->substituteMarkerArray($subparts[$key], $markerArray, '###|###');
         //GRAND_TOTAL_WRAPPER
         $key = 'GRAND_TOTAL_WRAPPER';
         if (!$this->cart['summarize']['grand_total_vat']) {
             $markerArray['GRAND_TOTAL_COSTS_LABEL'] = ucfirst($this->pi_getLL('total_excl_vat'));
         } else {
             $markerArray['GRAND_TOTAL_COSTS_LABEL'] = ucfirst($this->pi_getLL('total'));
         }
         // $markerArray['GRAND_TOTAL_COSTS'] = mslib_fe::amount2Cents($subtotal+$order['orders_tax_data']['total_orders_tax']+$order['payment_method_costs']+$order['shipping_method_costs']-$order['discount']);
         $markerArray['GRAND_TOTAL_COSTS'] = mslib_fe::amount2Cents($this->cart['summarize']['grand_total']);
         $subpartArray['###' . $key . '###'] = $this->cObj->substituteMarkerArray($subparts[$key], $markerArray, '###|###');
         //GRAND_TOTAL_WRAPPER EOF
         /*
         		//DISCOUNT_WRAPPER
         		$key='DISCOUNT_WRAPPER';
         		if ($this->cart['discount_amount'] > 0) {
         			$DISCOUNT_WRAPPER = '
         			<tr>
         				<td class="msFrontGrandTotalDiscountLabel">'.$this->pi_getLL('discount').':</td>
         				<td class="msFrontGrandTotalDiscountValue">'.mslib_fe::amount2Cents($this->cart['discount_amount']).'</td>
         			</tr>';
         			$subpartArray['###'.$key.'###'] = $DISCOUNT_WRAPPER;
         		} else {
         			$subpartArray['###'.$key.'###'] = '';
         		}
         */
         //DISCOUNT_WRAPPER EOF
         // new
         //error_log(print_r($this->cart,1));
         // still not good. having partials of orders class
         //DISCOUNT_WRAPPER
         $key = 'DISCOUNT_WRAPPER';
         if ($this->cart['discount_amount'] > 0) {
             $this->cart['summarize']['total_orders_tax_including_discount'] = $this->cart['summarize']['total_orders_tax_including_discount'] - $this->cart['discount_amount'];
             $this->cart['summarize']['grand_total'] = round($this->cart['summarize']['grand_total'] - $row['discount'], 2);
             $markerArray = array();
             $markerArray['DISCOUNT_LABEL'] = $this->pi_getLL('discount');
             $markerArray['DISCOUNT'] = mslib_fe::amount2Cents($this->cart['discount_amount']);
             $subpartArray['###' . $key . '###'] = $this->cObj->substituteMarkerArray($subparts[$key], $markerArray, '###|###');
             // trick to reduce TAX costs
             //if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
             //$this->cart['summarize']['grand_total_vat']=(1-($this->cart['discount_amount']/$this->cart['summarize']['sub_total_including_vat']))*$this->cart['summarize']['grand_total_vat'];
             //}
         } else {
             $subpartArray['###' . $key . '###'] = '';
             $subpartArray['###NEWSUBTOTAL_WRAPPER###'] = '';
         }
         if (!$this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
             // new subtotal
             $markerArray = array();
             $markerArray['PRODUCTS_NEWSUB_TOTAL_PRICE_LABEL'] = $this->pi_getLL('new_subtotal_excl_vat');
             $new_subtotal_amount = $this->cart['summarize']['sub_total'] - $this->cart['discount_amount'] + $this->cart['user']['shipping_method_costs'] + $this->cart['user']['payment_method_costs'];
             $markerArray['PRODUCTS_NEWTOTAL_PRICE'] = mslib_fe::amount2Cents($new_subtotal_amount);
             $subpartArray['###NEWSUBTOTAL_WRAPPER###'] = $this->cObj->substituteMarkerArray($subparts['NEWSUBTOTAL_WRAPPER'], $markerArray, '###|###');
         } else {
             $subpartArray['###NEWSUBTOTAL_WRAPPER###'] = '';
         }
         //		error_log(print_r($this->cart['summarize'],1));
         //DISCOUNT_WRAPPER EOF
         //TAX_COSTS_WRAPPER
         $key = 'TAX_COSTS_WRAPPER';
         if ($this->cart['summarize']['grand_total_vat']) {
             $markerArray = array();
             $markerArray['TAX_RATE_LABEL'] = $this->pi_getLL('vat');
             $markerArray['INCLUDED_TAX_RATE_LABEL'] = $this->pi_getLL('included_vat_amount');
             $markerArray['TAX_COSTS'] = mslib_fe::amount2Cents($this->cart['summarize']['grand_total_vat']);
             $subpartArray['###' . $key . '###'] = $this->cObj->substituteMarkerArray($subparts[$key], $markerArray, '###|###');
         } else {
             $subpartArray['###' . $key . '###'] = '';
         }
         // new
         //TAX_COSTS_WRAPPER
         /*
         		$key='TAX_COSTS_WRAPPER';
         		if ($order['orders_tax_data']['total_orders_tax'] > 0) {
         			$TAX_COSTS_WRAPPER = '
         			<tr>
         				<td class="msFrontGrandTotalVatLabel">'.$this->pi_getLL('included_vat','Included VAT').'</td>
         				<td class="msFrontGrandTotalVatValue">'.mslib_fe::amount2Cents($this->cart['summarize']['grand_total_vat']).'</td>
         			</tr>';
         			$subpartArray['###'.$key.'###'] = $TAX_COSTS_WRAPPER;
         		} else {
         			$subpartArray['###'.$key.'###'] = '';
         		}
         */
         //TAX_COSTS_WRAPPER EOF
         // finally convert global markers and return output
         $content = $this->cObj->substituteMarkerArrayCached($subparts['template'], null, $subpartArray);
     }
     return $content;
 }
 $phpexcel = PHPExcel_IOFactory::load($dest);
 foreach ($phpexcel->getWorksheetIterator() as $worksheet) {
     $colname = array();
     $colcontent = array();
     $row_counter = 0;
     foreach ($worksheet->getRowIterator() as $row) {
         $cellIterator = $row->getCellIterator();
         $cellIterator->setIterateOnlyExistingCells(false);
         $col_counter = 0;
         foreach ($cellIterator as $cell) {
             $clean_products_data = ltrim(rtrim($cell->getCalculatedValue(), " ,"), " ,");
             $clean_products_data = trim($clean_products_data);
             if ($row->getRowIndex() > 1) {
                 $colcontent[$row_counter][$col_counter] = $clean_products_data;
             } else {
                 $colname[$col_counter] = mslib_befe::strtolower($clean_products_data);
             }
             $col_counter++;
         }
         $row_counter++;
     }
 }
 foreach ($colcontent as $row_key => $row_val) {
     $pid = '';
     $product_name = '';
     $model = '';
     $category = '';
     $category2 = '';
     $price = '';
     $sprice = '';
     $weight = '';
			return true;
		} else {
			return false;
		}
	}
</script>';
        $enabled_countries = mslib_fe::loadEnabledCountries();
        $dont_overide_billing_countries = false;
        $dont_overide_delivery_countries = false;
        foreach ($enabled_countries as $country) {
            $billing_countries[] = '<option value="' . mslib_befe::strtolower($country['cn_short_en']) . '" ' . (mslib_befe::strtolower($orders['billing_country']) == strtolower($country['cn_short_en']) ? 'selected' : '') . '>' . htmlspecialchars(mslib_fe::getTranslatedCountryNameByEnglishName($this->lang, $country['cn_short_en'])) . '</option>';
            if (mslib_befe::strtolower($orders['billing_country']) == strtolower($country['cn_short_en'])) {
                $dont_overide_billing_countries = true;
            }
            $delivery_countries[] = '<option value="' . mslib_befe::strtolower($country['cn_short_en']) . '" ' . (mslib_befe::strtolower($orders['delivery_country']) == strtolower($country['cn_short_en']) ? 'selected' : '') . '>' . htmlspecialchars(mslib_fe::getTranslatedCountryNameByEnglishName($this->lang, $country['cn_short_en'])) . '</option>';
            if (mslib_befe::strtolower($orders['delivery_country']) == strtolower($country['cn_short_en'])) {
                $dont_overide_delivery_countries = true;
            }
        }
        if ($dont_overide_billing_countries) {
            $billing_countries = array_merge(array('<option value="">' . ucfirst($this->pi_getLL('choose_country')) . '</option>'), $billing_countries);
        } else {
            $billing_countries = array_merge(array('<option value="' . $orders['billing_country'] . '">' . $orders['billing_country'] . '</option>'), $billing_countries);
        }
        $billing_countries_sb = '<select name="tx_multishop_pi1[billing_country]" id="edit_billing_country" required="required">' . implode("\n", $billing_countries) . '</select>';
        if ($dont_overide_delivery_countries) {
            $delivery_countries = array_merge(array('<option value="">' . ucfirst($this->pi_getLL('choose_country')) . '</option>'), $delivery_countries);
        } else {
            $delivery_countries = array_merge(array('<option value="' . $orders['delivery_country'] . '">' . $orders['delivery_country'] . '</option>'), $delivery_countries);
        }
        $delivery_countries_sb = '<select name="tx_multishop_pi1[delivery_country]" id="edit_delivery_country" required="required">' . implode("\n", $delivery_countries) . '</select>';
            }
            $sql_cat .= ")";
        }
        $sql = "select p.products_id, pd.products_name, p.products_model, cd.categories_name, p.products_price, cd.categories_id, p.products_weight, p.products_quantity, pd.products_shortdescription, pd.products_meta_keywords from tx_multishop_products p, tx_multishop_products_description pd, tx_multishop_categories_description cd, tx_multishop_categories c, tx_multishop_products_to_categories p2c where c.status = 1 and p.products_status = 1 and cd.language_id = 0 and pd.language_id = 0 " . $sql_cat . " and p.products_id = pd.products_id and pd.products_id = p2c.products_id and p2c.categories_id = cd.categories_id and cd.categories_id = c.categories_id group by p.products_id order by pd.products_name";
        $qry = $GLOBALS['TYPO3_DB']->sql_query($sql) or die('test: ' . $sql);
    }
} else {
    $filename = "producten_all_" . date('dmY') . ".xls";
    $sql = "select p.products_id, pd.products_name, p.products_model, cd.categories_name, p.products_price, cd.categories_id, p.products_weight, p.products_quantity, pd.products_shortdescription, pd.products_meta_keywords from tx_multishop_products p, tx_multishop_products_description pd, tx_multishop_categories_description cd, tx_multishop_categories c, tx_multishop_products_to_categories p2c where c.status = 1 and p.products_status = 1 and cd.language_id = 0 and pd.language_id = 0 and p.products_id = pd.products_id and pd.products_id = p2c.products_id and p2c.categories_id = cd.categories_id and cd.categories_id = c.categories_id group by p.products_id order by pd.products_name";
    $qry = $GLOBALS['TYPO3_DB']->sql_query($sql) or die('test' . $GLOBALS['TYPO3_DB']->sql_error());
}
$dir = $this->DOCUMENT_ROOT;
$export_file = $dir . "uploads/tx_multishop/tmp/" . $filename;
// Creating a worksheet
if ($this->get['cid'] > 0) {
    $worksheet_name = mslib_befe::strtolower(mslib_fe::getNameCategoryById($this->get['cid']));
    $worksheet_name = str_replace(array('/', '-', ' '), '_', $worksheet_name);
} else {
    $worksheet_name = 'product_data';
}
// Creating a workbook
$phpexcel = new PHPExcel();
$phpexcel->getActiveSheet()->setTitle($worksheet_name);
$phpexcel->setActiveSheetIndex(0);
$header_style['font'] = array('bold' => true);
// write the header
$sheet_header[] = 'PID';
$sheet_header[] = 'Product';
$sheet_header[] = 'Model';
$sheet_header[] = 'Category';
$sheet_header[] = 'Price';
Example #23
0
        //$str2="SELECT * from static_countries c, tx_multishop_countries_to_zones c2z where c2z.cn_iso_nr=c.cn_iso_nr order by c.cn_short_en";
        $qry2 = $GLOBALS['TYPO3_DB']->sql_query($str2);
        $enabled_countries = array();
        while (($row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry2)) != false) {
            $countries_name = mslib_fe::getTranslatedCountryNameByEnglishName($this->lang, $row2['cn_short_en']);
            $row2['locale_countries_name'] = $countries_name;
            $enabled_countries[$countries_name] = $row2;
        }
        ksort($enabled_countries);
        // load enabled countries to array eof
        if (count($enabled_countries) == 1) {
            $deliver_to_sb .= '<input name="deliver_to_country" type="hidden" value="' . mslib_befe::strtolower($enabled_countries[0]['cn_short_en']) . '" />';
        } else {
            $default_country = mslib_fe::getCountryByIso($this->tta_shop_info['cn_iso_nr']);
            foreach ($enabled_countries as $country) {
                $tmpcontent_con .= '<option value="' . mslib_befe::strtolower($country['cn_short_en']) . '" ' . (mslib_befe::strtolower($default_country['cn_short_en']) == mslib_befe::strtolower($country['cn_short_en']) ? 'selected' : '') . '>' . htmlspecialchars($country['locale_countries_name']) . '</option>';
            }
            if ($tmpcontent_con) {
                $deliver_to_sb .= '
				<select name="deliver_to_country" id="deliver_to_country" class="country" title="' . $this->pi_getLL('country_is_required') . '">
					' . $tmpcontent_con . '
				</select>
				';
            }
        }
        // country eof
        $subpartArray['###SHIPPING_COST_COUNTRY_SELECTION###'] = '
		<div class="shoppingcart_shipping_cost_wrapper">
			<div class="shipping_deliver_to"><label for="deliver_to_country">' . $this->pi_getLL('deliver_in') . '<label>' . $deliver_to_sb . '</div>
			<div class="shipping_deliver_by"></div>
		</div>
 function printOrderDetailsTable($order, $template_type = 'site')
 {
     $subtotalIncludingVatArray = array();
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_order.php']['printOrderDetailsTablePreHook'])) {
         $params = array('order' => &$order, 'template_type' => &$template_type);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_order.php']['printOrderDetailsTablePreHook'] as $funcRef) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
         }
     }
     switch ($template_type) {
         case 'site':
         case 'order_history_site':
             if ($this->conf['order_details_table_site_tmpl_path']) {
                 $template = $this->cObj->fileResource($this->conf['order_details_table_site_tmpl_path']);
             } else {
                 if (!$this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
                     $template = $this->cObj->fileResource(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('multishop') . 'templates/order_details_table_site_excluding_vat.tmpl');
                 } else {
                     $template = $this->cObj->fileResource(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('multishop') . 'templates/order_details_table_site.tmpl');
                 }
             }
             break;
         case 'email':
             if ($this->conf['order_details_table_email_tmpl_path']) {
                 $template = $this->cObj->fileResource($this->conf['order_details_table_email_tmpl_path']);
             } else {
                 $template = $this->cObj->fileResource(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('multishop') . 'templates/order_details_table_email.tmpl');
             }
             break;
         case 'pdf':
             if ($this->conf['order_details_table_pdf_tmpl_path']) {
                 $template = $this->cObj->fileResource($this->conf['order_details_table_pdf_tmpl_path']);
             } else {
                 $template = $this->cObj->fileResource(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('multishop') . 'templates/order_details_table_pdf.tmpl');
             }
             break;
     }
     $itemsWrapper = array();
     $c = true;
     foreach ($order['products'] as $product) {
         if ($product['products_id']) {
             $product_db = mslib_fe::getProduct($product['products_id']);
         }
         $subprices = '';
         $price = $product['qty'] * $product['final_price'];
         $item = array();
         // ITEM CLASS
         $item['ITEM_CLASS'] = ($c = !$c) ? 'odd' : 'even';
         // ITEM IMAGE
         if (!$product_db['products_image']) {
             $item['ITEM_IMAGE'] = '<div class="no_image_50"></div>';
         } else {
             if (!strstr(mslib_befe::strtolower($product_db['products_image']), 'http://') and !strstr(mslib_befe::strtolower($product_db['products_image']), 'https://')) {
                 $product_db['products_image'] = mslib_befe::getImagePath($product_db['products_image'], 'products', '50');
             }
             if (!file_exists($product_db['products_image'])) {
                 $item['ITEM_IMAGE'] = '<div class="no_image_50"></div>';
             } else {
                 $item['ITEM_IMAGE'] = '<img src="' . $product_db['products_image'] . '" title="' . htmlspecialchars($product['products_name']) . '">';
             }
         }
         // ITEM_NAME
         $tmp_item_name = array();
         $tmp_item_name['products_name'] = htmlspecialchars($product['products_name']);
         $tmp_item_name['products_model'] = '';
         if ($this->ms['MODULES']['DISPLAY_PRODUCTS_MODEL_IN_ORDER_DETAILS'] == '1' && !empty($product['products_model'])) {
             $tmp_item_name['products_model'] = ' (' . htmlspecialchars($product['products_model']) . ') ';
         }
         // for virtual product download link
         if ($template_type == 'email' && $order['mail_template'] == 'email_order_paid_letter' && $order['paid'] == 1 && isset($product['file_download_code']) && !empty($product['file_download_code'])) {
             $download_link = '<br/><a href="' . $this->FULL_HTTP_URL . mslib_fe::typolink(",2002", '&tx_multishop_pi1[page_section]=get_micro_download&orders_id=' . $order['orders_id'] . '&code=' . $product['file_download_code'], 1) . '" alt="' . htmlspecialchars($product['products_name']) . '" title="' . htmlspecialchars($product['products_name']) . '">Download product</a>';
             $tmp_item_name['download_link'] = $download_link;
         }
         if ($product['products_description']) {
             $tmp_item_name['products_description'] = '<br/>' . nl2br(htmlspecialchars($product['products_description']));
         }
         if ($this->ms['MODULES']['DISPLAY_EAN_IN_ORDER_DETAILS'] == '1' && !empty($product['ean_code'])) {
             $tmp_item_name['products_ean'] = '<br/>EAN: ' . htmlspecialchars($product['ean_code']);
         }
         if ($this->ms['MODULES']['DISPLAY_SKU_IN_ORDER_DETAILS'] == '1' && !empty($product['sku_code'])) {
             $tmp_item_name['products_sku'] = '<br/>' . $this->pi_getLL('sku_number', 'SKU') . ': ' . htmlspecialchars($product['sku_code']);
         }
         if ($this->ms['MODULES']['DISPLAY_VENDOR_IN_ORDER_DETAILS'] == '1' && !empty($product['vendor_code'])) {
             $tmp_item_name['products_vendor_code'] = '<br/>' . htmlspecialchars($this->pi_getLL('label_order_details_vendor_code', 'Vendor code')) . ': ' . htmlspecialchars($product['vendor_code']);
         }
         if (count($product['attributes'])) {
             foreach ($product['attributes'] as $tmpkey => $options) {
                 $subprices .= '<BR>';
                 if ($this->ms['MODULES']['FORCE_CHECKOUT_SHOW_PRICES_INCLUDING_VAT']) {
                     $tmp_tax = round($options['options_values_price'] * ($product['products_tax'] / 100), 2);
                     $attribute_price = +$options['options_values_price'] + $tmp_tax;
                 } else {
                     if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
                         $attribute_price = round($options['options_values_price'] * ($product['products_tax'] / 100), 4) + $options['options_values_price'];
                     } else {
                         $attribute_price = $options['options_values_price'];
                     }
                 }
                 $tmp_item_name['products_attributes'][] = '<BR>' . htmlspecialchars($options['products_options']) . ': ' . htmlspecialchars($options['products_options_values']);
                 $price = $price + $product['qty'] * ($options['price_prefix'] . $options['options_values_price']);
                 if ($price < 0) {
                     $price = 0;
                 }
                 if ($options['options_values_price'] > 0) {
                     $subprices .= mslib_fe::amount2Cents($product['qty'] * ($options['price_prefix'] . $attribute_price));
                 }
             }
         }
         if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_order']['printOrderDetailsTableItemNamePreProc'])) {
             $params = array('item_name' => &$tmp_item_name, 'order' => &$order, 'product' => &$product, 'template_type' => &$template_type);
             foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_order']['printOrderDetailsTableItemNamePreProc'] as $funcRef) {
                 \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
             }
         }
         $item_name = '';
         if (is_array($tmp_item_name) && count($tmp_item_name)) {
             foreach ($tmp_item_name as $array_item_name) {
                 if (is_array($array_item_name) && count($array_item_name)) {
                     $item_name .= implode('', $array_item_name);
                 } else {
                     $item_name .= $array_item_name;
                 }
             }
         }
         $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();
         $subProductStatus['###ITEMS_HEADER_PRODUCT_STATUS_WRAPPER###'] = '';
         $subparts['ITEMS_HEADER_WRAPPER'] = $this->cObj->substituteMarkerArrayCached($subparts['ITEMS_HEADER_WRAPPER'], array(), $subProductStatus);
         $subProductStatusPart = array();
         $subProductStatusPart['ITEMS_PRODUCT_STATUS_WRAPPER'] = $this->cObj->getSubpart($subparts['ITEMS_WRAPPER'], '###ITEMS_PRODUCT_STATUS_WRAPPER###');
         $subProductStatus = array();
         $subProductStatus['###ITEMS_PRODUCT_STATUS_WRAPPER###'] = '';
         $subparts['ITEMS_WRAPPER'] = $this->cObj->substituteMarkerArrayCached($subparts['ITEMS_WRAPPER'], array(), $subProductStatus);
     }
     $subpartArray = array();
     //ITEMS_HEADER_WRAPPER
     $markerArray = array();
     $markerArray['HEADING_PRODUCTS_ID'] = ucfirst($this->pi_getLL('products_id'));
     $markerArray['HEADING_PRODUCTS_NAME'] = ucfirst($this->pi_getLL('product'));
     $markerArray['HEADING_SKU'] = $this->pi_getLL('sku', 'SKU');
     $markerArray['HEADING_QUANTITY'] = $this->pi_getLL('qty');
     $markerArray['HEADING_PRICE'] = $this->pi_getLL('price');
     if (!$order['orders_tax_data']['total_orders_tax']) {
         $markerArray['HEADING_TOTAL'] = ucfirst($this->pi_getLL('total_excl_vat'));
     } else {
         $markerArray['HEADING_TOTAL'] = $this->pi_getLL('total');
     }
     $markerArray['HEADING_TOTAL'] = $this->pi_getLL('total');
     $markerArray['HEADING_VAT_RATE'] = $this->pi_getLL('vat');
     if ($this->ms['MODULES']['ADMIN_EDIT_ORDER_DISPLAY_ORDERS_PRODUCTS_STATUS'] > 0 && $template_type == 'order_history_site') {
         $markerArray['HEADING_PRODUCT_STATUS'] = $this->pi_getLL('order_product_status');
     }
     //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']['printOrderDetailsTableHeaderPostProc'])) {
         $params = array('markerArray' => &$markerArray, 'order' => &$order, 'template_type' => &$template_type);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_order']['printOrderDetailsTableHeaderPostProc'] as $funcRef) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
         }
     }
     $subpartArray['###ITEMS_HEADER_WRAPPER###'] = $this->cObj->substituteMarkerArray($subparts['ITEMS_HEADER_WRAPPER'], $markerArray, '###|###');
     //ITEMS_HEADER_WRAPPER EOF
     //ITEMS_WRAPPER
     $keys = array();
     $keys[] = 'ITEM_CLASS';
     $keys[] = 'ITEM_IMAGE';
     $keys[] = 'ITEM_NAME';
     $keys[] = 'ITEM_QUANTITY';
     $keys[] = 'ITEM_SKU';
     $keys[] = 'ITEM_VAT_RATE';
     $keys[] = 'ITEM_TOTAL';
     $keys[] = 'ITEM_PRICE_SINGLE';
     if ($this->ms['MODULES']['ADMIN_EDIT_ORDER_DISPLAY_ORDERS_PRODUCTS_STATUS'] > 0 && $template_type == 'order_history_site') {
         $keys[] = 'ITEM_PRODUCT_STATUS';
     }
     foreach ($itemsWrapper as $item) {
         $markerArray = array();
         foreach ($keys as $key) {
             $markerArray[$key] = $item[$key];
         }
         foreach ($item as $key => $val) {
             // hooked plugins wants to add more types. lets find them and add them
             if (!in_array($key, $keys)) {
                 $markerArray[$key] = $item[$key];
             }
         }
         $contentItem .= $this->cObj->substituteMarkerArray($subparts['ITEMS_WRAPPER'], $markerArray, '###|###');
     }
     $subpartArray['###ITEMS_WRAPPER###'] = $contentItem;
     //ITEMS_WRAPPER EOF
     //SUBTOTAL_WRAPPER
     $key = 'SUBTOTAL_WRAPPER';
     $markerArray = array();
     $markerArray['SUBTOTAL_LABEL'] = $this->pi_getLL('subtotal');
     $markerArray['PRODUCTS_TOTAL_PRICE_LABEL'] = $this->pi_getLL('total_price');
     $markerArray['PRODUCTS_TOTAL_PRICE_INCLUDING_VAT_LABEL'] = $this->pi_getLL('total_price');
     $markerArray['PRODUCTS_SUB_TOTAL_PRICE_LABEL'] = $this->pi_getLL('subtotal');
     // rounding is problem with including vat shops.
     $markerArray['PRODUCTS_TOTAL_PRICE_INCLUDING_VAT'] = mslib_fe::amount2Cents(mslib_fe::taxDecimalCrop(array_sum($subtotalIncludingVatArray), 2, true));
     //$markerArray['PRODUCTS_TOTAL_PRICE_INCLUDING_VAT']=mslib_fe::amount2Cents(array_sum($subtotalIncludingVatArray));
     $markerArray['PRODUCTS_TOTAL_PRICE'] = mslib_fe::amount2Cents($subtotal);
     $subpartArray['###' . $key . '###'] = $this->cObj->substituteMarkerArray($subparts[$key], $markerArray, '###|###');
     //SUBTOTAL_WRAPPER EOF
     //SHIPPING_COSTS_WRAPPER
     $key = 'SHIPPING_COSTS_WRAPPER';
     if ($order['shipping_method_label']) {
         $markerArray = array();
         $markerArray['SHIPPING_COSTS_LABEL'] = $this->pi_getLL('shipping_costs') . ' (' . $order['shipping_method_label'] . ')';
         $markerArray['SHIPPING_COSTS'] = mslib_fe::amount2Cents($order['shipping_method_costs']);
         $markerArray['SHIPPING_COSTS_INCLUDING_VAT_LABEL'] = $this->pi_getLL('shipping_costs') . ' (' . $order['shipping_method_label'] . ')';
         $markerArray['SHIPPING_COSTS_INCLUDING_VAT'] = mslib_fe::amount2Cents($order['shipping_method_costs'] + $order['orders_tax_data']['shipping_tax']);
         $subpartArray['###' . $key . '###'] = $this->cObj->substituteMarkerArray($subparts[$key], $markerArray, '###|###');
         if ($order['shipping_method_costs'] == '0') {
             if ($this->ms['MODULES']['CHECKOUT_HIDE_ZERO_SHIPPING_COSTS_IN_SUMMARY'] == '1') {
                 $subpartArray['###' . $key . '###'] = '';
             }
         }
     } else {
         $subpartArray['###' . $key . '###'] = '';
     }
     //SHIPPING_COSTS_WRAPPER EOF
     //PAYMENT_COSTS_WRAPPER
     $key = 'PAYMENT_COSTS_WRAPPER';
     if ($order['payment_method_label']) {
         $markerArray = array();
         $markerArray['PAYMENT_COSTS_LABEL'] = $this->pi_getLL('payment_costs') . ' (' . $order['payment_method_label'] . ')';
         $markerArray['PAYMENT_COSTS'] = mslib_fe::amount2Cents($order['payment_method_costs']);
         $markerArray['PAYMENT_COSTS_INCLUDING_VAT_LABEL'] = $this->pi_getLL('payment_costs') . ' (' . $order['payment_method_label'] . ')';
         $markerArray['PAYMENT_COSTS_INCLUDING_VAT'] = mslib_fe::amount2Cents($order['payment_method_costs'] + $order['orders_tax_data']['payment_tax']);
         $subpartArray['###' . $key . '###'] = $this->cObj->substituteMarkerArray($subparts[$key], $markerArray, '###|###');
         if ($order['payment_method_costs'] == '0') {
             if ($this->ms['MODULES']['CHECKOUT_HIDE_ZERO_PAYMENT_COSTS_IN_SUMMARY'] == '1') {
                 $subpartArray['###' . $key . '###'] = '';
             }
         }
     } else {
         $subpartArray['###' . $key . '###'] = '';
     }
     //PAYMENT_COSTS_WRAPPER EOF
     //GRAND_TOTAL_EXCLUDING_VAT_WRAPPER
     $key = 'GRAND_TOTAL_EXCLUDING_VAT_WRAPPER';
     $markerArray = array();
     $markerArray['PRODUCTS_GRAND_TOTAL_EXCLUDING_VAT_LABEL'] = $this->pi_getLL('grand_total_excluding_vat');
     $markerArray['PRODUCTS_GRAND_TOTAL_EXCLUDING_VAT_PRICE'] = mslib_fe::amount2Cents($order['grand_total_excluding_vat']);
     $subpartArray['###' . $key . '###'] = $this->cObj->substituteMarkerArray($subparts[$key], $markerArray, '###|###');
     //GRAND_TOTAL_EXCLUDING_VAT_WRAPPER EOF
     //GRAND_TOTAL_WRAPPER
     $key = 'GRAND_TOTAL_WRAPPER';
     $markerArray = array();
     if (!$order['orders_tax_data']['total_orders_tax']) {
         $markerArray['GRAND_TOTAL_COSTS_LABEL'] = ucfirst($this->pi_getLL('total_excl_vat'));
     } else {
         $markerArray['GRAND_TOTAL_COSTS_LABEL'] = ucfirst($this->pi_getLL('total'));
     }
     //		$markerArray['GRAND_TOTAL_COSTS'] = mslib_fe::amount2Cents($subtotal+$order['orders_tax_data']['total_orders_tax']+$order['payment_method_costs']+$order['shipping_method_costs']-$order['discount']);
     $markerArray['GRAND_TOTAL_COSTS'] = mslib_fe::amount2Cents($order['orders_tax_data']['grand_total']);
     $subpartArray['###' . $key . '###'] = $this->cObj->substituteMarkerArray($subparts[$key], $markerArray, '###|###');
     //GRAND_TOTAL_WRAPPER EOF
     //DISCOUNT_WRAPPER
     $key = 'DISCOUNT_WRAPPER';
     if ($order['discount'] > 0) {
         $markerArray = array();
         $markerArray['DISCOUNT_LABEL'] = $this->pi_getLL('discount');
         $markerArray['DISCOUNT'] = mslib_fe::amount2Cents($order['discount']);
         $subpartArray['###' . $key . '###'] = $this->cObj->substituteMarkerArray($subparts[$key], $markerArray, '###|###');
     } else {
         $subpartArray['###' . $key . '###'] = '';
         $subpartArray['###NEWSUBTOTAL_WRAPPER###'] = '';
     }
     //DISCOUNT_WRAPPER EOF
     if (!$this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
         // new subtotal
         $markerArray = array();
         $markerArray['PRODUCTS_NEWSUB_TOTAL_PRICE_LABEL'] = $this->pi_getLL('new_subtotal_excl_vat');
         $new_subtotal_amount = $subtotal - $order['discount'] + $order['shipping_method_costs'] + $order['payment_method_costs'];
         $markerArray['PRODUCTS_NEWTOTAL_PRICE'] = mslib_fe::amount2Cents($new_subtotal_amount);
         $subpartArray['###NEWSUBTOTAL_WRAPPER###'] = $this->cObj->substituteMarkerArray($subparts['NEWSUBTOTAL_WRAPPER'], $markerArray, '###|###');
     } else {
         $subpartArray['###NEWSUBTOTAL_WRAPPER###'] = '';
     }
     //TAX_COSTS_WRAPPER
     $key = 'TAX_COSTS_WRAPPER';
     if ($order['orders_tax_data']['total_orders_tax']) {
         $markerArray = array();
         $markerArray['TAX_RATE_LABEL'] = $this->pi_getLL('vat');
         $markerArray['INCLUDED_TAX_RATE_LABEL'] = $this->pi_getLL('included_vat_amount');
         $markerArray['TAX_COSTS'] = mslib_fe::amount2Cents($order['orders_tax_data']['total_orders_tax']);
         $subpartArray['###' . $key . '###'] = $this->cObj->substituteMarkerArray($subparts[$key], $markerArray, '###|###');
     } else {
         $subpartArray['###' . $key . '###'] = '';
     }
     // finally convert global markers and return output
     //hook to let other plugins further manipulate the replacers
     $content = $this->cObj->substituteMarkerArrayCached($subparts['template'], null, $subpartArray);
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_order']['printOrderDetailsTablePostProc'])) {
         $params = array('content' => &$content, 'order' => &$order, 'template_type' => &$template_type, 'subparts' => &$subparts, 'subpartArray' => &$subpartArray);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_order']['printOrderDetailsTablePostProc'] as $funcRef) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
         }
     }
     return $content;
 }
Example #25
0
        $available_sid[] = $mapped_shipping_method['id'];
    }
}
//
if (count($available_sid) > 0) {
    //if (!$this->ms['MODULES']['PRODUCT_EDIT_METHOD_FILTER']) {
    if (!$this->post['tx_multishop_pi1']['sid'] or !in_array($this->post['tx_multishop_pi1']['sid'], $available_sid)) {
        // if the posted shipping id is not in the available shipping method array then select the first valid shipping method
        $this->post['tx_multishop_pi1']['sid'] = $available_sid[0];
    }
    //}
    $shipping_method = mslib_fe::getShippingMethod($this->post['tx_multishop_pi1']['sid'], 's.id', $countries_id, true);
    $shipping_method_code = $shipping_method['code'];
    if (strlen($shipping_method['name']) > 1) {
        $char = substr($shipping_method['name'], 1, 1);
        if ($char == mslib_befe::strtolower($char)) {
            $shipping_method['name'] = $shipping_method['name'];
        }
    } else {
        $shipping_method['name'] = $shipping_method['name'];
    }
    $shipping_method_label = $shipping_method['name'];
    // shipping
    $price = '';
    $priceArray = mslib_fe::getShippingCosts($countries_id, $this->post['tx_multishop_pi1']['sid']);
    if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
        $data['shipping_cost'] = '';
        $data['shipping_cost_cur'] = '';
        if ($priceArray['shipping_costs_including_vat'] > 0 || $this->ms['MODULES']['ALWAYS_DISPLAY_SHIPPING_COSTS'] > 0) {
            $data['shipping_cost'] = '' . $priceArray['shipping_costs_including_vat'];
            $data['shipping_cost_cur'] = mslib_fe::amount2Cents($priceArray['shipping_costs_including_vat']);
Example #26
0
    public function jQueryAdminMenu()
    {
        static $ms_menu;
        if (is_array($ms_menu)) {
            return $ms_menu;
        }
        $order_status_array = mslib_fe::getAllOrderStatus($GLOBALS['TSFE']->sys_language_uid);
        $ms_menu = array();
        $ms_menu['header']['ms_admin_logo']['description'] = '<a href="' . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_home') . '">';
        //$ms_menu['header']['ms_admin_logo']['description']='<a href="'.$this->conf['admin_development_company_url'].'" title="'.htmlspecialchars($this->conf['admin_development_company_name']).'" alt="'.htmlspecialchars($this->conf['admin_development_company_name']).'" target="_blank">';
        if ($this->conf['admin_development_company_logo']) {
            // Display custom logo of development company
            $ms_menu['header']['ms_admin_logo']['description'] .= '<img src="' . $this->conf['admin_development_company_logo'] . '">';
        } else {
            // Display TYPO3 Multishop through CSS
            $ms_menu['header']['ms_admin_logo']['description'] .= '<span></span>';
        }
        $ms_menu['header']['ms_admin_logo']['description'] .= '</a>';
        //		$ms_menu['header']['ms_admin_logo']['description']='<a href="'.mslib_fe::typolink($this->shop_pid.',2003','tx_multishop_pi1[page_section]=admin_home').'" title="Home dashboard" alt="Home dashboard"><img src="'.$this->conf['admin_development_company_logo'].'"></a>';
        if ($this->ROOTADMIN_USER or $this->CATALOGADMIN_USER) {
            $ms_menu['header']['ms_admin_catalog']['label'] = $this->pi_getLL('admin_catalog');
            $ms_menu['header']['ms_admin_catalog']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_products_search_and_edit&cid=' . $this->get['categories_id']);
            //mslib_fe::typolink($this->shop_pid, '', 1);
            $ms_menu['header']['ms_admin_catalog']['class'] = 'fa fa-book';
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['label'] = $this->pi_getLL('admin_categories');
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['description'] = $this->pi_getLL('admin_add_and_modify_categories_here') . '.';
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_categories&cid=' . $this->get['categories_id']);
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['class'] = 'fa fa-folder';
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_search_and_edit_categories']['label'] = $this->pi_getLL('overview');
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_search_and_edit_categories']['description'] = $this->pi_getLL('admin_here_you_can_search_and_update_categories') . '.';
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_search_and_edit_categories']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_categories&cid=' . $this->get['categories_id']);
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_search_and_edit_categories']['class'] = 'fa fa-info-circle';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_categories' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_categories') {
                $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_search_and_edit_categories']['active'] = 1;
            }
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_new_category']['label'] = $this->pi_getLL('add');
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_new_category']['description'] = $this->pi_getLL('admin_add_new_category_to_the_catalog') . '.';
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_new_category']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=add_category&cid=' . $this->get['categories_id'] . '&action=add_category');
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_new_category']['class'] = 'fa fa-plus-circle';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'add_category' || $this->post['tx_multishop_pi1']['page_section'] == 'add_category') {
                $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_new_category']['active'] = 1;
            }
            if ($this->get['tx_multishop_pi1']['page_section'] == 'edit_category' || $this->post['tx_multishop_pi1']['page_section'] == 'edit_category') {
                $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_new_category']['active'] = 1;
            }
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_new_multiple_category']['label'] = $this->pi_getLL('admin_new_multiple_category', 'NEW CATEGORIES');
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_new_multiple_category']['description'] = $this->pi_getLL('admin_add_new_multiple_category_to_the_catalog', 'Add new categories simultaneous') . '.';
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_new_multiple_category']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=add_multiple_category&cid=' . $this->get['categories_id'] . '&action=add_multiple_category');
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_new_multiple_category']['class'] = 'fa fa-plus-circle';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'add_multiple_category' || $this->post['tx_multishop_pi1']['page_section'] == 'add_multiple_category') {
                $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_new_multiple_category']['active'] = 1;
            }
            if ($this->get['categories_id']) {
                $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_edit_category']['label'] = $this->pi_getLL('admin_edit_category');
                $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_edit_category']['description'] = $this->pi_getLL('admin_edit_category_description') . '.';
                $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_edit_category']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=edit_category&cid=' . $this->get['categories_id'] . '&action=edit_category');
                $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_edit_category']['link_params'] = 'id="msadmin_edit_category"';
                $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_edit_category']['class'] = 'fa fa-pencil';
                if ($this->get['tx_multishop_pi1']['page_section'] == 'edit_category' || $this->post['tx_multishop_pi1']['page_section'] == 'edit_category') {
                    $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_edit_category']['active'] = 1;
                }
                $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_delete_category']['label'] = $this->pi_getLL('admin_delete_category');
                $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_delete_category']['description'] = $this->pi_getLL('admin_delete_category_description') . '.';
                $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_delete_category']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=delete_category&cid=' . $this->get['categories_id'] . '&action=delete_category');
                $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_delete_category']['class'] = 'fa fa-trash-o';
                if ($this->get['tx_multishop_pi1']['page_section'] == 'delete_category' || $this->post['tx_multishop_pi1']['page_section'] == 'delete_category') {
                    $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_delete_category']['active'] = 1;
                }
            }
            // merge categories
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_merge_categories']['label'] = $this->pi_getLL('merge_categories');
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_merge_categories']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=merge_categories');
            $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_merge_categories']['class'] = 'fa fa-compress';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'merge_categories' || $this->post['tx_multishop_pi1']['page_section'] == 'merge_categories') {
                $ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_merge_categories']['active'] = 1;
            }
            // remove incomplete p2c link
            //$ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_remove_incomplete_p2c_link']['label']=$this->pi_getLL('remove_incomplete_p2c_link');
            //$ms_menu['header']['ms_admin_catalog']['subs']['admin_categories']['subs']['admin_remove_incomplete_p2c_link']['link']=mslib_fe::typolink($this->shop_pid, 'tx_multishop_pi1[page_section]=remove_incomplete_p2c_link');
            //
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['label'] = $this->pi_getLL('admin_products');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['description'] = $this->pi_getLL('admin_add_and_modify_products_here') . '.';
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_products_search_and_edit&cid=' . $this->get['categories_id']);
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['class'] = 'fa fa-cube';
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_search_and_edit_products']['label'] = $this->pi_getLL('overview');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_search_and_edit_products']['description'] = $this->pi_getLL('admin_here_you_can_search_and_update_products') . '.';
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_search_and_edit_products']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_products_search_and_edit&cid=');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_search_and_edit_products']['class'] = 'fa fa-info-circle';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_products_search_and_edit' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_products_search_and_edit') {
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_search_and_edit_products']['active'] = 1;
            }
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_new_product']['label'] = $this->pi_getLL('add');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_new_product']['description'] = $this->pi_getLL('admin_create_new_products_here') . '.';
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_new_product']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=add_product&cid=' . $this->get['categories_id'] . '&action=add_product');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_new_product']['class'] = 'fa fa-plus-circle';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'add_product' || $this->post['tx_multishop_pi1']['page_section'] == 'add_product') {
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_new_product']['active'] = 1;
            }
            if ($this->get['tx_multishop_pi1']['page_section'] == 'edit_product' || $this->post['tx_multishop_pi1']['page_section'] == 'edit_product') {
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_new_product']['active'] = 1;
            }
            if ($this->get['products_id']) {
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_edit_product']['label'] = $this->pi_getLL('admin_edit_product');
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_edit_product']['description'] = $this->pi_getLL('admin_edit_product_description') . '.';
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_edit_product']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=edit_product&cid=' . $this->get['categories_id'] . '&pid=' . $this->get['products_id'] . '&action=edit_product');
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_edit_product']['link_params'] = '';
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_edit_product']['class'] = 'fa fa-pencil';
                if ($this->get['tx_multishop_pi1']['page_section'] == 'edit_product' || $this->post['tx_multishop_pi1']['page_section'] == 'edit_product') {
                    $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_edit_product']['active'] = 1;
                }
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_delete_product']['label'] = $this->pi_getLL('admin_delete_product');
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_delete_product']['description'] = $this->pi_getLL('admin_delete_product_description') . '.';
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_delete_product']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', '&tx_multishop_pi1[page_section]=delete_product&cid=' . $product['categories_id'] . '&pid=' . $this->get['products_id'] . '&action=delete_product');
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_delete_product']['class'] = 'fa fa-trash-o';
                if ($this->get['tx_multishop_pi1']['page_section'] == 'delete_product' || $this->post['tx_multishop_pi1']['page_section'] == 'delete_product') {
                    $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_delete_product']['active'] = 1;
                }
            }
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_attributes']['label'] = $this->pi_getLL('admin_product_attributes');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_attributes']['description'] = $this->pi_getLL('admin_maintain_product_attributes') . '.';
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_attributes']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_product_attributes');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_attributes']['class'] = 'fa fa-puzzle-piece';
            /*
            if ($this->get['tx_multishop_pi1']['page_section']=='admin_product_attributes' || $this->post['tx_multishop_pi1']['page_section']=='admin_product_attributes') {
            	$ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_attributes']['active']=1;
            }
            */
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_attributes']['subs']['overview']['label'] = $this->pi_getLL('overview');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_attributes']['subs']['overview']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_product_attributes');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_attributes']['subs']['overview']['class'] = 'fa fa-info-circle';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_product_attributes' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_product_attributes') {
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_attributes']['subs']['overview']['active'] = 1;
            }
            // merge attributes options
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_attributes']['subs']['admin_merge_attribute_options']['label'] = $this->pi_getLL('merge_attribute_options');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_attributes']['subs']['admin_merge_attribute_options']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=merge_attribute_options');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_attributes']['subs']['admin_merge_attribute_options']['class'] = 'fa fa-compress';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'merge_attribute_options' || $this->post['tx_multishop_pi1']['page_section'] == 'merge_attribute_options') {
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_attributes']['subs']['admin_merge_attribute_options']['active'] = 1;
            }
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_attributes']['subs']['admin_merge_attribute_values']['label'] = $this->pi_getLL('merge_attribute_values');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_attributes']['subs']['admin_merge_attribute_values']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=merge_attribute_options_values');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_attributes']['subs']['admin_merge_attribute_values']['class'] = 'fa fa-compress';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'merge_attribute_options_values' || $this->post['tx_multishop_pi1']['page_section'] == 'merge_attribute_options_values') {
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_attributes']['subs']['admin_merge_attribute_values']['active'] = 1;
            }
            if ($this->ms['MODULES']['ENABLE_ATTRIBUTES_OPTIONS_GROUP']) {
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_attributes_options_groups']['label'] = $this->pi_getLL('admin_attributes_options_groups');
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_attributes_options_groups']['description'] = $this->pi_getLL('admin_maintain_attributes_options_groups') . '.';
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_attributes_options_groups']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_attributes_options_groups');
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_attributes_options_groups']['class'] = 'fa fa-object-group';
                if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_attributes_options_groups' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_attributes_options_groups') {
                    $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_attributes_options_groups']['active'] = 1;
                }
            }
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_update_prices']['label'] = $this->pi_getLL('admin_update_prices');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_update_prices']['description'] = $this->pi_getLL('admin_update_product_prices_by_percentage') . '.';
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_update_prices']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_mass_product_updater');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_update_prices']['class'] = 'fa fa-money';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_mass_product_updater' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_mass_product_updater') {
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_update_prices']['active'] = 1;
            }
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_import_products']['label'] = $this->pi_getLL('import');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_import_products']['description'] = $this->pi_getLL('admin_import_your_custom_productfeed_by_using_this_wizard') . '.';
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_import_products']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_import');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_import_products']['class'] = 'fa fa-download';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_import' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_import') {
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_import_products']['active'] = 1;
            }
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_feeds']['label'] = $this->pi_getLL('export');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_feeds']['description'] = $this->pi_getLL('admin_create_your_custom_product_feeds_by_using_this_wizard') . '.';
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_feeds']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_product_feeds');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_feeds']['class'] = 'fa fa-upload';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_product_feeds' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_product_feeds') {
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_product_feeds']['active'] = 1;
            }
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_order_units']['label'] = $this->pi_getLL('admin_order_units');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_order_units']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_order_units');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_order_units']['class'] = 'fa fa-mouse-pointer';
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_order_units']['description'] = '';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_order_units' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_order_units') {
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_order_units']['active'] = 1;
            }
            //
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_sort_product']['label'] = $this->pi_getLL('admin_sort_products');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_sort_product']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_sort_products');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_sort_product']['class'] = 'fa fa-sort';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_sort_products' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_sort_products') {
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_sort_product']['active'] = 1;
            }
            //
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_manufacturers']['label'] = $this->pi_getLL('admin_manufacturers');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_manufacturers']['description'] = $this->pi_getLL('admin_add_and_modify_manufacturers_here') . '.';
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_manufacturers']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_manufacturers');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_manufacturers']['class'] = 'fa fa-industry';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_manufacturers' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_manufacturers') {
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_manufacturers']['active'] = 1;
            }
            if ($this->get['tx_multishop_pi1']['page_section'] == 'add_manufacturer' || $this->post['tx_multishop_pi1']['page_section'] == 'add_manufacturer') {
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_manufacturers']['active'] = 1;
            }
            if ($this->get['tx_multishop_pi1']['page_section'] == 'edit_manufacturer' || $this->post['tx_multishop_pi1']['page_section'] == 'edit_manufacturer') {
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_manufacturers']['active'] = 1;
            }
            // merge manufacturers
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_manufacturers']['subs']['admin_merge_manufacturers']['label'] = $this->pi_getLL('merge_manufacturers');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_manufacturers']['subs']['admin_merge_manufacturers']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=merge_manufacturers');
            $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_manufacturers']['subs']['admin_merge_manufacturers']['class'] = 'fa fa-compress';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'merge_manufacturers' || $this->post['tx_multishop_pi1']['page_section'] == 'merge_manufacturers') {
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_products']['subs']['admin_merge_manufacturers']['active'] = 1;
            }
            if ($this->ms['MODULES']['COUPONS']) {
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_coupon']['label'] = $this->pi_getLL('admin_coupon_module');
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_coupon']['description'] = $this->pi_getLL('admin_give_customers_discount_by_coupon_code') . '.';
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_coupon']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_coupons');
                $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_coupon']['class'] = 'fa fa-tag';
                if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_coupons' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_coupons') {
                    $ms_menu['header']['ms_admin_catalog']['subs']['ms_admin_coupon']['active'] = 1;
                }
            }
        }
        // END IF CATALOGADMIN_USER
        if ($this->ROOTADMIN_USER or $this->CUSTOMERSADMIN_USER) {
            $ms_menu['header']['ms_admin_customers']['label'] = $this->pi_getLL('admin_customers');
            $ms_menu['header']['ms_admin_customers']['description'] = $this->pi_getLL('admin_customers_description', 'Customers') . '.';
            $ms_menu['header']['ms_admin_customers']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_customers');
            $ms_menu['header']['ms_admin_customers']['class'] = 'fa fa-user';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_customers' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_customers') {
                $ms_menu['header']['ms_admin_customers']['active'] = 1;
            }
            $ms_menu['header']['ms_admin_customers']['subs']['admin_customers']['label'] = $this->pi_getLL('overview');
            $ms_menu['header']['ms_admin_customers']['subs']['admin_customers']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_customers');
            $ms_menu['header']['ms_admin_customers']['subs']['admin_customers']['class'] = 'fa fa-info-circle';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_customers' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_customers') {
                $ms_menu['header']['ms_admin_customers']['subs']['admin_customers']['active'] = 1;
            }
            $ms_menu['header']['ms_admin_customers']['subs']['admin_new_customer']['label'] = $this->pi_getLL('add');
            $ms_menu['header']['ms_admin_customers']['subs']['admin_new_customer']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', '&tx_multishop_pi1[page_section]=add_customer&action=add_customer');
            $ms_menu['header']['ms_admin_customers']['subs']['admin_new_customer']['link_params'] = '';
            $ms_menu['header']['ms_admin_customers']['subs']['admin_new_customer']['class'] = 'fa fa-plus-circle';
            if ($this->post['tx_multishop_pi1']['page_section'] == 'add_customer' || $this->post['tx_multishop_pi1']['page_section'] == 'add_customer') {
                $ms_menu['header']['ms_admin_customers']['subs']['admin_new_customer']['active'] = 1;
            }
            if ($this->post['tx_multishop_pi1']['page_section'] == 'edit_customer' || $this->post['tx_multishop_pi1']['page_section'] == 'edit_customer') {
                $ms_menu['header']['ms_admin_customers']['subs']['admin_new_customer']['active'] = 1;
            }
            $ms_menu['header']['ms_admin_customers']['subs']['admin_customer_groups']['label'] = $this->pi_getLL('admin_customer_groups');
            $ms_menu['header']['ms_admin_customers']['subs']['admin_customer_groups']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_customer_groups');
            $ms_menu['header']['ms_admin_customers']['subs']['admin_customer_groups']['class'] = 'fa fa-users';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_customer_groups' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_customer_groups') {
                $ms_menu['header']['ms_admin_customers']['subs']['admin_customer_groups']['active'] = 1;
            }
            if ($this->get['tx_multishop_pi1']['page_section'] == 'edit_customer_group' || $this->post['tx_multishop_pi1']['page_section'] == 'edit_customer_group') {
                $ms_menu['header']['ms_admin_customers']['subs']['admin_customer_groups']['active'] = 1;
            }
            if ($this->ms['MODULES']['CUSTOMERS_DATA_EXPORT_IMPORT']) {
                $ms_menu['header']['ms_admin_customers']['subs']['admin_import_customers']['label'] = $this->pi_getLL('import');
                $ms_menu['header']['ms_admin_customers']['subs']['admin_import_customers']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_customer_import');
                $ms_menu['header']['ms_admin_customers']['subs']['admin_import_customers']['class'] = 'fa fa-download';
                if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_customer_import' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_customer_import') {
                    $ms_menu['header']['ms_admin_customers']['subs']['admin_import_customers']['active'] = 1;
                }
                $ms_menu['header']['ms_admin_customers']['subs']['admin_export_customers']['label'] = $this->pi_getLL('export');
                $ms_menu['header']['ms_admin_customers']['subs']['admin_export_customers']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_customer_export');
                $ms_menu['header']['ms_admin_customers']['subs']['admin_export_customers']['class'] = 'fa fa-upload';
                if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_customer_export' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_customer_export') {
                    $ms_menu['header']['ms_admin_customers']['subs']['admin_export_customers']['active'] = 1;
                }
            }
        }
        if ($this->ROOTADMIN_USER or $this->CUSTOMERSADMIN_USER and $this->ORDERSADMIN_USER) {
            $ms_menu['header']['ms_admin_orders']['label'] = $this->pi_getLL('admin_orders');
            $ms_menu['header']['ms_admin_orders']['description'] = $this->pi_getLL('admin_orders_description', 'Orders') . '.';
            $ms_menu['header']['ms_admin_orders']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_orders');
            $ms_menu['header']['ms_admin_orders']['class'] = 'fa fa-book';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_orders' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_orders') {
                $ms_menu['header']['ms_admin_orders']['active'] = 1;
            }
            $ms_menu['header']['ms_admin_orders']['subs']['admin_orders']['label'] = $this->pi_getLL('overview');
            $ms_menu['header']['ms_admin_orders']['subs']['admin_orders']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_orders');
            $ms_menu['header']['ms_admin_orders']['subs']['admin_orders']['class'] = 'fa fa-info-circle';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_orders' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_orders') {
                $ms_menu['header']['ms_admin_orders']['subs']['admin_orders']['active'] = 1;
            }
            if ($this->ms['MODULES']['MANUAL_ORDER']) {
                $ms_menu['header']['ms_admin_orders']['subs']['admin_manual_orders']['label'] = $this->pi_getLL('add');
                $ms_menu['header']['ms_admin_orders']['subs']['admin_manual_orders']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_new_order');
                $ms_menu['header']['ms_admin_orders']['subs']['admin_manual_orders']['class'] = 'fa fa-plus-circle';
                if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_new_order' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_new_order') {
                    $ms_menu['header']['ms_admin_orders']['subs']['admin_manual_orders']['active'] = 1;
                }
                if ($this->get['tx_multishop_pi1']['page_section'] == 'edit_order' || $this->post['tx_multishop_pi1']['page_section'] == 'edit_order') {
                    $ms_menu['header']['ms_admin_orders']['subs']['admin_manual_orders']['active'] = 1;
                }
            } else {
                if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_new_order' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_new_order') {
                    $ms_menu['header']['ms_admin_orders']['subs']['admin_orders']['active'] = 1;
                }
            }
            // orders export wizard
            $ms_menu['header']['ms_admin_orders']['subs']['admin_orders_export']['label'] = $this->pi_getLL('export');
            $ms_menu['header']['ms_admin_orders']['subs']['admin_orders_export']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_export_orders');
            $ms_menu['header']['ms_admin_orders']['subs']['admin_orders_export']['class'] = 'fa fa-upload';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_export_orders' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_export_orders') {
                $ms_menu['header']['ms_admin_orders']['subs']['admin_orders_export']['active'] = 1;
            }
            /*
            if ($this->ms['MODULES']['ADMIN_ORDER_PROPOSAL_MODULE']) {
            	$ms_menu['header']['admin_proposals']['label']=$this->pi_getLL('admin_proposals');
            	$ms_menu['header']['admin_proposals']['description']=$this->pi_getLL('admin_proposals_description').'.';
            	$ms_menu['header']['admin_proposals']['link']=mslib_fe::typolink($this->shop_pid.',2003', 'tx_multishop_pi1[page_section]=admin_orders&tx_multishop_pi1[is_proposal]=1');
            	$ms_menu['header']['admin_proposals']['subs']['admin_proposals_new']['label']=$this->pi_getLL('admin_new_proposal');
            	$ms_menu['header']['admin_proposals']['subs']['admin_proposals_new']['description']=$this->pi_getLL('admin_new_proposal_description');
            	$ms_menu['header']['admin_proposals']['subs']['admin_proposals_new']['link']=mslib_fe::typolink($this->shop_pid.',2003', 'tx_multishop_pi1[page_section]=admin_new_order&tx_multishop_pi1[is_proposal]=1');
            	$ms_menu['header']['admin_proposals']['subs']['admin_proposals_overview']['label']=$this->pi_getLL('admin_proposals_overview');
            	$ms_menu['header']['admin_proposals']['subs']['admin_proposals_overview']['description']=$this->pi_getLL('admin_proposals_overview_description');
            	$ms_menu['header']['admin_proposals']['subs']['admin_proposals_overview']['link']=mslib_fe::typolink($this->shop_pid.',2003', 'tx_multishop_pi1[page_section]=admin_orders&tx_multishop_pi1[is_proposal]=1');
            }
            */
            $ms_menu['header']['ms_admin_orders']['subs']['admin_orders_status']['label'] = $this->pi_getLL('admin_orders_status');
            $ms_menu['header']['ms_admin_orders']['subs']['admin_orders_status']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_orders_status');
            $ms_menu['header']['ms_admin_orders']['subs']['admin_orders_status']['class'] = 'fa fa-info';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_orders_status' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_orders_status') {
                $ms_menu['header']['ms_admin_orders']['subs']['admin_orders_status']['active'] = 1;
            }
            if ($this->ms['MODULES']['ADMIN_INVOICE_MODULE']) {
                $ms_menu['header']['ms_admin_invoices']['label'] = $this->pi_getLL('admin_invoices');
                $ms_menu['header']['ms_admin_invoices']['description'] = $this->pi_getLL('admin_invoices_overview_description');
                $ms_menu['header']['ms_admin_invoices']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_invoices');
                $ms_menu['header']['ms_admin_invoices']['class'] = 'fa fa-file';
                if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_invoices' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_invoices') {
                    $ms_menu['header']['ms_admin_invoices']['active'] = 1;
                }
                $ms_menu['header']['ms_admin_invoices']['subs']['admin_invoices']['label'] = $this->pi_getLL('overview');
                $ms_menu['header']['ms_admin_invoices']['subs']['admin_invoices']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_invoices');
                $ms_menu['header']['ms_admin_invoices']['subs']['admin_invoices']['class'] = 'fa fa-info-circle';
                if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_invoices' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_invoices') {
                    $ms_menu['header']['ms_admin_invoices']['subs']['admin_invoices']['active'] = 1;
                }
                // invoices export wizard
                $ms_menu['header']['ms_admin_invoices']['subs']['admin_invoices_export']['label'] = $this->pi_getLL('export');
                $ms_menu['header']['ms_admin_invoices']['subs']['admin_invoices_export']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_export_invoices');
                $ms_menu['header']['ms_admin_invoices']['subs']['admin_invoices_export']['class'] = 'fa fa-upload';
                if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_export_invoices' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_export_invoices') {
                    $ms_menu['header']['ms_admin_invoices']['subs']['admin_invoices_export']['active'] = 1;
                }
            }
        }
        // END IF $this->ORDERSADMIN_USER
        // new header TOP
        $key = 'header';
        if ($this->post['tx_multishop_pi1']['type'] == '2003') {
            $key = 'newheader';
        }
        $ms_menu['footer']['ms_version']['label'] = 'V' . $this->ms['MODULES']['GLOBAL_MODULES']['MULTISHOP_VERSION'];
        $ms_menu['footer']['ms_version']['link'] = '';
        $ms_menu['footer']['ms_version']['class'] = '';
        if ($this->ROOTADMIN_USER or $this->STORESADMIN_USER) {
            // multishops
            // now grab the active shops
            $multishop_content_objects = mslib_fe::getActiveShop();
            if (count($multishop_content_objects)) {
                $counter = 0;
                $total = count($multishop_content_objects);
                foreach ($multishop_content_objects as $pageinfo) {
                    $pageTitle = $pageinfo['title'];
                    if ($pageinfo['nav_title']) {
                        $pageTitle = $pageinfo['nav_title'];
                    }
                    $counter++;
                    if (is_numeric($pageinfo['uid']) and $pageinfo['uid'] == $this->shop_pid) {
                        $ms_menu['footer']['ms_admin_stores']['label'] = $pageTitle . ' (' . $pageinfo["uid"] . ')';
                        $ms_menu['footer']['ms_admin_stores']['class'] = 'fa fa-shopping-cart';
                    } elseif (is_numeric($pageinfo['uid']) and $pageinfo['uid'] != $this->shop_pid) {
                        $ms_menu['footer']['ms_admin_stores']['subs']['shop_' . $counter]['label'] = $pageTitle . ' (' . $pageinfo["uid"] . ')';
                        $ms_menu['footer']['ms_admin_stores']['subs']['shop_' . $counter]['description'] = $this->pi_getLL('switch_to') . ' ' . $pageTitle . ' ' . $this->pi_getLL('web_shop');
                        $ms_menu['footer']['ms_admin_stores']['subs']['shop_' . $counter]['link'] = mslib_fe::typolink($pageinfo["uid"] . ',2003', 'tx_multishop_pi1[page_section]=admin_home');
                        $ms_menu['footer']['ms_admin_stores']['subs']['shop_' . $counter]['class'] = 'fa fa-shopping-cart';
                    }
                    if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['adminPanelStoreItemPostProc'])) {
                        $params = array('pageinfo' => &$pageinfo, 'ms_menu' => &$ms_menu, 'counter' => &$counter);
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['adminPanelStoreItemPostProc'] as $funcRef) {
                            \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
                        }
                    }
                }
            }
            if (!is_array($ms_menu['footer']['ms_admin_stores']['subs'])) {
                unset($ms_menu['footer']['ms_admin_stores']);
            }
            $this->ms_menu = $ms_menu;
            // multishops eof
        }
        if ($this->ROOTADMIN_USER or $this->SEARCHADMIN_USER) {
            $ms_menu[$key]['ms_admin_search']['description'] = '
			<div id="ms_admin_search">
				<form action="' . mslib_fe::typolink() . '" method="get" id="ms_admin_top_search">
				<!-- <input class="admin_skeyword" id="ms_admin_skeyword" name="ms_admin_skeyword" type="text" placeholder="' . $this->pi_getLL('keyword') . '" value="" />-->
				<input type="hidden" class="adminpanel-search-bigdrop" id="ms_admin_skeyword" style="width: 200px" name="ms_admin_skeyword" value="" />
				<input name="id" type="hidden" value="' . $this->shop_pid . '" />
				<input name="type" type="hidden" value="2003" />
				<input name="tx_multishop_pi1[page_section]" type="hidden" value="admin_search" />
				<input name="page" id="ms_admin_us_page" type="hidden" value="0" />
				<input name="Submit" type="submit" id="btn_search_admin_panel" class="btn btn-success" />
			</form>' . "\n";
            $ms_menu[$key]['ms_admin_search']['description'] .= '
			</div>
			' . "\n";
        }
        $pageinfo = $GLOBALS['TSFE']->sys_page->getPage($this->shop_pid);
        $userTitle = $GLOBALS['TSFE']->fe_user->user['username'];
        if ($GLOBALS['TSFE']->fe_user->user['name']) {
            $userTitle = $GLOBALS['TSFE']->fe_user->user['name'] . ' (' . $GLOBALS['TSFE']->fe_user->user['username'] . ')';
        }
        $ms_menu[$key]['ms_admin_user']['description'] = '
			<div id="ms_admin_user">
			<a href="' . mslib_fe::typolink($this->shop_pid, '') . '">
			<i class="fa fa-user"></i>
			' . $this->pi_getLL('admin_user') . ': <strong>' . htmlspecialchars($userTitle) . '</strong></a>
			</div>
		';
        // footer
        if ($this->ROOTADMIN_USER or $this->STATISTICSADMIN_USER) {
            $filter = array();
            $filter[] = 'crdate > ' . (time() - 350);
            if (!$this->masterShop) {
                $filter[] = 'page_uid=' . $this->shop_pid;
            }
            $str = $GLOBALS['TYPO3_DB']->SELECTquery('session_id,ip_address,url,http_user_agent', 'tx_multishop_sessions', implode(' AND ', $filter), 'session_id,ip_address', 'crdate desc', '');
            $res = $GLOBALS['TYPO3_DB']->sql_query($str);
            $guests_online = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
            $members = mslib_fe::getSignedInUsers();
            $total_members = count($members);
            $ms_menu['footer']['ms_admin_online_users']['label'] = $this->pi_getLL('admin_online_users') . ': ' . $total_members . '/' . $guests_online;
            $ms_menu['footer']['ms_admin_online_users']['class'] = 'fa fa-users';
            $ms_menu['footer']['ms_admin_online_users']['subs']['total_members']['label'] = $this->pi_getLL('admin_members') . ': ' . $total_members;
            $ms_menu['footer']['ms_admin_online_users']['subs']['total_members']['class'] = 'fa fa-list';
            if ($total_members) {
                $counter = 0;
                foreach ($members as $member) {
                    $ms_menu['footer']['ms_admin_online_users']['subs']['total_members']['subs']['admin_member_' . $member['uid']]['label'] = $member['username'];
                    $ms_menu['footer']['ms_admin_online_users']['subs']['total_members']['subs']['admin_member_' . $member['uid']]['description'] = 'Logged in at ' . strftime("%x %X", $member['lastlogin']);
                    $ms_menu['footer']['ms_admin_online_users']['subs']['total_members']['subs']['admin_member_' . $member['uid']]['link'] = mslib_fe::typolink($this->shop_pid . ',2003', '&tx_multishop_pi1[page_section]=edit_customer&tx_multishop_pi1[cid]=' . $member['uid'] . '&action=edit_customer', 1);
                    $ms_menu['footer']['ms_admin_online_users']['subs']['total_members']['subs']['admin_member_' . $member['uid']]['class'] = 'fa fa-user';
                    $counter++;
                    if ($counter == 15) {
                        break;
                    }
                }
            }
            if ($guests_online - $total_members) {
                $filter = array();
                $filter[] = 'customer_id=0 and crdate > ' . (time() - 350);
                if (!$this->masterShop) {
                    $filter[] = 'page_uid=' . $this->shop_pid;
                }
                $str = $GLOBALS['TYPO3_DB']->SELECTquery('session_id,ip_address,url,http_user_agent', 'tx_multishop_sessions', implode(' AND ', $filter), 'session_id,ip_address', 'crdate desc', '');
                $res = $GLOBALS['TYPO3_DB']->sql_query($str);
                $guestsNumber = $GLOBALS['TYPO3_DB']->sql_num_rows($res);
                if ($guestsNumber > 0) {
                    $ms_menu['footer']['ms_admin_online_users']['subs']['total_guests']['label'] = $this->pi_getLL('admin_guests') . ': ' . $guestsNumber;
                    $ms_menu['footer']['ms_admin_online_users']['subs']['total_guests']['class'] = 'fa fa-list-ul';
                    $counter = 0;
                    while ($record = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
                        $link = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_action_notification_log&tx_multishop_pi1[keyword]=' . $record['session_id'], 1);
                        $ms_menu['footer']['ms_admin_online_users']['subs']['total_guests']['subs']['admin_guest_' . $record['session_id']]['label'] = htmlspecialchars($record['ip_address']);
                        $ms_menu['footer']['ms_admin_online_users']['subs']['total_guests']['subs']['admin_guest_' . $record['session_id']]['description'] = htmlspecialchars($record['http_user_agent']);
                        $ms_menu['footer']['ms_admin_online_users']['subs']['total_guests']['subs']['admin_guest_' . $record['session_id']]['link'] = $link;
                        $ms_menu['footer']['ms_admin_online_users']['subs']['total_guests']['subs']['admin_guest_' . $record['session_id']]['class'] = 'fa fa-user';
                        $counter++;
                        if ($counter == 15) {
                            break;
                        }
                    }
                }
            }
            $ms_menu['footer']['ms_admin_online_users']['subs']['total_visitors']['label'] = $this->pi_getLL('total') . ': ' . $guests_online;
            $ms_menu['footer']['ms_admin_online_users']['subs']['total_visitors']['class'] = 'fa fa-list-ul';
        }
        if ($this->ROOTADMIN_USER or $this->STATISTICSADMIN_USER) {
            $ms_menu['footer']['ms_admin_statistics']['label'] = $this->pi_getLL('reports');
            $ms_menu['footer']['ms_admin_statistics']['description'] = $this->pi_getLL('admin_statistics_description') . '.';
            $ms_menu['footer']['ms_admin_statistics']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_home');
            $ms_menu['footer']['ms_admin_statistics']['class'] = 'fa fa-bar-chart';
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_global_stats']['label'] = $this->pi_getLL('admin_global_statistics');
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_global_stats']['description'] = $this->pi_getLL('admin_global_statistics_description') . '.';
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_global_stats']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_home');
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_global_stats']['class'] = 'fa fa-line-chart';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_home' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_home') {
                $ms_menu['footer']['ms_admin_statistics']['subs']['ms_global_stats']['active'] = 1;
            }
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_products_search_stats']['label'] = $this->pi_getLL('admin_products_search');
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_products_search_stats']['description'] = $this->pi_getLL('admin_products_search_description') . '.';
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_products_search_stats']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_products_search_stats');
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_products_search_stats']['class'] = 'fa fa-search';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_products_search_stats' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_products_search_stats') {
                $ms_menu['footer']['ms_admin_statistics']['subs']['ms_products_search_stats']['active'] = 1;
            }
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_stats_products_toplist']['label'] = $this->pi_getLL('admin_stats_products_toplist', 'Products toplist');
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_stats_products_toplist']['description'] = $this->pi_getLL('admin_stats_products_toplist_description', 'Display top products') . '.';
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_stats_products_toplist']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_stats_products');
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_stats_products_toplist']['class'] = 'fa fa-cube';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_stats_products' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_stats_products') {
                $ms_menu['footer']['ms_admin_statistics']['subs']['ms_stats_products_toplist']['active'] = 1;
            }
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_stats_customers_toplist']['label'] = $this->pi_getLL('admin_stats_customers_toplist', 'Customers toplist');
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_stats_customers_toplist']['description'] = $this->pi_getLL('admin_stats_customers_toplist_description', 'Display top customers') . '.';
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_stats_customers_toplist']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_stats_customers');
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_stats_customers_toplist']['class'] = 'fa fa-users';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_stats_customers' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_stats_customers') {
                $ms_menu['footer']['ms_admin_statistics']['subs']['ms_stats_customers_toplist']['active'] = 1;
            }
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_shopping_cart_stats']['label'] = $this->pi_getLL('admin_shopping_cart_entries');
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_shopping_cart_stats']['description'] = $this->pi_getLL('admin_shopping_cart_entries_description') . '.';
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_shopping_cart_stats']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_shopping_cart_stats');
            $ms_menu['footer']['ms_admin_statistics']['subs']['ms_shopping_cart_stats']['class'] = 'fa fa-shopping-cart';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_shopping_cart_stats' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_shopping_cart_stats') {
                $ms_menu['footer']['ms_admin_statistics']['subs']['ms_shopping_cart_stats']['active'] = 1;
            }
            $ms_menu['footer']['ms_admin_statistics']['subs']['admin_action_notification_log']['label'] = htmlspecialchars($this->pi_getLL('admin_action_notification_log', 'Action notification log'));
            $ms_menu['footer']['ms_admin_statistics']['subs']['admin_action_notification_log']['description'] = $this->pi_getLL('admin_action_notification_log_description') . '.';
            $ms_menu['footer']['ms_admin_statistics']['subs']['admin_action_notification_log']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_action_notification_log');
            $ms_menu['footer']['ms_admin_statistics']['subs']['admin_action_notification_log']['class'] = 'fa fa-file-text';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_action_notification_log' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_action_notification_log') {
                $ms_menu['footer']['ms_admin_statistics']['subs']['admin_action_notification_log']['active'] = 1;
            }
            $ms_menu['footer']['ms_admin_statistics']['subs']['admin_stats_orders']['label'] = htmlspecialchars($this->pi_getLL('admin_sales_volume_statistics'));
            $ms_menu['footer']['ms_admin_statistics']['subs']['admin_stats_orders']['description'] = $this->pi_getLL('admin_sales_volume_statistics_description') . '.';
            $ms_menu['footer']['ms_admin_statistics']['subs']['admin_stats_orders']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_stats_orders');
            $ms_menu['footer']['ms_admin_statistics']['subs']['admin_stats_orders']['class'] = 'fa fa-pie-chart';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_stats_orders' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_stats_orders') {
                $ms_menu['footer']['ms_admin_statistics']['subs']['admin_stats_orders']['active'] = 1;
            }
            if ($this->ms['MODULES']['ADMIN_INVOICE_MODULE']) {
                $ms_menu['footer']['ms_admin_statistics']['subs']['admin_stats_invoices']['label'] = htmlspecialchars($this->pi_getLL('admin_invoice_statistics'));
                $ms_menu['footer']['ms_admin_statistics']['subs']['admin_stats_invoices']['description'] = $this->pi_getLL('admin_invoice_statistics_description') . '.';
                $ms_menu['footer']['ms_admin_statistics']['subs']['admin_stats_invoices']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_stats_invoices');
                $ms_menu['footer']['ms_admin_statistics']['subs']['admin_stats_invoices']['class'] = 'fa fa-pie-chart';
                if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_stats_invoices' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_stats_invoices') {
                    $ms_menu['footer']['ms_admin_statistics']['subs']['admin_stats_invoices']['active'] = 1;
                }
            }
            // browser user-agent stats
            $ms_menu['footer']['ms_admin_statistics']['subs']['admin_stats_user_agent']['label'] = htmlspecialchars($this->pi_getLL('admin_user_agent_statistics'));
            $ms_menu['footer']['ms_admin_statistics']['subs']['admin_stats_user_agent']['description'] = $this->pi_getLL('admin_user_agent_statistics_description') . '.';
            $ms_menu['footer']['ms_admin_statistics']['subs']['admin_stats_user_agent']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_stats_user_agent');
            $ms_menu['footer']['ms_admin_statistics']['subs']['admin_stats_user_agent']['class'] = 'fa fa-quote-right';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_stats_user_agent' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_stats_user_agent') {
                $ms_menu['footer']['ms_admin_statistics']['subs']['admin_stats_user_agent']['active'] = 1;
            }
        }
        $ms_menu['footer']['ms_admin_logout']['label'] = $this->pi_getLL('admin_log_out');
        $ms_menu['footer']['ms_admin_logout']['link'] = mslib_fe::typolink($this->conf['logout_pid'], '&logintype=logout');
        $ms_menu['footer']['ms_admin_logout']['class'] = 'fa fa-sign-out';
        $ms_menu['footer']['ms_admin_scroller']['label'] = '';
        $ms_menu['footer']['ms_admin_help']['label'] = '';
        $ms_menu['footer']['ms_admin_help']['link'] = $this->conf['admin_help_url'];
        $ms_menu['footer']['ms_admin_help']['class'] = 'fa fa-question';
        $ms_menu['footer']['ms_admin_help']['link_params'] = 'target="_blank"';
        // if admin user and system panel is enabled for normal admins
        if ($this->ROOTADMIN_USER or ($this->SYSTEMADMIN_USER == 1 or $this->conf['enableAdminPanelSystem'])) {
            $ms_menu['footer']['ms_admin_system']['label'] = '';
            $ms_menu['footer']['ms_admin_system']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_modules');
            $ms_menu['footer']['ms_admin_system']['class'] = 'fa fa-cog';
            if ($this->ROOTADMIN_USER or $this->CMSADMIN_USER) {
                $ms_menu['footer']['ms_admin_system']['subs']['ms_admin_cms']['label'] = $this->pi_getLL('admin_cms');
                //	$ms_menu['footer']['ms_admin_cms']['link']=mslib_fe::typolink($this->shop_pid.',2003','tx_multishop_pi1[page_section]=admin_cms');
                $ms_menu['footer']['ms_admin_system']['subs']['ms_admin_cms']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_cms');
                $ms_menu['footer']['ms_admin_system']['subs']['ms_admin_cms']['class'] = 'fa fa-file-text-o';
                if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_cms' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_cms') {
                    $ms_menu['footer']['ms_admin_system']['subs']['ms_admin_cms']['active'] = 1;
                }
            }
            $ms_menu['footer']['ms_admin_system']['subs']['ms_admin_store_details']['label'] = $this->pi_getLL('admin_store_details');
            $ms_menu['footer']['ms_admin_system']['subs']['ms_admin_store_details']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_store_details');
            $ms_menu['footer']['ms_admin_system']['subs']['ms_admin_store_details']['class'] = 'fa fa-map-marker';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_store_details' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_store_details') {
                $ms_menu['footer']['ms_admin_system']['subs']['ms_admin_store_details']['active'] = 1;
            }
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping']['label'] = $this->pi_getLL('admin_shipping');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping']['description'] = $this->pi_getLL('admin_shipping') . '.';
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping']['class'] = 'fa fa-truck';
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping']['subs']['admin_shipping_countries']['label'] = $this->pi_getLL('admin_countries');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping']['subs']['admin_shipping_countries']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_shipping_countries');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping']['subs']['admin_shipping_countries']['class'] = 'fa fa-globe';
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping']['subs']['admin_zones']['label'] = $this->pi_getLL('admin_zones');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping']['subs']['admin_zones']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_shipping_zones');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping']['subs']['admin_zones']['class'] = 'fa fa-globe';
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping']['subs']['admin_shipping_methods']['label'] = $this->pi_getLL('admin_shipping_methods');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping']['subs']['admin_shipping_methods']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_shipping_modules');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping']['subs']['admin_shipping_methods']['class'] = 'fa fa-ship';
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping']['subs']['admin_shipping_costs']['label'] = $this->pi_getLL('admin_shipping_costs');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping']['subs']['admin_shipping_costs']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_shipping_costs');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping']['subs']['admin_shipping_costs']['class'] = 'fa fa-money';
            $ms_menu['footer']['ms_admin_system']['subs']['admin_payment']['label'] = $this->pi_getLL('admin_payment');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_payment']['description'] = $this->pi_getLL('admin_payment') . '.';
            $ms_menu['footer']['ms_admin_system']['subs']['admin_payment']['class'] = 'fa fa-credit-card';
            $ms_menu['footer']['ms_admin_system']['subs']['admin_payment']['subs']['admin_payment_methods']['label'] = $this->pi_getLL('admin_payment_methods');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_payment']['subs']['admin_payment_methods']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_payment_modules');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_payment']['subs']['admin_payment_methods']['class'] = 'fa fa-credit-card';
            /*
             * removed from menu, merged into payment methods page
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping_and_payment']['subs']['admin_payment_zone_mapping']['label']=$this->pi_getLL('admin_payment_zone_mapping');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping_and_payment']['subs']['admin_payment_zone_mapping']['link']=mslib_fe::typolink($this->shop_pid.',2003', 'tx_multishop_pi1[page_section]=admin_zone_payment_mappings');
            */
            /*
             * removed from menu, merged into shipping methods page
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping_and_payment']['subs']['admin_shipping_zone_mapping']['label']=$this->pi_getLL('admin_shipping_zone_mapping');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping_and_payment']['subs']['admin_shipping_zone_mapping']['link']=mslib_fe::typolink($this->shop_pid.',2003', 'tx_multishop_pi1[page_section]=admin_zone_shipping_mappings');
            */
            /*
             * removed from menu, merged into shipping/payment methods page
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping_and_payment']['subs']['admin_mappings']['label']=$this->pi_getLL('admin_mappings');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_shipping_and_payment']['subs']['admin_mappings']['link']=mslib_fe::typolink($this->shop_pid.',2003', 'tx_multishop_pi1[page_section]=admin_shipping_payment_mappings');
            */
            $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['label'] = $this->pi_getLL('admin_system');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['description'] = $this->pi_getLL('admin_system') . '.';
            $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['class'] = 'fa fa-cogs';
            $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_tax_rule_groups']['label'] = $this->pi_getLL('admin_tax_rule_groups', 'TAX RULE GROUPS');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_tax_rule_groups']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_tax_rule_groups');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_tax_rule_groups']['class'] = 'fa fa-object-group';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_tax_rule_groups' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_tax_rule_groups') {
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_tax_rule_groups']['active'] = 1;
            }
            $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_taxes']['label'] = $this->pi_getLL('admin_taxes', 'Taxes');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_taxes']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_taxes');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_taxes']['class'] = 'fa fa-calculator';
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_taxes' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_taxes') {
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_taxes']['active'] = 1;
            }
            //			$ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_tax_rules']['label']='TAX RULES';
            //			$ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_tax_rules']['link']=mslib_fe::typolink($this->shop_pid,'tx_multishop_pi1[page_section]=admin_tax_rules');
            if ($this->get['tx_multishop_pi1']['page_section'] == 'admin_modules' || $this->post['tx_multishop_pi1']['page_section'] == 'admin_modules') {
                $ms_menu['footer']['ms_admin_system']['active'] = 1;
            }
            if ($this->ms['MODULES']['GLOBAL_MODULES']['CACHE_FRONT_END'] or $this->conf['cacheConfiguration']) {
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_clear_multishop_cache']['label'] = $this->pi_getLL('admin_clear_multishop_cache');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_clear_multishop_cache']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_clear_multishop_cache', 1);
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_clear_multishop_cache']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_reset_the_multishop_cache') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_clear_multishop_cache']['class'] = 'fa fa-asterisk';
            }
            if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('cooluri')) {
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_clear_cooluri_cache']['label'] = $this->pi_getLL('admin_clear_cooluri_cache');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_clear_cooluri_cache']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_clear_cooluri_cache', 1);
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_clear_cooluri_cache']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_reset_the_cooluri_cache') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_clear_cooluri_cache']['class'] = 'fa fa-asterisk';
            }
            if ($this->ROOTADMIN_USER or $this->conf['enableAdminPanelSortCatalog']) {
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['label'] = $this->pi_getLL('admin_sort_catalog');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['description'] = $this->pi_getLL('admin_sort_catalog_description') . '.';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['class'] = 'fa fa-sort';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_manufacturers']['label'] = $this->pi_getLL('manufacturers');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_manufacturers']['class'] = 'fa fa-industry';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_manufacturers']['subs']['admin_sort_manufacturers_alphabet_asc']['label'] = $this->pi_getLL('admin_sort_alphabet_asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_manufacturers']['subs']['admin_sort_manufacturers_alphabet_asc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=manufacturers&tx_multishop_pi1[sortByField]=name&tx_multishop_pi1[orderBy]=asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_manufacturers']['subs']['admin_sort_manufacturers_alphabet_asc']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_manufacturers_asc') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_manufacturers']['subs']['admin_sort_manufacturers_alphabet_asc']['class'] = 'fa fa-arrow-circle-up';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_manufacturers']['subs']['admin_sort_manufacturers_alphabet_desc']['label'] = $this->pi_getLL('admin_sort_alphabet_desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_manufacturers']['subs']['admin_sort_manufacturers_alphabet_desc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=manufacturers&tx_multishop_pi1[sortByField]=name&tx_multishop_pi1[orderBy]=desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_manufacturers']['subs']['admin_sort_manufacturers_alphabet_desc']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_manufacturers_desc') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_manufacturers']['subs']['admin_sort_manufacturers_alphabet_desc']['class'] = 'fa fa-arrow-circle-down';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_categories']['label'] = $this->pi_getLL('categories');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_categories']['class'] = 'fa fa-folder';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_categories']['subs']['admin_sort_categories_alphabet_asc']['label'] = $this->pi_getLL('admin_sort_alphabet_asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_categories']['subs']['admin_sort_categories_alphabet_asc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=categories&tx_multishop_pi1[sortByField]=categories_name&tx_multishop_pi1[orderBy]=asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_categories']['subs']['admin_sort_categories_alphabet_asc']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_categories_asc') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_categories']['subs']['admin_sort_categories_alphabet_asc']['class'] = 'fa fa-arrow-circle-up';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_categories']['subs']['admin_sort_categories_alphabet_desc']['label'] = $this->pi_getLL('admin_sort_alphabet_desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_categories']['subs']['admin_sort_categories_alphabet_desc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=categories&tx_multishop_pi1[sortByField]=categories_name&tx_multishop_pi1[orderBy]=desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_categories']['subs']['admin_sort_categories_alphabet_desc']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_categories_desc') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_categories']['subs']['admin_sort_categories_alphabet_desc']['class'] = 'fa fa-arrow-circle-down';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['label'] = $this->pi_getLL('products');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['class'] = 'fa fa-cube';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_alphabet_asc']['label'] = $this->pi_getLL('admin_sort_alphabet_asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_alphabet_asc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=products&tx_multishop_pi1[sortByField]=products_name&tx_multishop_pi1[orderBy]=asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_alphabet_asc']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_products_asc') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_alphabet_asc']['class'] = 'fa fa-arrow-circle-up';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_alphabet_desc']['label'] = $this->pi_getLL('admin_sort_alphabet_desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_alphabet_desc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=products&tx_multishop_pi1[sortByField]=products_name&tx_multishop_pi1[orderBy]=desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_alphabet_desc']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_products_desc') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_alphabet_desc']['class'] = 'fa fa-arrow-circle-down';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_price_asc']['label'] = $this->pi_getLL('admin_sort_price_asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_price_asc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=products&tx_multishop_pi1[sortByField]=products_price&tx_multishop_pi1[orderBy]=asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_price_asc']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_products_price_asc') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_price_asc']['class'] = 'fa fa-arrow-circle-up';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_price_desc']['label'] = $this->pi_getLL('admin_sort_price_desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_price_desc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=products&tx_multishop_pi1[sortByField]=products_price&tx_multishop_pi1[orderBy]=desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_price_desc']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_products_price_desc') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_price_desc']['class'] = 'fa fa-arrow-circle-down';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_date_available_asc']['label'] = $this->pi_getLL('admin_sort_date_asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_date_available_asc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=products&tx_multishop_pi1[sortByField]=products_date_added&tx_multishop_pi1[orderBy]=asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_date_available_asc']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_products_date_asc') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_date_available_asc']['class'] = 'fa fa-arrow-circle-up';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_date_available_desc']['label'] = $this->pi_getLL('admin_sort_date_desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_date_available_desc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=products&tx_multishop_pi1[sortByField]=products_date_added&tx_multishop_pi1[orderBy]=desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_date_available_desc']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_products_date_desc') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_date_available_desc']['class'] = 'fa fa-arrow-circle-down';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_main_categories_asc']['label'] = $this->pi_getLL('admin_sort_products_main_categories_asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_main_categories_asc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=products&tx_multishop_pi1[sortByField]=products_main_categories&tx_multishop_pi1[orderBy]=asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_main_categories_asc']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_products_on_main_categories_relation_asc') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_main_categories_asc']['class'] = 'fa fa-arrow-circle-down';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_main_categories_desc']['label'] = $this->pi_getLL('admin_sort_products_main_categories_desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_main_categories_desc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=products&tx_multishop_pi1[sortByField]=products_main_categories&tx_multishop_pi1[orderBy]=desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_main_categories_desc']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_products_on_main_categories_relation_desc') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_main_categories_desc']['class'] = 'fa fa-arrow-circle-down';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_deepset_categories_asc']['label'] = $this->pi_getLL('admin_sort_products_deepest_categories_asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_deepset_categories_asc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=products&tx_multishop_pi1[sortByField]=products_deepest_categories&tx_multishop_pi1[orderBy]=asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_deepset_categories_asc']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_products_on_deepest_categories_relation_asc') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_deepset_categories_asc']['class'] = 'fa fa-arrow-circle-down';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_deepset_categories_desc']['label'] = $this->pi_getLL('admin_sort_products_deepest_categories_desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_deepset_categories_desc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=products&tx_multishop_pi1[sortByField]=products_deepest_categories&tx_multishop_pi1[orderBy]=desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_deepset_categories_desc']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_products_on_deepest_categories_relation_desc') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products']['subs']['admin_sort_products_deepset_categories_desc']['class'] = 'fa fa-arrow-circle-down';
                //
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['label'] = $this->pi_getLL('products_attributes_values');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['class'] = 'fa fa-puzzle-piece';
                //
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_alphabet_asc']['label'] = $this->pi_getLL('admin_sort_alphabet_asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_alphabet_asc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=attribute_values&tx_multishop_pi1[sortByField]=products_options_values_name&tx_multishop_pi1[orderBy]=asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_alphabet_asc']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_products_attributes_asc') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_alphabet_asc']['class'] = 'fa fa-arrow-circle-up';
                //
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_alphabet_desc']['label'] = $this->pi_getLL('admin_sort_alphabet_desc', 'sort on alfabet (desc)');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_alphabet_desc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=attribute_values&tx_multishop_pi1[sortByField]=products_options_values_name&tx_multishop_pi1[orderBy]=desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_alphabet_desc']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_products_attributes_desc') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_alphabet_desc']['class'] = 'fa fa-arrow-circle-down';
                //
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_alphabet_natural_asc']['label'] = $this->pi_getLL('admin_sort_alphabet_natural_asc', 'admin_sort_alphabet_natural_asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_alphabet_natural_asc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=attribute_values&tx_multishop_pi1[sortByField]=products_options_values_name_natural&tx_multishop_pi1[orderBy]=asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_alphabet_natural_asc']['class'] = 'fa fa-arrow-circle-up';
                //
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_alphabet_natural_desc']['label'] = $this->pi_getLL('admin_sort_alphabet_natural_desc', 'admin_sort_alphabet_natural_desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_alphabet_natural_desc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=attribute_values&tx_multishop_pi1[sortByField]=products_options_values_name_natural&tx_multishop_pi1[orderBy]=desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_alphabet_natural_desc']['class'] = 'fa fa-arrow-circle-down';
                //
                // attribute options names sort
                //
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes_names']['label'] = $this->pi_getLL('products_attributes_names');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes_names']['class'] = 'fa fa-puzzle-piece';
                //
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes_names']['subs']['admin_sort_products_attributes_names_alphabet_asc']['label'] = $this->pi_getLL('admin_sort_alphabet_asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes_names']['subs']['admin_sort_products_attributes_names_alphabet_asc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=attribute_names&tx_multishop_pi1[sortByField]=products_options_name&tx_multishop_pi1[orderBy]=asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes_names']['subs']['admin_sort_products_attributes_names_alphabet_asc']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_products_attributes_asc') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes_names']['subs']['admin_sort_products_attributes_names_alphabet_asc']['class'] = 'fa fa-arrow-circle-up';
                //
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes_names']['subs']['admin_sort_products_attributes_names_alphabet_desc']['label'] = $this->pi_getLL('admin_sort_alphabet_desc', 'sort on alfabet (desc)');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes_names']['subs']['admin_sort_products_attributes_names_alphabet_desc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=attribute_names&tx_multishop_pi1[sortByField]=products_options_name&tx_multishop_pi1[orderBy]=desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes_names']['subs']['admin_sort_products_attributes_names_alphabet_desc']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_products_attributes_desc') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes_names']['subs']['admin_sort_products_attributes_names_alphabet_desc']['class'] = 'fa fa-arrow-circle-down';
                //
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes_names']['subs']['admin_sort_products_attributes_names_alphabet_natural_asc']['label'] = $this->pi_getLL('admin_sort_alphabet_natural_asc', 'admin_sort_alphabet_natural_asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes_names']['subs']['admin_sort_products_attributes_names_alphabet_natural_asc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=attribute_names&tx_multishop_pi1[sortByField]=products_options_name_natural&tx_multishop_pi1[orderBy]=asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes_names']['subs']['admin_sort_products_attributes_names_alphabet_natural_asc']['class'] = 'fa fa-arrow-circle-up';
                //
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes_names']['subs']['admin_sort_products_attributes_names_alphabet_natural_desc']['label'] = $this->pi_getLL('admin_sort_alphabet_natural_desc', 'admin_sort_alphabet_natural_desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes_names']['subs']['admin_sort_products_attributes_names_alphabet_natural_desc']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=attribute_names&tx_multishop_pi1[sortByField]=products_options_name_natural&tx_multishop_pi1[orderBy]=desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes_names']['subs']['admin_sort_products_attributes_names_alphabet_natural_desc']['class'] = 'fa fa-arrow-circle-down';
                /*
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_price_asc']['label']=$this->pi_getLL('admin_sort_products_attributes_price_asc', 'sort on price (asc)');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_price_asc']['link']=mslib_fe::typolink($this->shop_pid.',2003','tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=attribute_values&tx_multishop_pi1[sortByField]=products_price&tx_multishop_pi1[orderBy]=asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_price_asc']['link_params']='onClick="return CONFIRM(\''.$this->pi_getLL('admin_are_you_sure_you_want_to_sort_products_price_asc', 'Are you sure want to sort products attributes price ascending').'?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_price_desc']['label']=$this->pi_getLL('admin_sort_products_attributes_price_desc', 'sort on price (desc)');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_price_desc']['link']=mslib_fe::typolink($this->shop_pid.',2003','tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=attribute_values&tx_multishop_pi1[sortByField]=products_price&tx_multishop_pi1[orderBy]=desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_products_attributes']['subs']['admin_sort_products_attributes_price_desc']['link_params']='onClick="return CONFIRM(\''.$this->pi_getLL('admin_are_you_sure_you_want_to_sort_products_price_desc', 'Are you sure want to sort products attributes price descending').'?\')"';
                */
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_complete']['label'] = $this->pi_getLL('admin_sort_complete');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_complete']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=catalog&tx_multishop_pi1[sortByField]=name&tx_multishop_pi1[orderBy]=asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_complete']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_are_you_sure_you_want_to_sort_catalog') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_complete']['class'] = 'fa fa-sort';
                /*
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_on_alphabet']['label']=$this->pi_getLL('admin_sort_by_alphabet');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_on_alphabet']['link']=mslib_fe::typolink($this->shop_pid.',2003','tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=catalog&tx_multishop_pi1[sortByField]=name&tx_multishop_pi1[orderBy]=asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_on_alphabet']['link_params']='onClick="return CONFIRM(\''.$this->pi_getLL('admin_are_you_sure_you_want_to_sort_catalog').'?\')"';
                
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_on_date_asc']['label']=$this->pi_getLL('admin_sort_by_date_ascending');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_on_date_asc']['link']=mslib_fe::typolink($this->shop_pid.',2003','tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=products&tx_multishop_pi1[sortByField]=products_date_added&tx_multishop_pi1[orderBy]=asc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_on_date_asc']['link_params']='onClick="return CONFIRM(\''.$this->pi_getLL('admin_are_you_sure_you_want_to_sort_catalog').'?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_on_date_desc']['label']=$this->pi_getLL('admin_sort_by_date_descending');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_on_date_desc']['link']=mslib_fe::typolink($this->shop_pid.',2003','tx_multishop_pi1[page_section]=admin_system_sort_catalog&tx_multishop_pi1[sortItem]=products&tx_multishop_pi1[sortByField]=products_date_added&tx_multishop_pi1[orderBy]=desc');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sort']['subs']['admin_sort_on_date_desc']['link_params']='onClick="return CONFIRM(\''.$this->pi_getLL('admin_are_you_sure_you_want_to_sort_catalog').'?\')"';
                */
            }
            if ($this->ROOTADMIN_USER) {
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_compare_database']['label'] = $this->pi_getLL('admin_compare_database');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_compare_database']['link'] = '#';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_compare_database']['link_params'] = 'id="multishop_update_button"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_compare_database']['class'] = 'fa fa-files-o';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_consistency_checker']['label'] = $this->pi_getLL('admin_consistency_checker');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_consistency_checker']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_consistency_checker');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_consistency_checker']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_label_are_you_sure_want_to_run_consistency_checker') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_consistency_checker']['class'] = 'fa fa-check';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_delete_disabled_products']['label'] = $this->pi_getLL('admin_delete_disabled_products');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_delete_disabled_products']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_delete_disabled_products');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_delete_disabled_products']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_label_are_you_sure_want_to_delete_the_disabled_products') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_delete_disabled_products']['class'] = 'fa fa-trash-o';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_clear_whole_database']['label'] = $this->pi_getLL('admin_clear_whole_database');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_clear_whole_database']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_clear_database');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_clear_whole_database']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_label_are_you_sure_want_to_start_all_over_again') . '?\');"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_clear_whole_database']['class'] = 'fa fa-database';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_scan_for_orphan_files']['label'] = $this->pi_getLL('admin_scan_for_orphan_files');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_scan_for_orphan_files']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_orphan_files');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_scan_for_orphan_files']['link_params'] = '';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_scan_for_orphan_files']['class'] = 'fa fa-chain-broken';
            }
            if ($this->ms['MODULES']['FLAT_DATABASE'] and ($this->ROOTADMIN_USER or $this->conf['enableAdminPanelRebuildFlatDatabase'])) {
                $ms_menu['footer']['ms_admin_system']['subs']['admin_rebuild_flat_database']['label'] = $this->pi_getLL('admin_rebuild_flat_database');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_rebuild_flat_database']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_system_rebuild_flat_database');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_rebuild_flat_database']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_label_are_you_sure_want_to_rebuild_flat_database') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_rebuild_flat_database']['class'] = 'fa fa-database';
            }
            $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sitemap_generator']['label'] = $this->pi_getLL('admin_sitemap_generator');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sitemap_generator']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_sitemap_generator');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sitemap_generator']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_label_are_you_sure_want_to_start_this') . '?\')"';
            $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_sitemap_generator']['class'] = 'fa fa-sitemap';
            // repair missing multilanguages attributes
            $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_repair_missing_multilanguages_attributes']['label'] = $this->pi_getLL('repair_missing_attribute_language_values');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_repair_missing_multilanguages_attributes']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_repair_missing_multilanguages_attributes');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_repair_missing_multilanguages_attributes']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_label_are_you_sure_want_to_start_this') . '?\')"';
            $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_repair_missing_multilanguages_attributes']['class'] = 'fa fa-puzzle-piece';
            // repair default crumpath
            if ($this->ms['MODULES']['ENABLE_DEFAULT_CRUMPATH']) {
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_repair_default_crumpath']['label'] = $this->pi_getLL('repair_products_default_crumpath');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_repair_default_crumpath']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_repair_products_default_crumpath');
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_repair_default_crumpath']['link_params'] = 'onClick="return CONFIRM(\'' . $this->pi_getLL('admin_label_are_you_sure_want_to_start_this') . '?\')"';
                $ms_menu['footer']['ms_admin_system']['subs']['admin_system']['subs']['admin_repair_default_crumpath']['class'] = 'fa fa-puzzle-piece';
            }
            // footer eof
        }
        // end if enableAdminPanelSystem
        if ($this->ROOTADMIN_USER or $this->conf['enableAdminPanelSettings']) {
            $ms_menu['footer']['ms_admin_system']['subs']['admin_settings']['label'] = $this->pi_getLL('admin_multishop_settings');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_settings']['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_modules');
            $ms_menu['footer']['ms_admin_system']['subs']['admin_settings']['class'] = 'fa fa-cog';
        }
        // hook
        /*
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['adminPanel'])) {
        	$params=array(
        		'this'=>&$this,
        		'ms_menu'=>&$ms_menu
        	);
        	foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['adminPanel'] as $funcRef) {
        		\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
        	}
        }
        */
        $this->linkVars = $GLOBALS['TSFE']->linkVars;
        $useSysLanguageTitle = trim($this->conf['useSysLanguageTitle']) ? trim($this->conf['useSysLanguageTitle']) : 0;
        $useIsoLanguageCountryCode = trim($this->conf['useIsoLanguageCountryCode']) ? trim($this->conf['useIsoLanguageCountryCode']) : 0;
        $useIsoLanguageCountryCode = $useSysLanguageTitle ? 0 : $useIsoLanguageCountryCode;
        $useSelfLanguageTitle = trim($this->conf['useSelfLanguageTitle']) ? trim($this->conf['useSelfLanguageTitle']) : 0;
        $useSelfLanguageTitle = $useSysLanguageTitle || $useIsoLanguageCountryCode ? 0 : $useSelfLanguageTitle;
        $tableA = 'sys_language';
        $tableB = 'static_languages';
        $languagesUidsList = trim($this->cObj->data['tx_srlanguagemenu_languages']) ? trim($this->cObj->data['tx_srlanguagemenu_languages']) : trim($this->conf['languagesUidsList']);
        $languages = array();
        $languagesLabels = array();
        // Set default language
        $defaultLanguageISOCode = trim($this->conf['defaultLanguageISOCode']) ? mslib_befe::strtoupper(trim($this->conf['defaultLanguageISOCode'])) : 'EN';
        $this->ms['MODULES']['COUNTRY_ISO_NR'] = trim($this->conf['defaultCountryISOCode']) ? mslib_befe::strtoupper(trim($this->conf['defaultCountryISOCode'])) : '';
        $languages[] = mslib_befe::strtolower($defaultLanguageISOCode) . ($this->ms['MODULES']['COUNTRY_ISO_NR'] ? '_' . $this->ms['MODULES']['COUNTRY_ISO_NR'] : '');
        $this->languagesUids[] = '0';
        // Get the language codes and labels for the languages set in the plugin list
        $selectFields = $tableA . '.uid, ' . $tableA . '.title, ' . $tableB . '.*';
        $table = $tableA . ' LEFT JOIN ' . $tableB . ' ON ' . $tableA . '.flag=' . $tableB . '.cn_iso_2';
        // Ignore IN clause if language list is empty. This means that all languages found in the sys_language table will be used
        if (!empty($languagesUidsList)) {
            $whereClause = $tableA . '.uid IN (' . $languagesUidsList . ') ';
        } else {
            $whereClause = '1=1 ';
        }
        $whereClause .= $this->cObj->enableFields($tableA);
        $whereClause .= $this->cObj->enableFields($tableB);
        // If $languagesUidsList is not empty, the languages will be sorted in the order it specifies
        $languagesUidsArray = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(',', $languagesUidsList, 1);
        $index = 0;
        $str = "select * from sys_language where hidden=0 order by title";
        $res = $GLOBALS['TYPO3_DB']->sql_query($str);
        while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
            $key++;
            $languages[$key] = $row['uid'];
            $languagesLabels[$key]['key'] = $row['uid'];
            $languagesLabels[$key]['flag'] = $row['flag'];
            if ($row['flag']) {
                if ($this->cookie['multishop_admin_language'] == $row['uid']) {
                    $this->cookie['multishop_admin_language'] = $row['flag'];
                }
            }
            $languagesLabels[$key]['value'] = $row['title'];
            $this->languagesUids[$key] = $row['uid'];
        }
        if (is_array($languagesLabels) and count($languagesLabels)) {
            $ms_menu['footer']['ms_admin_language']['description'] = '
			<form action="' . mslib_fe::typolink() . '" method="post" id="multishop_admin_language_form">
				<select name="multishop_admin_language" id="ms_admin_simulate_language">
				<option value="default"' . ($this->cookie['multishop_admin_language'] == '' ? ' selected' : '') . '>' . $this->pi_getLL('default_language') . '</option>
				';
            foreach ($languagesLabels as $key => $language) {
                if ($language['key']) {
                    $ms_menu['footer']['ms_admin_language']['description'] .= '<option value="' . $language['flag'] . '"' . ($this->cookie['multishop_admin_language'] == $language['flag'] ? ' selected' : '') . '>' . $language['value'] . '</option>' . "\n";
                }
            }
            $ms_menu['footer']['ms_admin_language']['description'] .= '
				</select>
			</form>
			';
        }
        // Hook
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['adminPanel'])) {
            $params = array('this' => &$this, 'ms_menu' => &$ms_menu);
            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['adminPanel'] as $funcRef) {
                \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
            }
        }
        return $ms_menu;
    }
             break;
         }
     }
     $phpexcel = PHPExcel_IOFactory::load($file);
     foreach ($phpexcel->getWorksheetIterator() as $worksheet) {
         $counter = 0;
         foreach ($worksheet->getRowIterator() as $row) {
             $cellIterator = $row->getCellIterator();
             $cellIterator->setIterateOnlyExistingCells(false);
             foreach ($cellIterator as $cell) {
                 $clean_products_data = ltrim(rtrim($cell->getCalculatedValue(), " ,"), " ,");
                 $clean_products_data = trim($clean_products_data);
                 if ($row->getRowIndex() > 1) {
                     $rows[$counter - 1][] = $clean_products_data;
                 } else {
                     $table_cols[] = mslib_befe::strtolower($clean_products_data);
                 }
             }
             $counter++;
         }
     }
     // excel eof
 } else {
     if ($this->post['format'] == 'xml') {
         $objXML = new xml2Array();
         $arrOutput = $objXML->parse($str);
         $i = 0;
         $s = 0;
         $rows = array();
         foreach ($arrOutput[0]['children'] as $item) {
             // image
     $billing_postcode = $customer_billing_address['zip'] . ' ' . $customer_billing_address['city'];
     $billing_country = ucwords(mslib_befe::strtolower($customer_billing_address['country']));
 } else {
     $company_name = $user['company'];
     $billing_street_address = $user['address'];
     $billing_postcode = $user['zip'] . ' ' . $user['city'];
     $billing_country = ucwords(mslib_befe::strtolower($user['country']));
 }
 if ($customer_delivery_address['address'] && $customer_delivery_address['zip'] && $customer_delivery_address['city']) {
     $delivery_street_address = $customer_delivery_address['address'];
     $delivery_postcode = $customer_delivery_address['zip'] . ' ' . $customer_delivery_address['city'];
     $delivery_country = ucwords(mslib_befe::strtolower($customer_delivery_address['country']));
 } else {
     $delivery_street_address = $user['address'];
     $delivery_postcode = $user['zip'] . ' ' . $user['city'];
     $delivery_country = ucwords(mslib_befe::strtolower($user['country']));
 }
 $markerArray['DETAILS_COMPANY_NAME'] = $company_name;
 $actionButtons = array();
 if (!$markerArray['DETAILS_COMPANY_NAME']) {
     $markerArray['DETAILS_COMPANY_NAME'] = $fullname;
 }
 $markerArray['BILLING_COMPANY'] = '';
 if ($company_name) {
     $markerArray['BILLING_COMPANY'] = $company_name . '<br/>';
 }
 $markerArray['BILLING_FULLNAME'] = $fullname . '<br/>';
 $markerArray['BILLING_TELEPHONE'] = '';
 if ($telephone) {
     $markerArray['BILLING_TELEPHONE'] .= ucfirst($this->pi_getLL('telephone')) . ': ' . $telephone . '<br/>';
     $actionLink = 'callto:' . $telephone;