//echo $str; $qry = $GLOBALS['TYPO3_DB']->sql_query($str); if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry) == 0) { echo "<p>Product doesn't exist</p>"; } else { //insert into tx_multishop_products $row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry); $product_arr_new = array(); foreach ($row as $key_p => $val_p) { if ($key_p != 'products_id') { if ($key_p == 'products_image' or $key_p == 'products_image1' or $key_p == 'products_image2' or $key_p == 'products_image3' or $key_p == 'products_image4') { if (!empty($val_p)) { $str = "SELECT * from tx_multishop_products_description where products_id = {$id_product} and language_id='" . $this->sys_language_uid . "'"; $qry = $GLOBALS['TYPO3_DB']->sql_query($str); $row_desc = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry); $file = mslib_befe::getImagePath($val_p, 'products', 'original'); //echo $file; $imgtype = mslib_befe::exif_imagetype($file); if ($imgtype) { // valid image $ext = image_type_to_extension($imgtype, false); if ($ext) { $i = 0; $filename = mslib_fe::rewritenamein($row_desc['products_name']) . '.' . $ext; //echo $filename; $folder = mslib_befe::getImagePrefixFolder($filename); $array = explode(".", $filename); if (!is_dir($this->DOCUMENT_ROOT . $this->ms['image_paths']['products']['original'] . '/' . $folder)) { \TYPO3\CMS\Core\Utility\GeneralUtility::mkdir($this->DOCUMENT_ROOT . $this->ms['image_paths']['products']['original'] . '/' . $folder); } $folder .= '/';
$markerArray['ITEM_COUNTER'] = $itemCounter; $markerArray['PRODUCTS_NAME'] = $current_product['products_name']; $markerArray['PRODUCTS_MODEL'] = $current_product['products_model']; $markerArray['PRODUCTS_DESCRIPTION'] = $current_product['products_description']; $markerArray['PRODUCTS_SHORTDESCRIPTION'] = $current_product['products_shortdescription']; $markerArray['PRODUCTS_SHORT_DESCRIPTION'] = $current_product['products_shortdescription']; $markerArray['PRODUCTS_DETAIL_PAGE_LINK'] = $output['link']; $markerArray['CATEGORIES_NAME'] = $current_product['categories_name']; $markerArray['CATEGORIES_NAME_PAGE_LINK'] = $output['catlink']; $markerArray['PRODUCTS_IMAGE'] = $output['image']; $markerArray['PRODUCTS_IMAGE_200'] = $output['image_200']; $markerArray['PRODUCTS_IMAGE_300'] = $output['image_300']; $markerArray['PRODUCTS_IMAGE_URL'] = mslib_befe::getImagePath($current_product['products_image'], 'products', $this->imageWidth); $markerArray['PRODUCTS_IMAGE_URL_100'] = mslib_befe::getImagePath($current_product['products_image'], 'products', '100'); $markerArray['PRODUCTS_IMAGE_URL_200'] = mslib_befe::getImagePath($current_product['products_image'], 'products', '200'); $markerArray['PRODUCTS_IMAGE_URL_300'] = mslib_befe::getImagePath($current_product['products_image'], 'products', '300'); $markerArray['PRODUCTS_PRICE'] = $output['products_price']; $markerArray['PRODUCTS_PRICE_PER_EACH'] = $output['products_price_per_each']; $markerArray['OLD_PRICE_WITH_CONTAINER'] = $output['old_price_with_container']; $markerArray['PRODUCTS_SKU'] = $current_product['sku_code']; $markerArray['PRODUCTS_EAN'] = $current_product['ean_code']; $markerArray['PRODUCTS_URL'] = $current_product['products_url']; $markerArray['ORDER_UNIT_NAME'] = $current_product['order_unit_name']; $markerArray['MANUFACTURERS_ID'] = $current_product['manufacturers_id']; $markerArray['MANUFACTURERS_NAME'] = $current_product['manufacturers_name']; $markerArray['OLD_PRICE'] = ''; if ($current_product['old_price']) { $markerArray['OLD_PRICE'] = mslib_fe::amount2Cents($current_product['old_price']); } $markerArray['FINAL_PRICE'] = mslib_fe::amount2Cents($current_product['final_price']); $markerArray['OLD_PRICE_PLAIN'] = number_format($current_product['old_price'], 2, ',', '.');
$where = ''; if (count($cats) > 0) { foreach ($cats as $cat) { $where .= "categories_id[" . $level . "]=" . $cat['id'] . "&"; $level++; } $where = substr($where, 0, strlen($where) - 1); $where .= '&'; } // get all cats to generate multilevel fake url eof } $link = mslib_fe::typolink($this->conf['products_detail_page_pid'], '&' . $where . '&products_id=' . $row_p['products_id'] . '&tx_multishop_pi1[page_section]=products_detail'); // $imagePath = '<div class="no_image"></div>'; if ($row_p['products_image']) { $imagePath = '<a href="' . $link . '" target="_blank"><img src="' . mslib_befe::getImagePath($row_p['products_image'], 'products', '50') . '" alt="' . htmlspecialchars($row_p['products_name']) . '" /></a>'; } $tmp_product .= '<div class="image"> ' . $imagePath . ' </div>'; // $tmp_product .= '<strong><a href="' . $link . '" target="_blank">' . htmlspecialchars($row_p['products_name']) . '</a> (ID: ' . $row_p['products_id'] . ')</strong>'; // if ($this->ROOTADMIN_USER || $this->ADMIN_USER && $this->CATALOGADMIN_USER) { $tmp_product .= '<div class="admin_menu"><a href="' . mslib_fe::typolink($this->shop_pid . ',2003', '&tx_multishop_pi1[page_section]=edit_product&cid=' . $categories_id . '&pid=' . $row_p['products_id'] . '&action=edit_product', 1) . '" class="admin_menu_edit btn btn-primary btn-sm"><i class="fa fa-pencil"></i></a> <a href="' . mslib_fe::typolink($this->shop_pid . ',2003', '&tx_multishop_pi1[page_section]=delete_product&cid=' . $categories_id . '&pid=' . $row_p['products_id'] . '&action=delete_product', 1) . '" class="admin_menu_remove btn btn-danger btn-sm" title="Remove"><i class="fa fa-trash-o"></i></a></div>'; } $tmp_product .= '<div class="button_wrapper"> <button type="button" class="btnTop btn btn-default btn-sm" rel="#productlisting_' . $row_p['products_id'] . '"><i class="fa fa-arrow-up"></i> Top</button> <button type="button" class="btnOneUp btn btn-default btn-sm" rel="#productlisting_' . $row_p['products_id'] . '"><i class="fa fa-arrow-circle-up"></i> Up</button> <button type="button" class="btnOneDown btn btn-default btn-sm" rel="#productlisting_' . $row_p['products_id'] . '"><i class="fa fa-arrow-circle-down"></i> Down</button> <button type="button" class="btnBottom btn btn-default btn-sm" rel="#productlisting_' . $row_p['products_id'] . '"><i class="fa fa-arrow-down"></i> Bottom</button>
$category['parent_id'] = $this->get['cid']; } else { $category['parent_id'] = 0; } } $category_tree = ' <div class="form-group" id="msEditCategoryInputParent"> <label for="parent_id" class="control-label col-md-2">' . $this->pi_getLL('admin_parent') . '</label> <div class="col-md-10"> <input type="hidden" name="parent_id" id="parent_id" class="categoriesIdSelect2BigDropWider" value="' . $category['parent_id'] . '" /> </div> </div>'; //'.mslib_fe::tx_multishop_draw_pull_down_menu('parent_id', mslib_fe::tx_multishop_get_category_tree('', '', $skip_ids), $category['parent_id'],'class="select2BigDropWider"').' $categories_image = '<div class="image_action">'; if ($_REQUEST['action'] == 'edit_category' and $category['categories_image']) { $categories_image .= '<img src="' . mslib_befe::getImagePath($category['categories_image'], 'categories', 'normal') . '">'; $categories_image .= '<div class="image_tools">'; if ($this->ms['MODULES']['ADMIN_CROP_CATEGORIES_IMAGES']) { $categories_image .= ' <a href="#" class="btn btn-primary btn-sm" id="cropEditor" rel="' . $category['categories_image'] . '"><i class="fa fa-crop"></i></a>'; } $categories_image .= ' <a class="btn btn-danger btn-sm delete_categories_images" rel="\' + filenameServer + \'"><i class="fa fa-trash-o"></i></a>'; $categories_image .= '</div>'; } $categories_image .= '</div>'; // custom hook that can be controlled by third-party plugin if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/admin_edit_category.php']['addItemsToTabDetails'])) { $params = array('tmpcontent' => &$tmpcontent, 'category' => &$category); foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/admin_edit_category.php']['addItemsToTabDetails'] as $funcRef) { \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this); } }
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"> </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; }
do { $filename = mslib_fe::rewritenamein($tmp_filename) . ($i > 0 ? '-' . $i : '') . '.' . $ext; $folder_name = mslib_befe::getImagePrefixFolder($filename); $array = explode(".", $filename); $folder = $folder_name; if (!is_dir($this->DOCUMENT_ROOT . $this->ms['image_paths']['products']['original'] . '/' . $folder)) { \TYPO3\CMS\Core\Utility\GeneralUtility::mkdir($this->DOCUMENT_ROOT . $this->ms['image_paths']['products']['original'] . '/' . $folder); } $folder .= '/'; $target = $this->DOCUMENT_ROOT . $this->ms['image_paths']['products']['original'] . '/' . $folder . $filename; $i++; } while (file_exists($target)); } if (copy($temp_file, $target)) { $filename = mslib_befe::resizeProductImage($target, $filename, $this->DOCUMENT_ROOT . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey), 1); $fileLocation = $this->FULL_HTTP_URL . mslib_befe::getImagePath($filename, 'products', '50'); $result = array(); $result['success'] = true; $result['error'] = false; $result['filename'] = $filename; $result['fileLocation'] = $fileLocation . '?' . time(); echo htmlspecialchars(json_encode($result), ENT_NOQUOTES); exit; } } } } } } break; }
$cats = array_reverse($cats); $where = ''; if (count($cats) > 0) { foreach ($cats as $cat) { $where .= "categories_id[" . $level . "]=" . $cat['id'] . "&"; $level++; } $where = substr($where, 0, strlen($where) - 1); $where .= '&'; } // get all cats to generate multilevel fake url eof } $link = mslib_fe::typolink($this->conf['products_detail_page_pid'], '&' . $where . '&products_id=' . $product['products_id'] . '&tx_multishop_pi1[page_section]=products_detail&skeywords=' . urlencode($this->get['q'])); $prod['Link'] = $link; if ($product['products_image']) { $prod['Image'] = '<div class="ajax_products_image">' . '<img src="' . mslib_befe::getImagePath($product['products_image'], 'products', '50') . '">' . '</div>'; } else { $prod['Image'] = '<div class="ajax_products_image"><div class="no_image_50"></div></div>'; } $prod['Title'] = '<div class="ajax_products_name">' . substr($product['products_name'], 0, 50) . '</div><div class="ajax_products_model">' . substr($product['products_model'], 0, 50) . '</div>'; $prod['Title'] = $prod['Title']; $prod['Desc'] = '<div class="ajax_products_shortdescription">' . addslashes(mslib_befe::str_highlight(substr($product['products_shortdescription'], 0, 75), $this->get['q'])) . '</div>'; if ($product['products_price'] != $product['final_price']) { $prod['Price'] = '<div class="ajax_products_price"><div class="ajax_old_price">' . mslib_fe::amount2Cents($product['products_price']) . '</div><div class="ajax_specials_price">' . mslib_fe::amount2Cents($product['final_price']) . '</div></div>'; } else { $prod['Price'] = '<div class="ajax_products_price"><div class="ajax_normal_price">' . mslib_fe::amount2Cents($product['products_price']) . '</div></div>'; } $prod['Name'] = substr($product['products_name'], 0, 50); $prod['skeyword'] = $this->get['q']; $prod['Page'] = $pages; $prod['Product'] = true;
if (is_array($current) && $current['categories_name']) { $output['categories_header'] = '<h1>' . trim($current['categories_name']) . '</h1>'; } if ($current['categories_id'] == $this->conf['categoriesStartingPoint'] and $this->hideHeader) { $output['categories_header'] = ''; } if (is_array($categories) && count($categories)) { // load optional cms content and show the current category name eof $counter = 0; $contentItem = ''; foreach ($categories as $category) { $counter++; $output['categories_name'] = trim($category['categories_name']); if ($category['categories_image']) { $output['image'] = '<img src="' . mslib_befe::getImagePath($category['categories_image'], 'categories', 'normal') . '" alt="' . htmlspecialchars($category['categories_name']) . '">'; $output['image_url'] = mslib_befe::getImagePath($category['categories_image'], 'categories', 'normal'); } else { $output['image'] = '<div class="no_image"></div>'; $output['image_url'] = ''; } // get all cats to generate multilevel fake url $level = 0; $cats = mslib_fe::Crumbar($category['categories_id']); $cats = array_reverse($cats); $where = ''; if (count($cats) > 0) { foreach ($cats as $item) { $where .= "categories_id[" . $level . "]=" . $item['id'] . "&"; $level++; } $where = substr($where, 0, strlen($where) - 1);
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; }
$formats[] = '300'; foreach ($formats as $format) { if ($format) { $markerArray['###PRODUCTS_IMAGE_URL_' . $format . '###'] = ''; $markerArray['###FULL_PRODUCTS_IMAGE_URL_' . $format . '###'] = ''; } else { $markerArray['###PRODUCTS_IMAGE_URL###'] = ''; $markerArray['###FULL_PRODUCTS_IMAGE_URL###'] = ''; } if ($product['products_image']) { if ($format) { $markerArray['###PRODUCTS_IMAGE_URL_' . $format . '###'] = mslib_befe::getImagePath($product['products_image'], 'products', $format); $markerArray['###FULL_PRODUCTS_IMAGE_URL_' . $format . '###'] = $this->FULL_HTTP_URL . mslib_befe::getImagePath($product['products_image'], 'products', $format); } else { $markerArray['###PRODUCTS_IMAGE_URL###'] = mslib_befe::getImagePath($product['products_image'], 'products', $this->imageWidth); $markerArray['###FULL_PRODUCTS_IMAGE_URL###'] = $this->FULL_HTTP_URL . mslib_befe::getImagePath($product['products_image'], 'products', $this->imageWidth); } } } $markerArray['###CANONICAL_URL###'] = $productLink; $markerArray['###MANUFACTURERS_ADVICE_PRICE###'] = ''; if ($product['manufacturers_advice_price']) { if (!$this->ms['MODULES']['DB_PRICES_INCLUDE_VAT'] && ($product['tax_rate'] && $this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT'])) { $amount = $product['manufacturers_advice_price'] * (1 + $product['tax_rate']); } else { $amount = $product['manufacturers_advice_price']; } $markerArray['###MANUFACTURERS_ADVICE_PRICE###'] = mslib_fe::amount2Cents($amount); } $js_detail_page_triggers[] = ' var stepSize=parseFloat(\'' . ($product['products_multiplication'] != '0.00' ? $product['products_multiplication'] : 1) . '\');
if ($newFilename != $dbFilename) { //if ($this->ms['MODULES']['ADMIN_AUTO_CONVERT_UPLOADED_IMAGES_TO_PNG'] && $newFilename!=$dbFilename) { // FILE IS ALSO CONVERTED. LETS UPDATE THE DATABASE $content .= '<i>(' . $dbFilename . ' has been converted to: ' . $newFilename . ')</i><br/>'; $updateArray[$col] = $newFilename; } } } } if ($this->ms['MODULES']['ADMIN_CROP_PRODUCT_IMAGES']) { $crop_images_data = mslib_befe::getRecords($item['products_id'], 'tx_multishop_product_crop_image_coordinate', 'products_id'); if (is_array($crop_images_data) && count($crop_images_data)) { foreach ($crop_images_data as $crop_image_data) { $src_image_size = $crop_image_data['image_size'] == 'enlarged' ? 'normal' : $crop_image_data['image_size']; $src = $this->DOCUMENT_ROOT . mslib_befe::getImagePath($crop_image_data['image_filename'], 'products', $src_image_size); $src_original = $this->DOCUMENT_ROOT . mslib_befe::getImagePath($crop_image_data['image_filename'], 'products', 'original'); // backup original copy($src, $src . '-ori-' . $image_size); mslib_befe::cropImage($src, $src_original, $crop_image_data['image_size'], $crop_image_data['coordinate_x'], $crop_image_data['coordinate_y'], $crop_image_data['coordinate_w'], $crop_image_data['coordinate_h'], 'products'); } } } if (count($updateArray)) { $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_products', 'products_id=\'' . $item['products_id'] . '\'', $updateArray); $res = $GLOBALS['TYPO3_DB']->sql_query($query); if ($this->ms['MODULES']['FLAT_DATABASE']) { $query = $GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_products_flat', 'products_id=\'' . $item['products_id'] . '\'', $updateArray); $res = $GLOBALS['TYPO3_DB']->sql_query($query); } } }
'; if ($product['products_image']) { $image = ' <a id="thumb_0" rel="' . $this->conf['jQueryPopup_rel'] . '" class="' . $this->conf['jQueryPopup_rel'] . '" href="' . mslib_befe::getImagePath($product['products_image'], 'products', 'normal') . '"><img src="' . mslib_befe::getImagePath($product['products_image'], 'products', '300') . '"></a> '; } else { $image = '<div class="no_image"></div>'; } $output['products_image'] .= $image . ' </div> '; $tmpoutput = ''; for ($i = 1; $i < $this->ms['MODULES']['NUMBER_OF_PRODUCT_IMAGES']; $i++) { if ($product['products_image' . $i]) { $tmpoutput .= '<li><div class="listing_image_item">'; $tmpoutput .= '<a id="thumb_' . $i . '" rel="' . $this->conf['jQueryPopup_rel'] . '" class="' . $this->conf['jQueryPopup_rel'] . '" href="' . mslib_befe::getImagePath($product['products_image' . $i], 'products', 'normal') . '"><img src="' . mslib_befe::getImagePath($product['products_image' . $i], 'products', '50') . '"></a>'; $tmpoutput .= '</div></li>'; } } if ($tmpoutput) { $output['products_image_more'] .= '<div class="more_product_images"><ul>' . $tmpoutput . '</ul></div>'; } // loading the attributes $output['product_attributes'] = mslib_fe::showAttributes($product['products_id'], $product['tax_rate']); // loading the attributes eof // add to basket if (($this->ROOTADMIN_USER || $this->ADMIN_USER && $this->CATALOGADMIN_USER) && !$product['products_status'] && !$this->ms['MODULES']['FLAT_DATABASE']) { $order_now_button .= '<input id="multishop_add_to_cart" name="Submit" type="button" value="' . htmlspecialchars($this->pi_getLL('disabled_product', 'disabled product')) . '" />'; } else { if ($product['products_quantity'] < 1) { if ($this->ms['MODULES']['ALLOW_ORDER_OUT_OF_STOCK_PRODUCT']) {
$markerArray['PRODUCTS_LINK'] = $link; if ($rel_rs['products_image']) { $markerArray['ITEM_PRODUCTS_IMAGE'] = '<img src="' . mslib_befe::getImagePath($rel_rs['products_image'], 'products', '50') . '" alt="' . htmlspecialchars($rel_rs['products_name']) . '" />'; $markerArray['ITEM_PRODUCTS_IMAGE_100'] = '<img src="' . mslib_befe::getImagePath($rel_rs['products_image'], 'products', '100') . '" alt="' . htmlspecialchars($rel_rs['products_name']) . '" />'; $markerArray['ITEM_PRODUCTS_IMAGE_200'] = '<img src="' . mslib_befe::getImagePath($rel_rs['products_image'], 'products', '200') . '" alt="' . htmlspecialchars($rel_rs['products_name']) . '" />'; $markerArray['ITEM_PRODUCTS_IMAGE_300'] = '<img src="' . mslib_befe::getImagePath($rel_rs['products_image'], 'products', '300') . '" alt="' . htmlspecialchars($rel_rs['products_name']) . '" />'; } else { $markerArray['ITEM_PRODUCTS_IMAGE'] = '<div class="no_image_50"></div>'; $markerArray['ITEM_PRODUCTS_IMAGE_100'] = '<div class="no_image_50"></div>'; $markerArray['ITEM_PRODUCTS_IMAGE_200'] = '<div class="no_image_50"></div>'; $markerArray['ITEM_PRODUCTS_IMAGE_300'] = '<div class="no_image_50"></div>'; } $markerArray['ITEM_PRODUCTS_IMAGE_URL'] = mslib_befe::getImagePath($rel_rs['products_image'], 'products', '50'); $markerArray['ITEM_PRODUCTS_IMAGE_URL_100'] = mslib_befe::getImagePath($rel_rs['products_image'], 'products', '100'); $markerArray['ITEM_PRODUCTS_IMAGE_URL_200'] = mslib_befe::getImagePath($rel_rs['products_image'], 'products', '200'); $markerArray['ITEM_PRODUCTS_IMAGE_URL_300'] = mslib_befe::getImagePath($rel_rs['products_image'], 'products', '300'); $markerArray['ITEM_PRODUCTS_NAME_TITLE'] = $rel_rs['products_name'] . ($rel_rs['products_model'] ? ' - ' . $rel_rs['products_model'] : ''); $markerArray['ITEM_PRODUCTS_NAME'] = $rel_rs['products_name'] . ($rel_rs['products_model'] ? ' <br />' . $rel_rs['products_model'] : ''); $markerArray['ITEM_PRODUCTS_SHORTDESCRIPTION_ENCODED'] = htmlspecialchars($rel_rs['products_shortdescription']); $markerArray['ITEM_PRODUCTS_SHORTDESCRIPTION'] = $rel_rs['products_shortdescription']; $markerArray['PRODUCTS_SHORT_DESCRIPTION'] = $rel_rs['products_shortdescription']; $markerArray['ITEM_PRODUCTS_PRICE'] = mslib_fe::amount2Cents($final_price); $quantity_html = '<div class="quantity buttons_added">'; $quantity_html .= '<input type="button" value="-" data-stepSize="' . ($rel_rs['products_multiplication'] != '0.00' ? $rel_rs['products_multiplication'] : '1') . '" data-minQty="' . ($rel_rs['minimum_quantity'] != '0.00' ? $rel_rs['minimum_quantity'] : '1') . '" data-maxQty="' . ($rel_rs['maximum_quantity'] != '0.00' ? $rel_rs['maximum_quantity'] : '0') . '" class="rel_qty_minus" rel="relation_cart_quantity_' . $i . '">'; $quantity_html .= '<input class="qty_input" name="relation_cart_quantity[' . $i . ']" type="text" id="relation_cart_quantity_' . $i . '" value="1" size="4" maxlength="4" />'; $quantity_html .= '<input type="button" value="+" data-stepSize="' . ($rel_rs['products_multiplication'] != '0.00' ? $rel_rs['products_multiplication'] : '1') . '" data-minQty="' . ($rel_rs['minimum_quantity'] != '0.00' ? $rel_rs['minimum_quantity'] : '1') . '" data-maxQty="' . ($rel_rs['maximum_quantity'] != '0.00' ? $rel_rs['maximum_quantity'] : '0') . '" class="rel_qty_plus" rel="relation_cart_quantity_' . $i . '"></div>'; $markerArray['ITEM_PRODUCTS_QUANTITY'] = $quantity_html; //'<input type="text" name="relation_cart_quantity['.$i.']" value="1" maxlength="4" size="2" />'; $markerArray['ITEM_BUY_NOW'] = '<div class="checkbox checkbox-success"> <input type="checkbox" name="winkelwagen[' . $i . ']" id="relative_' . $i . '" value="1"><label for="relative_' . $i . '"></label></div>' . $rel_rs['hidden_fields']; $markerArray['ITEM_PRODUCTS_STOCK'] = $rel_rs['products_quantity'];
$y = ''; } else { $s = '_' . ($x + 1); $y = $x; } if ($row['products_image' . $y]) { if ($field == 'products_image_50' . $s) { $tmpcontent .= $this->FULL_HTTP_URL . mslib_befe::getImagePath($row['products_image' . $y], 'products', '50'); } elseif ($field == 'products_image_100' . $s) { $tmpcontent .= $this->FULL_HTTP_URL . mslib_befe::getImagePath($row['products_image' . $y], 'products', '100'); } elseif ($field == 'products_image_200' . $s) { $tmpcontent .= $this->FULL_HTTP_URL . mslib_befe::getImagePath($row['products_image' . $y], 'products', '200'); } elseif ($field == 'products_image_normal' . $s) { $tmpcontent .= $this->FULL_HTTP_URL . mslib_befe::getImagePath($row['products_image' . $y], 'products', 'normal'); } elseif ($field == 'products_image_original' . $s) { $tmpcontent .= $this->FULL_HTTP_URL . mslib_befe::getImagePath($row['products_image' . $y], 'products', 'original'); } } } } else { if (strpos($field, 'product_payment_methods_') !== false) { if ($row['products_id']) { $method_mappings = mslib_befe::getMethodsByProduct($row['products_id']); } $payment_code = str_replace('product_payment_methods_', '', $field); $payment_method = mslib_fe::loadPaymentMethod($payment_code); if (is_array($method_mappings['payment']) && in_array($payment_method['id'], $method_mappings['payment'])) { if (!$method_mappings['payment']['method_data'][$payment_method['id']]['negate']) { $tmpcontent .= 1; } else { if ($method_mappings['payment']['method_data'][$payment_method['id']]['negate'] > 0) {
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; }
public function displaySitemap($dataArray, $display_products = 1, $admin_mode = 0, $display_fields = array()) { if (!count($display_fields)) { $display_fields[] = 'products_image'; $display_fields[] = 'products_shortdescription'; } // cats $content = ''; if (count($dataArray['subs'])) { // $content.='<ul>'; foreach ($dataArray['subs'] as $item) { if (!count($item['products'])) { // cats $content .= '<li class="category' . (!$item['status'] ? ' disabled' : '') . '">'; if ($this->ADMIN_USER and $admin_mode) { // get all cats to generate multilevel fake url $level = 0; $cats = mslib_fe::Crumbar($item['categories_id']); $cats = array_reverse($cats); $where = ''; if (count($cats) > 0) { foreach ($cats as $tmp) { $where .= "categories_id[" . $level . "]=" . $tmp['id'] . "&"; $level++; } $where = substr($where, 0, strlen($where) - 1); // $where.='&'; } $link = mslib_fe::typolink($this->conf['products_listing_page_pid'], '&' . $where . '&tx_multishop_pi1[page_section]=products_listing'); // $where.='categories_id['.$level.']='.$category['categories_id']; // get all cats to generate multilevel fake url eof $content .= '<a href="' . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=edit_category&cid=' . $item['categories_id']) . '&action=edit_category">' . $item['categories_name'] . '</a>'; $content .= '<div class="action_icons"> <a href="' . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=edit_category&cid=' . $item['categories_id']) . '&action=edit_category" class="text-success msadmin_edit_icon"><i class="fa fa-pencil"></i></a> <a href="' . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=delete_category&cid=' . $item['categories_id'] . '&action=delete_category') . '" class="text-danger msadmin_delete_icon" alt="Remove"><i class="fa fa-trash-o"></i></a> <a href="' . $link . '" target="_blank" class="text-primary msadmin_view"><i class="fa fa-eye"></i></a> </div>'; } else { if ($display_products) { $content .= $item['categories_name']; } else { // get all cats to generate multilevel fake url $level = 0; $cats = mslib_fe::Crumbar($item['categories_id']); $cats = array_reverse($cats); $where = ''; if (count($cats) > 0) { foreach ($cats as $tmp) { $where .= "categories_id[" . $level . "]=" . $tmp['id'] . "&"; $level++; } $where = substr($where, 0, strlen($where) - 1); // $where.='&'; } // $where.='categories_id['.$level.']='.$item['categories_id']; $link = mslib_fe::typolink($this->conf['products_listing_page_pid'], '&' . $where . '&tx_multishop_pi1[page_section]=products_listing'); // get all cats to generate multilevel fake url eof // $content.=$item['categories_name']; if ($link) { $content .= '<a href="' . $link . '" class="ajax_link"' . $target . '>'; } $content .= $item['categories_name']; if ($link) { $content .= '</a>'; } } } $sub_content = mslib_fe::displaySitemap($item, $display_products, $admin_mode, $display_fields); if ($sub_content) { $content .= '<ul>' . $sub_content . '</ul>'; } $content .= '</li>'; } else { if ($display_products and count($item['products'])) { // products foreach ($item['products'] as $product) { if ($product['products_image']) { $image = '<img src="' . mslib_befe::getImagePath($product['products_image'], 'products', 50) . '" alt="' . htmlspecialchars($product['products_name']) . '">'; } else { $image = '<div class="no_image"></div>'; } $where = ''; if ($product['categories_id']) { // get all cats to generate multilevel fake url $level = 0; $cats = mslib_fe::Crumbar($product['categories_id']); $cats = array_reverse($cats); $where = ''; if (count($cats) > 0) { foreach ($cats as $cat) { $where .= "categories_id[" . $level . "]=" . $cat['id'] . "&"; $level++; } $where = substr($where, 0, strlen($where) - 1); // $where.='&'; } // get all cats to generate multilevel fake url eof } if ($product['products_url'] and $this->ms['MODULES']['AFFILIATE_SHOP']) { $link = $product['products_url']; } else { $link = mslib_fe::typolink($this->conf['products_detail_page_pid'], '&' . $where . '&products_id=' . $product['products_id'] . '&tx_multishop_pi1[page_section]=products_detail'); } $content .= '<li class="product">'; $content .= '<span class="products_name"><a href="' . $link . '" class="ajax_link" alt="' . $product['products_meta_description'] . '" title="' . $product['products_meta_description'] . '">' . $product['products_name'] . '</a></span>'; if (in_array('products_image', $display_fields)) { $content .= '<span class="products_image"><a href="' . $link . '" class="ajax_link" alt="' . $product['products_meta_description'] . '" title="' . $product['products_meta_description'] . '">' . $image . '</a></span>'; } if (in_array('products_shortdescription', $display_fields)) { $content .= '<span class="products_description">' . $product['products_shortdescription'] . '</span>'; } $content .= '</li>'; } } } } // $content.='</ul>'; } return $content; }
} } } $temp_var_products['link_detail'] = $link_detail; $temp_var_products['link_add_to_cart'] = mslib_fe::typolink($this->shop_pid, '&tx_multishop_pi1[page_section]=shopping_cart&tx_multishop_pi1[action]=add_to_cart&products_id=' . $product['products_id']); $temp_var_products['add_to_basket'] = $this->pi_getLL('add_to_basket'); $temp_var_products['catlink'] = $catlink; if ($product['products_image']) { $temp_var_products['products_image'] = mslib_befe::getImagePath($product['products_image'], 'products', '100'); $temp_var_products['products_image50'] = mslib_befe::getImagePath($product['products_image'], 'products', '50'); $temp_var_products['products_image200'] = mslib_befe::getImagePath($product['products_image'], 'products', '200'); } if ($product['products_image1']) { $temp_var_products['products_image1'] = mslib_befe::getImagePath($product['products_image1'], 'products', '100'); $temp_var_products['products_image150'] = mslib_befe::getImagePath($product['products_image1'], 'products', '50'); $temp_var_products['products_image1200'] = mslib_befe::getImagePath($product['products_image1'], 'products', '200'); } $temp_var_products['manufacturers_name'] = $product['manufacturers_name']; $temp_var_products['price_excluding_vat'] = $price_excluding_vat; $temp_var_products['old_price'] = $old_price; $temp_var_products['special_price'] = $specials_price; $temp_var_products['price'] = $price; $temp_var_products['shipping_costs_popup'] = 0; if ($this->ms['MODULES']['DISPLAY_SHIPPING_COSTS_ON_PRODUCTS_LISTING_PAGE']) { $temp_var_products['shipping_costs_popup'] = 1; } foreach ($product as $key => $val) { if (strstr($key, "a_")) { $temp_var_products[$key] = $val; } }
$manufacturer = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry); $str = "SELECT * from tx_multishop_manufacturers_cms where manufacturers_id='" . $_REQUEST['manufacturers_id'] . "'"; $qry = $GLOBALS['TYPO3_DB']->sql_query($str); while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) != false) { $lngman[$row['language_id']] = $row; } } $manufacturersImage = ''; $manufacturersContent = ''; $manufacturersMeta = ''; if ($manufacturer['manufacturers_id'] or $_REQUEST['action'] == 'add_manufacturer') { if ($_REQUEST['action'] == 'edit_manufacturer' and $manufacturer['manufacturers_image']) { $tmpcontent .= '<img src="' . mslib_befe::getImagePath($manufacturer['manufacturers_image'], 'manufacturers', 'normal') . '">'; $tmpcontent .= ' <a href="' . mslib_fe::typolink($this->shop_pid . ',2003', '&tx_multishop_pi1[page_section]=edit_manufacturer&manufacturers_id=' . $_REQUEST['manufacturers_id'] . '&action=edit_manufacturer&delete_image=manufacturers_image') . '" onclick="return confirm(\'Are you sure?\')"><img src="' . $this->FULL_HTTP_URL_MS . 'templates/images/icons/delete2.png" border="0" alt="delete image"></a>'; $markerArray = array(); $markerArray['MANUFACTURER_IMAGES_SRC'] = mslib_befe::getImagePath($manufacturer['manufacturers_image'], 'manufacturers', 'normal'); $markerArray['MANUFACTURER_IMAGES_DELETE_LINK'] = mslib_fe::typolink($this->shop_pid . ',2003', '&tx_multishop_pi1[page_section]=edit_manufacturer&manufacturers_id=' . $_REQUEST['manufacturers_id'] . '&action=edit_manufacturer&delete_image=manufacturers_image'); $markerArray['FULL_HTTP_URL'] = $this->FULL_HTTP_URL_MS; $markerArray['ADMIN_LABEL_JS_ARE_YOU_SURE'] = $this->pi_getLL('admin_label_js_are_you_sure'); $markerArray['MANUFACTURER_IMAGES_FILENAME'] = $manufacturer['manufacturers_image']; $markerArray['###MANUFACTURERS_IMAGE_CROP_BUTTON'] = ''; if (isset($manufacturer['manufacturers_image']) && !empty($manufacturer['manufacturers_image'])) { $markerArray['MANUFACTURERS_IMAGE_CROP_BUTTON'] = '<a href="#" id="cropEditor" rel="' . $manufacturer['manufacturers_image'] . '"><span>crop</span></a>'; } $manufacturersImage .= $this->cObj->substituteMarkerArray($subparts['manufacturers_images'], $markerArray, '###|###'); } foreach ($this->languages as $key => $language) { $markerArray = array(); $markerArray['IS_COLLAPSED'] = $language['uid'] > 0 && $this->ms['MODULES']['FOLD_FOREIGN_LANGUAGE_INPUT_FIELDS'] ? ' collapsed' : ''; $markerArray['IS_UNFOLD'] = $language['uid'] === 0 || !$this->ms['MODULES']['FOLD_FOREIGN_LANGUAGE_INPUT_FIELDS'] ? ' in' : ''; $markerArray['LANGUAGE_UID'] = $language['uid'];
} $where = substr($where, 0, strlen($where) - 1); $where .= '&'; } // get all cats to generate multilevel fake url eof } $row[0] = $order['products_id']; $row[1] = number_format($order['qty'], 2); $row[2] = ''; if ($order['products_id'] > 0) { if ($product['products_id']) { // product still exists in database so lets add anchor link to products detail page $row[2] .= '<a href="' . mslib_fe::typolink($this->conf['products_detail_page_pid'], '&' . $where . '&products_id=' . $order['products_id'] . '&tx_multishop_pi1[page_section]=products_detail') . '" target="_blank">'; } if ($this->ms['MODULES']['DISPLAY_PRODUCT_IMAGE_IN_ADMIN_ORDER_DETAILS'] and $product['products_image']) { $row[2] .= '<img src="' . mslib_befe::getImagePath($product['products_image'], 'products', '50') . '">'; } $row[2] .= $order['products_name']; if ($order['products_model']) { $row[2] .= '(' . $order['products_model'] . ')'; } if ($product['ean_code']) { $row[2] .= '<br />EAN: ' . $product['ean_code']; } if ($product['sku_code']) { $row[2] .= '<br />SKU: ' . $product['sku_code']; } if ($product['vendor_code']) { $row[2] .= '<br />Vendor code: ' . $product['vendor_code']; } if ($product['products_id']) {
function subMenuArray($dataArray) { if (count($dataArray['subs'])) { $tel = 0; foreach ($dataArray['subs'] as $item) { $menuArr[$tel]['title'] = $item['categories_name']; $menuArr[$tel]['uid'] = '9999' . $item['categories_id']; $menuArr[$tel]['description'] = $item['meta_description']; $menuArr[$tel]['keywords'] = $item['meta_keywords']; $menuArr[$tel]['image'] = ''; if ($item['categories_image']) { $menuArr[$tel]['image'] = '<img src="uploads/tx_multishop/images/categories/normal' . mslib_befe::getImagePath($item['categories_image'], 'categories', 'normal') . '" alt="' . htmlspecialchars($item['categories_name']) . '">'; } // get all cats to generate multilevel fake url $level = 0; $cats = mslib_fe::Crumbar($item['categories_id']); $cats = array_reverse($cats); $where = ''; if (count($cats) > 0) { foreach ($cats as $tmp) { $where .= "categories_id[" . $level . "]=" . $tmp['id'] . "&"; $level++; } $where = substr($where, 0, strlen($where) - 1); } $link = mslib_fe::typolink($this->conf['shop_pid'], $where . '&tx_multishop_pi1[page_section]=products_listing'); $menuArr[$tel]['_OVERRIDE_HREF'] = $link; $sub_content = $this->subMenuArray($item); if ($sub_content) { $menuArr[$tel]['_SUB_MENU'] = $sub_content; } $tel++; } } return $menuArr; }
$(v).removeAttr("disabled"); $(c_selectbox_id).removeAttr("disabled"); }); } } }); }); </script>'; $counter = 0; $categories = mslib_fe::getSubcatsOnly($this->categoriesStartingPoint, 1); $cat_selectbox = ''; $contentItem = ''; foreach ($categories as $category) { $counter++; if ($category['categories_image']) { $image = '<img src="' . mslib_befe::getImagePath($category['categories_image'], 'categories', 'normal') . '" alt="' . htmlspecialchars($category['categories_name']) . '">'; } else { $image = '<div class="no_image"></div>'; } // get all cats to generate multilevel fake url $level = 0; $cats = mslib_fe::Crumbar($category['categories_id']); $cats = array_reverse($cats); $where = ''; if (count($cats) > 0) { foreach ($cats as $item) { $where .= "categories_id[" . $level . "]=" . $item['id'] . "&"; $level++; } $where = substr($where, 0, strlen($where) - 1); $where .= '&';
function adminEditProductPreProc(&$params, &$reference) { //---------------------------------------- // VARIANTS TAB //---------------------------------------- // product Attribute //if (!$reference->ms['MODULES']['DISABLE_PRODUCT_VARIANTS_TAB_IN_EDITOR']) { $product = $params['product']; // Get HTML template file if ($reference->conf['edit_variants_tmpl_path']) { $template = $reference->cObj->fileResource($reference->conf['edit_variants_tmpl_path']); } else { $template = $reference->cObj->fileResource(t3lib_extMgm::siteRelPath('msvariants') . 'Templates/edit_variants.tmpl'); } // Extract the subparts from the template $subparts = array(); $subparts['template'] = $reference->cObj->getSubpart($template, '###TEMPLATE###'); $subparts['item_variant'] = $reference->cObj->getSubpart($subparts['template'], '###ITEM_VARIANT###'); $subparts['item_option'] = $reference->cObj->getSubpart($subparts['template'], '###ITEM_OPTION###'); // Get variants from db $sql_pa = $GLOBALS['TYPO3_DB']->SELECTquery('vars.variant_id, vars.product_id, vars.variant_price, vars.variant_stock, vars.variant_sku, vattrs.attribute_id, vattrs.option_id, vattrs.option_value_id', 'tx_msvariants_domain_model_variants vars, tx_msvariants_domain_model_variantsattributes vattrs', "vars.product_id='" . $product['products_id'] . "' and vars.variant_id=vattrs.variant_id", '', '', ''); $qry_pa = $GLOBALS['TYPO3_DB']->sql_query($sql_pa); // Generate HTML for variants tab block if there are variants if ($product['products_id']) { if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry_pa) > 0) { $variants_data = array(); $variants_attributes_data = array(); while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry_pa)) != false) { if (!$variants_data[$row['variant_id']]) { $variants_data[$row['variant_id']] = array('variant_id' => $row['variant_id'], 'product_id' => $row['product_id'], 'variant_price' => $row['variant_price'], 'variant_stock' => $row['variant_stock'], 'variant_sku' => $row['variant_sku']); } $row['option_name'] = mslib_fe::getRealNameOptions($row['option_id']); $row['option_value_name'] = mslib_fe::getNameOptions($row['option_value_id']); $variants_attributes_data[$row['variant_id']][] = $row; } // Generate HTML for variants foreach ($variants_data as $variant) { $variant_name = 'Variant: '; // generate HTML for variant's attributes $content_options = ''; $markerArray = array(); foreach ($variants_attributes_data[$variant['variant_id']] as $variant_attribute) { $markerArray['OPTION_NAME'] = $variant_attribute['option_name']; $markerArray['OPTION_VALUE'] = $variant_attribute['option_value_name']; $content_options .= $reference->cObj->substituteMarkerArray($subparts['item_option'], $markerArray, '###|###'); $variant_name .= $variant_attribute['option_value_name'] . " - "; } // generate HTML for variant details $markerArray = array(); $markerArray['LABEL_VARIANT_NAME'] = $variant_name; $markerArray['LABEL_PRICE'] = 'Price'; $markerArray['LABEL_STOCK'] = 'Stock'; $markerArray['LABEL_SKU'] = 'SKU'; $markerArray['VARIANT_ID'] = $variant['variant_id']; $markerArray['PRICE'] = $variant['variant_price']; $markerArray['STOCK'] = $variant['variant_stock']; $markerArray['SKU'] = $variant['variant_sku']; $content_item_variant = $reference->cObj->substituteMarkerArray($subparts['item_variant'], $markerArray, '###|###'); $content_item_variant = $reference->cObj->substituteSubpart($content_item_variant, 'ITEM_OPTION', $content_options); $content_variants .= $content_item_variant; } // Generate HTML for variants tab block $markerArray = array(); $markerArray['LABEL_HEADING_TAB_VARIANTS'] = 'VARIANTS'; $content = $reference->cObj->substituteMarkerArray($subparts['template'], $markerArray, '###|###'); $content = $reference->cObj->substituteSubpart($content, 'ITEM_VARIANT', $content_variants); } } $params['plugins_extra_tab']['tabs_header'][] = '<li><a href="#product_variants">VARIANTS</a></li>'; //$params['plugins_extra_tab']['tabs_content'][] = // '<div style="display:none;" id="product_variants" class="tab_content">'.$res.'</div'; $params['plugins_extra_tab']['tabs_content'][] = $content; //---------------------------------------- // VARIANTS IMAGES TAB //---------------------------------------- // product Attribute //if (!$reference->ms['MODULES']['DISABLE_PRODUCT_VARIANTS_TAB_IN_EDITOR']) { // Get HTML template file if ($reference->conf['edit_variants_images_tmpl_path']) { $template = $reference->cObj->fileResource($reference->conf['edit_variants_images_tmpl_path']); } else { $template = $reference->cObj->fileResource(t3lib_extMgm::siteRelPath('msvariants') . 'Templates/edit_variants_images.tmpl'); } // Extract the subparts from the template $subparts = array(); $subparts['template'] = $reference->cObj->getSubpart($template, '###TEMPLATE###'); $subparts['item_variant_images'] = $reference->cObj->getSubpart($subparts['template'], '###ITEM_VARIANT_IMAGES###'); $subparts['item_option'] = $reference->cObj->getSubpart($subparts['template'], '###ITEM_OPTION###'); // Get variants from db $sql_pa = $GLOBALS['TYPO3_DB']->SELECTquery('vars.variant_id, vars.product_id, vars.variant_price, vars.variant_stock, vars.variant_sku, vattrs.attribute_id, vattrs.option_id, vattrs.option_value_id', 'tx_msvariants_domain_model_variants vars, tx_msvariants_domain_model_variantsattributes vattrs', "vars.product_id='" . $product['products_id'] . "' and vars.variant_id=vattrs.variant_id", '', '', ''); $qry_pa = $GLOBALS['TYPO3_DB']->sql_query($sql_pa); // Generate HTML for variants tab block if there are variants if ($product['products_id']) { if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry_pa) > 0) { $variants_data = array(); $variants_attributes_data = array(); while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry_pa)) != false) { if (!$variants_data[$row['variant_id']]) { $variants_data[$row['variant_id']] = array('variant_id' => $row['variant_id'], 'product_id' => $row['product_id'], 'variant_price' => $row['variant_price'], 'variant_stock' => $row['variant_stock'], 'variant_sku' => $row['variant_sku']); } $row['option_name'] = mslib_fe::getRealNameOptions($row['option_id']); $row['option_value_name'] = mslib_fe::getNameOptions($row['option_value_id']); $variants_attributes_data[$row['variant_id']][] = $row; } // Generate HTML for variants $nVariant = 0; foreach ($variants_data as $variant) { $nVariant++; $variant_name = 'Variant: '; // generate HTML for variant's attributes $content_options = ''; $markerArray = array(); foreach ($variants_attributes_data[$variant['variant_id']] as $variant_attribute) { $markerArray['OPTION_NAME'] = $variant_attribute['option_name']; $markerArray['OPTION_VALUE'] = $variant_attribute['option_value_name']; $content_options .= $reference->cObj->substituteMarkerArray($subparts['item_option'], $markerArray, '###|###'); $variant_name .= $variant_attribute['option_value_name'] . " - "; } // generate HTML for variant details $markerArray = array(); $markerArray['LABEL_VARIANT_NAME'] = $variant_name; $markerArray['LABEL_SKU'] = 'SKU'; $markerArray['VARIANT_ID'] = $variant['variant_id']; $markerArray['SKU'] = $variant['variant_sku']; // images tab $images_tab_block = ''; for ($x = 0; $x < $reference->ms['MODULES']['NUMBER_OF_PRODUCT_IMAGES']; $x++) { $i = $x; if ($i == 0) { $i = ''; } $images_tab_block .= ' <div class="account-field" id="msEditProductInputImage_' . $i . '"> <label for="variants_image_' . $nVariant . '_' . $i . '">' . $reference->pi_getLL('admin_image') . ' ' . ($i + 1) . '</label> <div id="variants_image_' . $nVariant . '_' . $i . '"> <noscript> <input name="variants_image_' . $nVariant . '_' . $i . '" type="file" /> </noscript> </div> <input name="ajax_variants_image_' . $nVariant . '_' . $i . '" id="ajax_variants_image_' . $nVariant . '_' . $i . '" type="hidden" value="" />'; if ($_REQUEST['action'] == 'edit_product' and $product['variants_image_' . $nVariant . '_' . $i]) { $images_tab_block .= '<img src="' . mslib_befe::getImagePath($product['variants_image_' . $nVariant . '_' . $i], 'products', '50') . '">'; $images_tab_block .= ' <a href="' . mslib_fe::typolink(',2002', '&tx_multishop_pi1[page_section]=admin_ajax&cid=' . $_REQUEST['cid'] . '&pid=' . $_REQUEST['pid'] . '&action=edit_product&delete_image=variants_image_' . $nVariant . '_' . $i) . '" onclick="return confirm(\'Are you sure?\')"><img src="' . $reference->FULL_HTTP_URL_MS . 'templates/images/icons/delete2.png" border="0" alt="' . $reference->pi_getLL('admin_delete_image') . '"></a>'; } $images_tab_block .= '</div>'; } $images_tab_block .= '<script> jQuery(document).ready(function($) {'; for ($x = 0; $x < $reference->ms['MODULES']['NUMBER_OF_PRODUCT_IMAGES']; $x++) { $i = $x; if ($i == 0) { $i = ''; } $images_tab_block .= ' var products_name=$("#products_name_0").val(); var uploader' . $i . ' = new qq.FileUploader({ element: document.getElementById(\'variants_image_' . $nVariant . '_' . $i . '\'), action: \'' . mslib_fe::typolink(',2002', '&tx_multishop_pi1[page_section]=custom_page') . '\', params: { products_name: products_name, file_type: \'products_image' . $i . '\' }, template: \'<div class="qq-uploader">\' + \'<div class="qq-upload-drop-area"><span>' . $reference->pi_getLL('admin_label_drop_files_here_to_upload') . '</span></div>\' + \'<div class="qq-upload-button">' . addslashes(htmlspecialchars($reference->pi_getLL('choose_image'))) . '</div>\' + \'<ul class="qq-upload-list"></ul>\' + \'</div>\', onComplete: function(id, fileName, responseJSON){ var filenameServer = responseJSON[\'filename\']; $("#ajax_variants_image_' . $nVariant . '_' . $i . '").val(filenameServer); }, debug: false });'; } $images_tab_block .= ' $(\'#products_name_0\').change(function() { var products_name=$("#products_name_0").val();'; for ($x = 0; $x < $reference->ms['MODULES']['NUMBER_OF_PRODUCT_IMAGES']; $x++) { $i = $x; if ($i == 0) { $i = ''; } $images_tab_block .= ' uploader' . $i . '.setParams({ products_name: products_name, file_type: \'products_image' . $i . '\' });'; } $images_tab_block .= ' }); }); </script>'; $markerArray['IMAGE_CODE'] = $images_tab_block; $content_item_variant_images = $reference->cObj->substituteMarkerArray($subparts['item_variant_images'], $markerArray, '###|###'); $content_item_variant_images = $reference->cObj->substituteSubpart($content_item_variant_images, 'ITEM_OPTION', $content_options); $content_variants_images .= $content_item_variant_images; } // Generate HTML for variants tab block $markerArray = array(); $markerArray['LABEL_HEADING_TAB_VARIANTS_IMAGES'] = 'VARIANTS IMAGES'; $content2 = $reference->cObj->substituteMarkerArray($subparts['template'], $markerArray, '###|###'); $content2 = $reference->cObj->substituteSubpart($content2, 'ITEM_VARIANT_IMAGES', $content_variants_images); } } $params['plugins_extra_tab']['tabs_header'][] = '<li><a href="#product_variants_images">VARIANTS IMAGES</a></li>'; //$params['plugins_extra_tab']['tabs_content'][] = // '<div style="display:none;" id="product_variants" class="tab_content">'.$res.'</div'; $params['plugins_extra_tab']['tabs_content'][] = $content2; }
$contentItem = ''; foreach ($manufacturers as $row) { $link = mslib_fe::typolink($this->conf['search_page_pid'], '&tx_multishop_pi1[page_section]=manufacturers_products_listing&manufacturers_id=' . $row['manufacturers_id']); if ($this->ADMIN_USER) { $output['admin_manufacturers_sortable_id'] = 'sortable_manufacturer_' . $row['manufacturers_id'] . ''; } $output['class_active'] = $row['manufacturers_id'] == $this->get['manufacturers_id'] ? 'active' : ''; $output['manufacturers_link'] = $link; $output['manufacturers_name'] = htmlspecialchars($row['manufacturers_name']); $markerArray = array(); $markerArray['ADMIN_MANUFACTURERS_SORTABLE_ID'] = $output['admin_manufacturers_sortable_id']; $markerArray['CLASS_ACTIVE'] = $output['class_active']; $markerArray['MANUFACTURERS_LINK'] = $output['manufacturers_link']; $markerArray['MANUFACTURERS_NAME'] = $output['manufacturers_name']; if ($row['manufacturers_image']) { $markerArray['MANUFACTURERS_IMAGE_NORMAL'] = '<img src="' . mslib_befe::getImagePath($row['manufacturers_image'], 'manufacturers', 'normal') . '">'; } else { $markerArray['MANUFACTURERS_IMAGE_NORMAL'] = ''; } $contentItem .= $this->cObj->substituteMarkerArray($subparts['item'], $markerArray, '###|###'); } // fill the row marker with the expanded rows $subpartArray['###MANUFACTURERS_UID###'] = $output['manufacturers_uid']; $subpartArray['###MANUFACTURERS_HEADER###'] = $output['manufacturers_header']; $subpartArray['###ITEM###'] = $contentItem; // completed the template expansion by replacing the "item" marker in the template $content = $this->cObj->substituteMarkerArrayCached($subparts['template'], null, $subpartArray); } else { header('HTTP/1.0 404 Not Found'); // set custom 404 message $page = mslib_fe::getCMScontent('manufacturer_not_found_message', $GLOBALS['TSFE']->sys_language_uid);
} $total_tax = 0; foreach ($order['products'] as $product) { if (!$tr_type or $tr_type == 'even') { $tr_type = 'odd'; } else { $tr_type = 'even'; } $tmpcontent .= '<tr class="' . $tr_type . '">'; $tmpcontent .= '<td class="cellQty">' . number_format($product['qty']) . '</td>'; $tmpcontent .= '<td class="cellID">' . $product['products_id'] . '</td>'; $tmpcontent .= '<td class="cellModel">' . $product['products_model'] . '</td>'; $product_tmp = mslib_fe::getProduct($product['products_id']); if ($this->ms['MODULES']['DISPLAY_PRODUCT_IMAGE_IN_ADMIN_PACKING_SLIP'] and $product_tmp['products_image']) { $tmpcontent .= '<td class="cellName"><strong>'; $tmpcontent .= '<img src="' . mslib_befe::getImagePath($product_tmp['products_image'], 'products', '50') . '"> '; $tmpcontent .= $product['products_name']; } else { $tmpcontent .= '<td class="cellName"><strong>' . $product['products_name']; } if ($product['products_article_number']) { $tmpcontent .= ' (' . $product['products_article_number'] . ')'; } $tmpcontent .= '</strong>'; if ($this->ms['MODULES']['DISPLAY_EAN_IN_ORDER_DETAILS'] == '1' && !empty($product['ean_code'])) { $tmpcontent .= '<br/>' . $this->pi_getLL('admin_label_ean') . ': ' . $product['ean_code']; } if ($this->ms['MODULES']['DISPLAY_SKU_IN_ORDER_DETAILS'] == '1' && !empty($product['sku_code'])) { $tmpcontent .= '<br/>' . $this->pi_getLL('admin_label_sku') . ': ' . $product['sku_code']; } if ($this->ms['MODULES']['DISPLAY_VENDOR_IN_ORDER_DETAILS'] == '1' && !empty($product['vendor_code'])) {
$where = ''; if (count($cats) > 0) { foreach ($cats as $cat) { $where .= "categories_id[" . $level . "]=" . $cat['id'] . "&"; $level++; } $where = substr($where, 0, strlen($where) - 1); $where .= '&'; } // get all cats to generate multilevel fake url eof } $link = mslib_fe::typolink($this->conf['products_detail_page_pid'], '&' . $where . '&products_id=' . $current_product['products_id'] . '&tx_multishop_pi1[page_section]=products_detail'); $catlink = mslib_fe::typolink($this->conf['products_listing_page_pid'], '&' . $where . '&tx_multishop_pi1[page_section]=products_listing'); $counter++; if ($current_product['products_image']) { $image = '<img src="' . mslib_befe::getImagePath($current_product['products_image'], 'products', $this->imageWidth) . '" alt="' . htmlspecialchars($current_product['products_name']) . '" />'; } else { $image = '<div class="no_image"></div>'; } $ITEM_CLASS = ''; if (($this->ROOTADMIN_USER or $this->ADMIN_USER and $this->CATALOGADMIN_USER) and !$current_product['products_status'] and !$this->ms['MODULES']['FLAT_DATABASE']) { $ITEM_CLASS = 'disabled_product'; } $content .= '<li id="productlisting_' . $current_product['products_id'] . '" class="' . $ITEM_CLASS . '"> <h2><a href="' . $link . '" class="ajax_link">' . $current_product['products_name'] . '</a></h2> <div class="image"><a href="' . $link . '" title="' . htmlspecialchars($current_product['products_name']) . '" class="ajax_link">' . $image . '</a></div> <div class="description">' . $current_product['products_shortdescription'] . '</div> <div class="category"><a href="' . $catlink . '" class="ajax_link">' . $current_product['categories_name'] . '</a></div> <div class="link_detail"><a href="' . $link . '" class="ajax_link">' . $this->pi_getLL('details') . '</a></div> '; $final_price = mslib_fe::final_products_price($current_product);
} $folder .= '/'; $target = $this->DOCUMENT_ROOT . $this->ms['image_paths']['attribute_values']['original'] . '/' . $folder . $filename; $i++; } while (file_exists($target)); } if (copy($temp_file, $target)) { $filename = mslib_befe::resizeProductAttributeValuesImage($target, $filename, $this->DOCUMENT_ROOT . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->extKey), 1); $result = array(); $result['success'] = true; $result['error'] = false; $result['filename'] = $filename; $result['fileLocation'] = mslib_befe::getImagePath($filename, 'attribute_values', 'original'); $result['target_after'] = '#ajax_attribute_value_image' . $this->get['attribute_value_image']; $result['target_delete'] = '.product_values_image' . $this->get['attribute_value_image']; $result['image_display'] = '<img class="values_image' . $this->get['attribute_value_image'] . '" src="' . mslib_befe::getImagePath($filename, 'attribute_values', 'small') . '" width="50px"> <a class="values_image' . $this->get['attribute_value_image'] . '" id="delete_attribute_values_image" href="#" rel="' . $this->get['attribute_value_image'] . '"><img src="' . $this->FULL_HTTP_URL_MS . 'templates/images/icons/delete2.png" border="0" alt="' . $this->pi_getLL('admin_delete_image') . '"></a>'; /*$updateArray=array(); $updateArray['attribute_image']=$filename; $query=$GLOBALS['TYPO3_DB']->UPDATEquery('tx_multishop_products_attributes', 'products_attributes_id='.$this->get['attribute_value_image'], $updateArray); $res=$GLOBALS['TYPO3_DB']->sql_query($query);*/ echo json_encode($result); exit; } } } } } break; case 'update_attributes_sortable': switch ($this->get['tx_multishop_pi1']['type']) {
</td>'; $attribute_values_class_id[] = '.product_attribute_values_' . $option_id; if ($this->ms['MODULES']['ENABLE_ATTRIBUTE_VALUE_IMAGES']) { $element_id = $product['products_id'] . '_' . $option_id . '_' . $attribute_data['options_values_id']; $existing_product_attributes_block_columns['attribute_value_image_col'] = '<td class="product_attribute_value_image"> <div class="form-group" class="msEditAttributeValueImage"> <label for="attribute_value_image">' . $this->pi_getLL('admin_image') . '</label> <div id="attribute_value_image' . $element_id . '"> <noscript> <input name="attribute_value_image[]" type="file" /> </noscript> </div> <input name="ajax_attribute_value_image[]" id="ajax_attribute_value_image' . $element_id . '" type="hidden" value="' . $attribute_data['attribute_image'] . '" />'; $existing_product_attributes_block_columns['attribute_value_image_col'] .= '<div id="attribute_value_image_action' . $element_id . '" class="attribute_value_image">'; if ($_REQUEST['action'] == 'edit_product' && $attribute_data['attribute_image']) { $existing_product_attributes_block_columns['attribute_value_image_col'] .= '<img src="' . mslib_befe::getImagePath($attribute_data['attribute_image'], 'attribute_values', 'small') . '" width="75" id="product_attribute_value_image' . $element_id . '" />'; $existing_product_attributes_block_columns['attribute_value_image_col'] .= '<div class="image_tools">'; $existing_product_attributes_block_columns['attribute_value_image_col'] .= ' <a href="#" class="delete_product_attribute_value_images" rel="' . $element_id . ':' . $attribute_data['attribute_image'] . '"><img src="' . $this->FULL_HTTP_URL_MS . 'templates/images/icons/delete2.png" border="0" alt="' . $this->pi_getLL('admin_delete_image') . '"></a>'; $existing_product_attributes_block_columns['attribute_value_image_col'] .= '</div>'; } $existing_product_attributes_block_columns['attribute_value_image_col'] .= '</div>'; $existing_product_attributes_block_columns['attribute_value_image_col'] .= '</div>'; $existing_product_attributes_block_columns['attribute_value_image_col'] .= '<script> jQuery(document).ready(function($) {'; $existing_product_attributes_block_columns['attribute_value_image_col'] .= ' var products_attribute_value_image=\'' . $element_id . '\'; var uploader_attribute_value_image' . $element_id . ' = new qq.FileUploader({ element: document.getElementById(\'attribute_value_image' . $element_id . '\'), action: \'' . mslib_fe::typolink($this->shop_pid . ',2002', 'tx_multishop_pi1[page_section]=admin_ajax_attributes_options_values&tx_multishop_pi1[admin_ajax_attributes_options_values]=admin_upload_product_attribute_value_images') . '\', params: { attribute_value_image: products_attribute_value_image,
$size = getimagesize($temp_file); if ($size[0] > 150) { $size[0] = 150; } $images_tab_block .= ' <div class="fe_user_image"> <img src="uploads/pics/' . $this->post['image'] . '" width="' . $size[0] . '" /> </div> '; } $images_tab_block .= ' <input name="tx_multishop_pi1[image]" id="ajax_fe_user_image" type="hidden" value="" />'; // todo: question from Bas: what is edit_product code doing in edit_customer if ($_REQUEST['action'] == 'edit_product' and $this->post['image']) { $images_tab_block .= '<img src="' . mslib_befe::getImagePath($this->post['image'], 'products', '50') . '">'; $images_tab_block .= ' <a href="' . mslib_fe::typolink($this->shop_pid . ',2002', '&tx_multishop_pi1[page_section]=admin_ajax&cid=' . $_REQUEST['cid'] . '&pid=' . $_REQUEST['pid'] . '&action=edit_product&delete_image=products_image') . '" onclick="return confirm(\'' . addslashes($this->pi_getLL('admin_label_js_are_you_sure')) . '\')"><img src="' . $this->FULL_HTTP_URL_MS . 'templates/images/icons/delete2.png" border="0" alt="' . $this->pi_getLL('admin_delete_image') . '"></a>'; } $images_tab_block .= '</div>'; $images_tab_block .= ' <script> jQuery(document).ready(function($) { var uploader = new qq.FileUploader({ element: document.getElementById(\'fe_user_image' . '\'), action: \'' . mslib_fe::typolink($this->shop_pid . ',2002', '&tx_multishop_pi1[page_section]=admin_ajax_upload&tx_multishop_pi1[uid]=' . $user['uid']) . '\', params: { file_type: \'fe_user_image' . '\' }, template: \'<div class="qq-uploader">\' + \'<div class="qq-upload-drop-area"><span>' . addslashes(htmlspecialchars($this->pi_getLL('admin_label_drop_files_here_to_upload'))) . '</span></div>\' + \'<div class="btn btn-primary btn-sm qq-upload-button">' . addslashes(htmlspecialchars($this->pi_getLL('choose_image'))) . '</div>\' +