}
            $tmpContent .= '<td align="right">' . mslib_fe::amount2Cents($total_price, 0) . '</td>';
            $total_amount = $total_amount + $total_price;
        }
    }
    if ($tmpContent != '') {
        $compiledWidget['content'] .= '<table width="100%" class="table table-striped table-bordered" cellspacing="0" cellpadding="0" border="0" >';
        $compiledWidget['content'] .= '<tr class="odd">';
        foreach ($dates as $key => $value) {
            $compiledWidget['content'] .= '<td align="right">' . ucfirst($key) . '</td>';
        }
        $compiledWidget['content'] .= '<td align="right" nowrap>' . htmlspecialchars($this->pi_getLL('total')) . '</td>';
        $compiledWidget['content'] .= '<td align="right" nowrap>' . htmlspecialchars($this->pi_getLL('average', 'Average')) . '</td>';
        $compiledWidget['content'] .= '</tr>';
        $compiledWidget['content'] .= '<tr class="even">';
        $compiledWidget['content'] .= $tmpContent;
        $tmpContent = '';
        $compiledWidget['content'] .= '<td align="right" nowrap>' . mslib_fe::amount2Cents($total_amount, 0) . '</td>';
        $compiledWidget['content'] .= '<td align="right" nowrap>' . mslib_fe::amount2Cents($total_amount / count($dates), 0) . '</td>';
        $compiledWidget['content'] .= '</tr>';
        if (!$tr_type or $tr_type == 'even') {
            $tr_type = 'odd';
        } else {
            $tr_type = 'even';
        }
        $compiledWidget['content'] .= '
		</table>';
    } else {
        $compiledWidget['content'] = '<p>' . $this->pi_getLL('admin_label_data_not_available') . '</p>';
    }
}
	<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);
    if ($current_product['tax_rate'] and $this->ms['MODULES']['SHOW_PRICES_WITH_AND_WITHOUT_VAT']) {
        $content .= '<div class="price_excluding_vat">' . $this->pi_getLL('excluding_vat') . ' ' . mslib_fe::amount2Cents($current_product['final_price']) . '</div>';
    }
    if ($current_product['products_price'] != $current_product['final_price']) {
        if (!$this->ms['MODULES']['DB_PRICES_INCLUDE_VAT'] and ($current_product['tax_rate'] and $this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT'])) {
            $old_price = $current_product['products_price'] * (1 + $current_product['tax_rate']);
        } else {
            $old_price = $current_product['products_price'];
        }
        $content .= '<div class="old_price">' . mslib_fe::amount2Cents($old_price) . '</div><div class="specials_price">' . mslib_fe::amount2Cents($final_price) . '</div>';
    } else {
        $content .= '<div class="price">' . mslib_fe::amount2Cents($final_price) . '</div>';
    }
    if ($this->ROOTADMIN_USER or $this->ADMIN_USER and $this->CATALOGADMIN_USER) {
        $content .= '<div class="admin_menu"><a href="' . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=edit_product&cid=' . $current_product['categories_id'] . '&pid=' . $current_product['products_id'] . '&action=edit_product', 1) . '" class="admin_menu_edit"><i class="fa fa-pencil"></i></a> <a href="' . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=delete_product&cid=' . $current_product['categories_id'] . '&pid=' . $current_product['products_id'] . '&action=delete_product', 1) . '" class="admin_menu_remove" title="Remove"><i class="fa fa-trash-o"></i></a></div>';
    }
    $content .= '</li>';
}
$content .= '</ul>';
$skippedTypes = array();
$skippedTypes[] = 'products_modified';
$skippedTypes[] = 'products_search';
$skippedTypes[] = 'products_specials';
$skippedTypes[] = 'products_news';
if (!in_array($this->ms['page'], $skippedTypes) and ($this->ROOTADMIN_USER or $this->ADMIN_USER and $this->CATALOGADMIN_USER)) {
    $content .= '
	<script>
            $data['available_shippingcost_method_box'][$sids] = mslib_fe::currency() . ' +' . mslib_fe::amount2Cents($priceArray['shipping_costs_method_box_including_vat'], 0, 0);
        } else {
            if ($priceArray['shipping_costs_including_vat'] < 0) {
                $data['available_shippingcost'][$sids] = mslib_fe::currency() . ' -' . mslib_fe::amount2Cents($priceArray['shipping_costs_including_vat'], 0, 0);
                $data['available_shippingcost_method_box'][$sids] = mslib_fe::currency() . ' -' . mslib_fe::amount2Cents($priceArray['shipping_costs_method_box_including_vat'], 0, 0);
            }
        }
    } else {
        $data['available_shippingcost'][$sids] = '';
        if ($priceArray['shipping_costs'] > 0 || $this->ms['MODULES']['ALWAYS_DISPLAY_SHIPPING_COSTS'] > 0) {
            $data['available_shippingcost'][$sids] = mslib_fe::currency() . ' +' . mslib_fe::amount2Cents($priceArray['shipping_costs'], 0, 0);
            $data['available_shippingcost_method_box'][$sids] = mslib_fe::currency() . ' +' . mslib_fe::amount2Cents($priceArray['shipping_costs_method_box'], 0, 0);
        } else {
            if ($priceArray['shipping_costs'] < 0) {
                $data['available_shippingcost'][$sids] = mslib_fe::currency() . ' -' . mslib_fe::amount2Cents($priceArray['shipping_costs'], 0, 0);
                $data['available_shippingcost_method_box'][$sids] = mslib_fe::currency() . ' -' . mslib_fe::amount2Cents($priceArray['shipping_costs_method_box'], 0, 0);
            }
        }
    }
}
// we display the shipping costs and payment costs including vat
if ($this->ms['MODULES']['PRODUCT_EDIT_METHOD_FILTER'] && !$this->post['tx_multishop_pi1']['sid']) {
    if (count($available_sid) == 1) {
        $this->post['tx_multishop_pi1']['sid'] = $available_sid[0];
    } else {
        // set to unreachable number for shipping method id so the session for shipping method are cleared
        $this->post['tx_multishop_pi1']['sid'] = 999999;
    }
}
$data['shipping_preselected_id'] = $this->post['tx_multishop_pi1']['sid'];
$this->post['caller_segment'] = 'getHtmlCartContents';
Beispiel #4
0
     // normal
     $final_price = mslib_fe::final_products_price($product);
     $item_products_specials_price = '';
     if ($product['tax_rate'] and $this->ms['MODULES']['SHOW_PRICES_WITH_AND_WITHOUT_VAT']) {
         $item_products_specials_price = '<div class="price_excluding_vat">' . $this->pi_getLL('excluding_vat') . ' ' . mslib_fe::amount2Cents($product['final_price']) . '</div>';
     }
     $item_products_price = '';
     if ($product['products_price'] != $product['final_price']) {
         if ($product['tax_rate'] and $this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
             $old_price = $product['products_price'] * (1 + $product['tax_rate']);
         } else {
             $old_price = $product['products_price'];
         }
         $item_products_price = '<div class="old_price">' . mslib_fe::amount2Cents($old_price) . '</div><div class="final_price">' . mslib_fe::amount2Cents($final_price) . '</div>';
     } else {
         $item_products_price = '<div class="final_price">' . mslib_fe::amount2Cents($final_price) . '</div>';
     }
     $admin_menu = '';
     if ($this->ADMIN_USER) {
         $admin_menu = '<div class="admin_menu"><a href="' . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=edit_product&pid=' . $product['products_id'] . '&action=edit_product', 1) . '" class="admin_menu_edit"><i class="fa fa-pencil"></i></a><a href="' . mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=delete_product&pid=' . $product['products_id'] . '&action=delete_product', 1) . '" class="admin_menu_remove" title="Remove"><i class="fa fa-trash-o"></i></a></div>';
     }
     if (!strstr($product['products_url'], 'http://') and !strstr($product['products_url'], 'http://')) {
         $product['products_url'] = 'http://' . $product['products_url'];
     }
 }
 $markerArray = array();
 $markerArray['ITEM_PRODUCTS_ID'] = $product['products_id'];
 $markerArray['ITEM_PRODUCT_DETAILS_PAGE_LINK'] = $link;
 $markerArray['ITEM_PRODUCTS_NAME'] = htmlspecialchars($product['products_name']);
 $markerArray['ITEM_PRODUCTS_IMAGE'] = $image;
 $markerArray['ITEM_PRODUCTS_SPECIAL_PRICE'] = $item_products_specials_price;
    $compiledWidget['content'] .= '<td align="right">' . mslib_fe::amount2Cents($total_price, 0) . '</td>';
    $total_amount = $total_amount + $total_price;
    if (date("Y", $start_time) == date("Y")) {
        $total_amount_cumulative = $total_amount_cumulative + $total_price;
    }
}
if ($this->cookie['stats_year_sb'] == date("Y") || !$this->cookie['stats_year_sb']) {
    $month = date("m");
    $currentDay = date("d");
    $dayOfTheYear = date("z");
    $currentYear = 1;
    if ($month == 1) {
        $currentMonth = 1;
    }
} else {
    $month = 12;
    $dayOfTheYear = 365;
    $currentDay = 31;
    $currentYear = 0;
    $currentMonth = 0;
}
$compiledWidget['content'] .= '<td align="right" nowrap>' . mslib_fe::amount2Cents($total_amount, 0) . '</td>';
$compiledWidget['content'] .= '<td align="right" nowrap>' . mslib_fe::amount2Cents($total_amount_cumulative / $dayOfTheYear * 365, 0) . '</td>';
$compiledWidget['content'] .= '</tr>';
if (!$tr_type or $tr_type == 'even') {
    $tr_type = 'odd';
} else {
    $tr_type = 'even';
}
$compiledWidget['content'] .= '
</table>';
        // 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;
    $data[] = $prod;
}
if (isset($this->get['page'])) {
    if ($totpage > 1) {
        //echo $totpage;
        if ($pages != $totpage) {
            $prod = array();
            $prod['Name'] = $this->pi_getLL('more_results');
            $prod['Title'] = '<span id="more-results">' . htmlspecialchars($this->pi_getLL('more_results')) . ' >></span>';
            $prod['Link'] = mslib_fe::typolink($this->shop_pid, 'tx_multishop_pi1[page_section]=products_search&skeyword=' . urlencode($this->get['q']));
    function renderInterface($params, &$that)
    {
        mslib_fe::init($that);
        //hook to let other plugins further manipulate the method
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/class.tx_mslib_admin_interface.php']['renderInterfacePreProc'])) {
            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/class.tx_mslib_admin_interface.php']['renderInterfacePreProc'] as $funcRef) {
                \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
            }
        }
        // for pagination
        $this->get = $that->get;
        $this->post = $that->post;
        if ($this->post) {
            if ($params['postErno']) {
                if (count($params['postErno'])) {
                    $returnMarkup = '
                    <div style="display:none" id="msAdminPostMessage">
                    <table class="table table-striped table-bordered">
                    <thead>
                    <tr>
                        <th class="text-center">Status</th>
                        <th>Message</th>
                    </tr>
                    </thead>
                    <tbody>
                    ';
                    foreach ($params['postErno'] as $item) {
                        switch ($item['status']) {
                            case 'error':
                                $item['status'] = '<span class="fa-stack text-danger"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-thumbs-down fa-stack-1x fa-inverse"></i></span>';
                                break;
                            case 'info':
                                $item['status'] = '<span class="fa-stack"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-thumbs-up fa-stack-1x fa-inverse"></i></span>';
                                break;
                        }
                        $returnMarkup .= '<tr><td class="text-center">' . $item['status'] . '</td><td>' . $item['message'] . '</td></tr>' . "\n";
                    }
                    $returnMarkup .= '</tbody></table></div>';
                    $tableContent .= $returnMarkup;
                    $GLOBALS['TSFE']->additionalHeaderData[] = '<script type="text/javascript" data-ignore="1">
                    jQuery(document).ready(function ($) {
                        $.confirm({
                            title: \'\',
                            content: $(\'#msAdminPostMessage\').html()
                        });
                    });
                    </script>
                    ';
                }
            }
        }
        $updateCookie = 0;
        if ($that->get['Search'] and $that->get['limit'] != $that->cookie['limit']) {
            $that->cookie['limit'] = $that->get['limit'];
            $updateCookie = 1;
        }
        if ($that->get['Search'] and $that->get['display_all_records'] != $that->cookie['display_all_records']) {
            $that->cookie['display_all_records'] = $that->get['display_all_records'];
            $updateCookie = 1;
        }
        if ($updateCookie) {
            $GLOBALS['TSFE']->fe_user->setKey('ses', 'tx_multishop_cookie', $that->cookie);
            $GLOBALS['TSFE']->storeSessionData();
        }
        if ($that->cookie['display_all_records']) {
            $that->get['display_all_records'] = $that->cookie['display_all_records'];
        } else {
            $that->get['display_all_records'] = '';
        }
        if ($that->cookie['limit']) {
            $that->get['limit'] = $that->cookie['limit'];
        } else {
            $that->get['limit'] = 50;
        }
        $that->ms['MODULES']['PAGESET_LIMIT'] = $that->get['limit'];
        if ($params['settings']['limit'] && is_numeric($params['settings']['limit'])) {
            $that->ms['MODULES']['PAGESET_LIMIT'] = $params['settings']['limit'];
        }
        if (is_numeric($that->get['p'])) {
            $p = $that->get['p'];
        }
        $that->searchKeywords = array();
        if ($that->get['tx_multishop_pi1']['keyword']) {
            //  using $_REQUEST cause TYPO3 converts "Command & Conquer" to "Conquer" (the & sign sucks ass)
            $that->get['tx_multishop_pi1']['keyword'] = trim($that->get['tx_multishop_pi1']['keyword']);
            $that->get['tx_multishop_pi1']['keyword'] = $GLOBALS['TSFE']->csConvObj->utf8_encode($that->get['tx_multishop_pi1']['keyword'], $GLOBALS['TSFE']->metaCharset);
            $that->get['tx_multishop_pi1']['keyword'] = $GLOBALS['TSFE']->csConvObj->entities_to_utf8($that->get['tx_multishop_pi1']['keyword'], true);
            $that->get['tx_multishop_pi1']['keyword'] = mslib_fe::RemoveXSS($that->get['tx_multishop_pi1']['keyword']);
            $that->searchKeywords[] = $that->get['tx_multishop_pi1']['keyword'];
            $that->searchMode = '%keyword%';
        }
        $limit_search_result_selectbox = '<select name="limit" class="form-control">';
        $limits = array();
        $limits[] = '10';
        $limits[] = '15';
        $limits[] = '20';
        $limits[] = '25';
        $limits[] = '30';
        $limits[] = '40';
        $limits[] = '50';
        $limits[] = '100';
        $limits[] = '150';
        $limits[] = '200';
        $limits[] = '250';
        $limits[] = '300';
        $limits[] = '350';
        $limits[] = '400';
        $limits[] = '450';
        $limits[] = '500';
        $limits[] = '600';
        $limits[] = '700';
        $limits[] = '800';
        $limits[] = '900';
        $limits[] = '1000';
        $limits[] = '1500';
        $limits[] = '2000';
        $limits[] = '2500';
        $limits[] = '3000';
        $limits[] = '3500';
        foreach ($limits as $limit) {
            $limit_search_result_selectbox .= '<option value="' . $limit . '"' . ($limit == $that->get['limit'] ? ' selected="selected"' : '') . '>' . $limit . '</option>';
        }
        $limit_search_result_selectbox .= '</select>';
        $queryData = array();
        $queryData['where'] = array();
        if (count($that->searchKeywords)) {
            $keywordOr = array();
            $that->searchMode = '%keyword%';
            foreach ($that->searchKeywords as $searchKeyword) {
                if ($searchKeyword) {
                    switch ($that->searchMode) {
                        case 'keyword%':
                            $that->sqlKeyword = addslashes($searchKeyword) . '%';
                            break;
                        case '%keyword%':
                        default:
                            $that->sqlKeyword = '%' . addslashes($searchKeyword) . '%';
                            break;
                    }
                    if (is_array($params['query']['keywordSearchByColumns']) && count($params['query']['keywordSearchByColumns'])) {
                        foreach ($params['query']['keywordSearchByColumns'] as $col) {
                            $keywordOr[] = $col . " like '" . $that->sqlKeyword . "'";
                        }
                    }
                }
            }
            if (is_array($keywordOr) && count($keywordOr)) {
                $queryData['where'][] = "(" . implode(" OR ", $keywordOr) . ")";
            }
        }
        if ($params['query']['where']) {
            if (is_array($params['query']['where'])) {
                $queryData['where'] = array_merge(array_values($queryData['where']), array_values($params['query']['where']));
            } else {
                $queryData['where'][] = $params['query']['where'];
            }
        }
        switch ($that->get['tx_multishop_pi1']['order_by']) {
            default:
                if (is_array($params['query']['defaultOrderByColumns']) && count($params['query']['defaultOrderByColumns'])) {
                    $order_by = implode(',', $params['query']['defaultOrderByColumns']);
                }
                break;
        }
        switch ($that->get['tx_multishop_pi1']['order']) {
            case 'a':
                $order = 'asc';
                $order_link = 'd';
                break;
            case 'd':
                $order = 'desc';
                $order_link = 'a';
                break;
            default:
                if ($params['query']['defaultOrder'] == 'asc') {
                    $order = 'asc';
                    $order_link = 'd';
                } else {
                    $order = 'desc';
                    $order_link = 'a';
                }
                break;
        }
        $orderby[] = $order_by . ' ' . $order;
        if (is_array($params['query']['select'])) {
            $queryData['select'] = implode(',', $params['query']['select']);
        } else {
            $queryData['select'] = $params['query']['select'];
        }
        if (is_array($params['query']['from'])) {
            $queryData['from'] = implode(',', $params['query']['from']);
        } else {
            $queryData['from'] = $params['query']['from'];
        }
        if (is_array($params['query']['group_by'])) {
            $queryData['group_by'] = implode(',', $params['query']['group_by']);
        } elseif ($params['query']['group_by']) {
            $queryData['group_by'][] = $params['query']['group_by'];
        }
        if (is_array($params['query']['having'])) {
            $queryData['having'] = $params['query']['having'];
        } elseif ($params['query']['having']) {
            $queryData['having'][] = $params['query']['having'];
        }
        $queryData['order_by'] = $orderby;
        $queryData['limit'] = $that->ms['MODULES']['PAGESET_LIMIT'];
        if (is_numeric($that->get['p'])) {
            $p = $that->get['p'];
        }
        if ($p > 0) {
            $queryData['offset'] = $p * $that->ms['MODULES']['PAGESET_LIMIT'];
        } else {
            $p = 0;
            $queryData['offset'] = 0;
        }
        if ($params['msDebug']) {
            $this->msDebug = 1;
        }
        //$this->msDebug=1;
        //echo print_r($queryData);
        //die();
        $pageset = mslib_fe::getRecordsPageSet($queryData);
        if ($this->msDebug) {
            echo $this->msDebugInfo;
            die;
        }
        if ($params['returnResultsSet']) {
            return $pageset;
        }
        //echo print_r($queryData);
        //die();
        if (count($pageset['dataset'])) {
            $tr_type = 'even';
            if (!$params['settings']['disableForm']) {
                $tableContent .= '<form method="post" action="' . $params['postForm']['actionUrl'] . '" enctype="multipart/form-data">';
            }
            $tableContent .= '<div class="table-responsive">';
            $tableContent .= '<table class="table table-striped table-bordered" id="msAdminTableInterface">';
            $tableContent .= '<tr><thead>';
            if ($params['settings']['enableRowBasedCheckboxSelection']) {
                $headerData = '';
                $headerData .= '
				<script type="text/javascript">
					jQuery(document).ready(function($) {
						$(\'#check_all_1\').click(function(){
							$(\'td > div.checkbox > input:checkbox\').prop(\'checked\', this.checked);
						});
					});
				</script>';
                $GLOBALS['TSFE']->additionalHeaderData[] = $headerData;
                $headerData = '';
                $tableContent .= '
				<th class="cellCheckbox">
					<div class="checkbox checkbox-success checkbox-inline">
					<input type="checkbox" id="check_all_1">
					<label for="check_all_1"></label>
					</div>
				</th>';
            }
            foreach ($params['tableColumns'] as $col => $valArray) {
                $tdClass = array();
                if ($valArray['align']) {
                    $tdClass[] = 'text-' . $valArray['align'];
                }
                if ($valArray['nowrap']) {
                    $tdClass[] = 'cellNoWrap';
                }
                if ($valArray['class']) {
                    $tdClass[] = $valArray['class'];
                }
                $tableContent .= '<th' . (count($tdClass) ? ' class="' . implode(' ', $tdClass) . '"' : '') . '>' . $valArray['title'] . '</th>';
            }
            $tableContent .= '</thead></tr><tbody>';
            $summarize = array();
            $recordCounter = 0;
            foreach ($pageset['dataset'] as $rowKey => $row) {
                $recordCounter++;
                if (!$tr_type or $tr_type == 'even') {
                    $tr_type = 'odd';
                } else {
                    $tr_type = 'even';
                }
                $tableContent .= '<tr class="' . $tr_type . '">';
                if ($params['settings']['enableRowBasedCheckboxSelection'] && $params['settings']['rowBasedCheckboxSelectionKey']) {
                    $headerData = '';
                    $headerData .= '
					<script type="text/javascript">
						jQuery(document).ready(function($) {
							$(\'#check_all_1\').click(function(){
								$(\'td > div.checkbox > input:checkbox\').prop(\'checked\', this.checked);
							});
						});
					</script>';
                    $GLOBALS['TSFE']->additionalHeaderData[] = $headerData;
                    $headerData = '';
                    $tableContent .= '<td class="cellCheckbox">
						<div class="checkbox checkbox-success checkbox-inline">
							<input type="checkbox" name="tx_multishop_pi1[tableOverviewSelection][]" id="tableOverviewSelectionCheckbox_' . $row[$params['settings']['rowBasedCheckboxSelectionKey']] . '" value="' . htmlspecialchars($row[$params['settings']['rowBasedCheckboxSelectionKey']]) . '">
							<label for="tableOverviewSelectionCheckbox_' . $row[$params['settings']['rowBasedCheckboxSelectionKey']] . '"></label>
						</div>
					</td>';
                }
                foreach ($params['tableColumns'] as $col => $valArray) {
                    $originalValue = $row[$col];
                    switch ($valArray['valueType']) {
                        case 'number_format_2_decimals':
                            $row[$col] = round(number_format($row[$col], 2, '.', ''), 2);
                            $summarize[$col] += $row[$col];
                            break;
                        case 'number_format_thousand_seperator':
                            $row[$col] = round(number_format($row[$col], 2, '.', ''), 2);
                            break;
                        case 'recordCounter':
                            $row[$col] = $recordCounter;
                            break;
                        case 'download_invoice':
                            $row[$col] = '<a href="uploads/tx_multishopexactonline/' . $row[$col] . '" target="_blank">' . $row[$col] . '</a>';
                            break;
                        case 'currency':
                            $summarize[$col] += $row[$col];
                            $row[$col] = mslib_fe::amount2Cents($row[$col], 0);
                            break;
                        case 'domain_name':
                            if ($row[$col]) {
                                $row[$col] = '<a href="http://' . $row[$col] . '" target="_blank">' . $row[$col] . '</a>';
                            }
                            break;
                        case 'datetime':
                            if ($row[$col]) {
                                $row[$col] = strftime("%x %X", strtotime($row[$col]));
                            } else {
                                $row[$col] = '';
                            }
                            break;
                        case 'timestamp':
                            if (is_numeric($row[$col]) && $row[$col] > 0) {
                                $row[$col] = strftime("%x %X", $row[$col]);
                            } else {
                                $row[$col] = '';
                            }
                            break;
                        case 'timestamp_to_day_date_time':
                            if (is_numeric($row[$col]) && $row[$col] > 0) {
                                $row[$col] = strftime("%a. %x<br/>%X", $row[$col]);
                            } else {
                                $row[$col] = '';
                            }
                            break;
                        case 'timestamp_to_date':
                            if (is_numeric($row[$col]) && $row[$col] > 0) {
                                $row[$col] = strftime("%x", $row[$col]);
                            } else {
                                $row[$col] = '';
                            }
                            break;
                        case 'form':
                            $content = '<form method="';
                            switch ($valArray['formAction']) {
                                case 'post':
                                    $content .= 'POST';
                                    break;
                                case 'get':
                                default:
                                    $content .= 'GET';
                                    break;
                            }
                            $content .= '" action="' . $valArray['actionUrl'] . '" enctype="multipart/form-data">';
                            if ($valArray['content']) {
                                $content .= $valArray['content'];
                            }
                            if (is_array($valArray['hiddenFields'])) {
                                foreach ($valArray['hiddenFields'] as $hiddenFieldKey => $hiddenFieldVal) {
                                    foreach ($row as $tmpCol => $tmpVal) {
                                        $hiddenFieldVal = str_replace('###' . $tmpCol . '###', $row[$tmpCol], $hiddenFieldVal);
                                    }
                                    $content .= '<input name="' . $hiddenFieldKey . '" type="hidden" value="' . $hiddenFieldVal . '" />';
                                }
                            }
                            $content .= '</form>';
                            $row[$col] = $content;
                            break;
                        case 'content':
                            foreach ($row as $tmpCol => $tmpVal) {
                                $valArray['content'] = str_replace('###' . $tmpCol . '###', $row[$tmpCol], $valArray['content']);
                            }
                            $row[$col] = $valArray['content'];
                            break;
                        case 'products_detail_page_link':
                            $where = '';
                            if ($row['categories_id']) {
                                // get all cats to generate multilevel fake url
                                $level = 0;
                                $cats = mslib_fe::Crumbar($row['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
                            }
                            $product_detail_link = mslib_fe::typolink($this->conf['products_detail_page_pid'], '&' . $where . '&products_id=' . $row['products_id'] . '&tx_multishop_pi1[page_section]=products_detail', 1);
                            $row[$col] = '<a href="' . $product_detail_link . '" target="_blank">' . htmlspecialchars($row['products_name']) . '</a>';
                            break;
                        case 'boolean':
                            $status_html = '';
                            if (!$row[$col]) {
                                $status_html .= '<span class="admin_status_red" alt="' . $this->pi_getLL('no') . '"></span>';
                            } else {
                                $status_html .= '<span class="admin_status_green" alt="' . $this->pi_getLL('yes') . '"></span>';
                            }
                            $row[$col] = $status_html;
                            break;
                        case 'booleanToggle':
                            $status_html = '';
                            if (!$row[$col]) {
                                $status_html .= '<span class="admin_status_red" alt="' . $this->pi_getLL('disable') . '"></span>';
                                if ($valArray['hrefEnable']) {
                                    foreach ($row as $tmpCol => $tmpVal) {
                                        $valArray['hrefEnable'] = str_replace('###' . $tmpCol . '###', $row[$tmpCol], $valArray['hrefEnable']);
                                    }
                                    $status_html .= '<a href="' . $valArray['hrefEnable'] . '"><span class="admin_status_green disabled" alt="' . $this->pi_getLL('enabled') . '"></span></a>';
                                }
                            } else {
                                if ($valArray['hrefDisable']) {
                                    foreach ($row as $tmpCol => $tmpVal) {
                                        $valArray['hrefDisable'] = str_replace('###' . $tmpCol . '###', $row[$tmpCol], $valArray['hrefDisable']);
                                    }
                                    $status_html .= '<a href="' . $valArray['hrefDisable'] . '"><span class="admin_status_red disabled" alt="' . $this->pi_getLL('disabled') . '"></span></a>';
                                }
                                $status_html .= '<span class="admin_status_green" alt="' . $this->pi_getLL('enable') . '"></span>';
                            }
                            $row[$col] = $status_html;
                            break;
                    }
                    $adjustedValue = $row[$col];
                    if ($valArray['href']) {
                        foreach ($row as $tmpCol => $tmpVal) {
                            $valArray['href'] = str_replace('###' . $tmpCol . '###', $row[$tmpCol], $valArray['href']);
                        }
                        $adjustedValue = '<a ' . ($valArray['hrefNoFollow'] ? ' rel="nofollow"' : '') . ' href="' . $valArray['href'] . '"' . ($valArray['href_target'] ? ' target="' . $valArray['href_target'] . '""' : '') . '>' . $adjustedValue . '</a>';
                    }
                    if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_admin_interface.php']['tableColumnsPreProc'])) {
                        $conf = array('col' => &$col, 'row' => &$row, 'originalValue' => &$originalValue, 'adjustedValue' => &$adjustedValue, 'params' => &$params, 'valArray' => &$valArray, 'summarize' => &$summarize);
                        foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.tx_mslib_admin_interface.php']['tableColumnsPreProc'] as $funcRef) {
                            \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $conf, $that);
                        }
                    }
                    $tdClass = array();
                    if ($valArray['align']) {
                        $tdClass[] = 'text-' . $valArray['align'];
                    }
                    if ($valArray['nowrap']) {
                        $tdClass[] = 'cellNoWrap';
                    }
                    if ($valArray['class']) {
                        $tdClass[] = $valArray['class'];
                    }
                    $tableContent .= '<td' . (count($tdClass) ? ' class="' . implode(' ', $tdClass) . '"' : '') . '>' . $adjustedValue . '</td>';
                }
                $tableContent .= '</tr>';
                if ($params['settings']['returnResultSetAsArray']) {
                    $pageset['dataset'][$rowKey] = $row;
                }
            }
            $tableContent .= '</tbody>';
            if (!$params['settings']['skipSummarize']) {
                // Summarize footer
                $tableContent .= '<tfoot><tr>';
                if ($params['settings']['enableRowBasedCheckboxSelection']) {
                    $tableContent .= '<th></th>';
                }
                foreach ($params['tableColumns'] as $col => $valArray) {
                    switch ($valArray['valueType']) {
                        case 'currency':
                            $row[$col] = mslib_fe::amount2Cents($summarize[$col], 0);
                            break;
                        case 'number_format_2_decimals':
                            $row[$col] = round(number_format($summarize[$col], 2, ',', '.'), 2);
                            break;
                        default:
                            $row[$col] = $valArray['title'];
                            break;
                    }
                    $tdClass = array();
                    if ($valArray['align']) {
                        $tdClass[] = 'text-' . $valArray['align'];
                    }
                    if ($valArray['nowrap']) {
                        $tdClass[] = 'cellNoWrap';
                    }
                    if ($valArray['class']) {
                        $tdClass[] = $valArray['class'];
                    }
                    $tableContent .= '<th' . (count($tdClass) ? ' class="' . implode(' ', $tdClass) . '"' : '') . '>' . $row[$col] . '</th>';
                    // $tableContent.='<th'.($valArray['align'] ? ' class="text-'.$valArray['align'].'"' : '').($valArray['nowrap'] ? ' nowrap' : '').'>'.$row[$col].'</th>';
                }
                $tableContent .= '</tr></tfoot>';
            }
            $tableContent .= '</table>';
            if ($params['settings']['enableActionSelectionForm'] && is_array($params['settings']['tableSelectionActions']) && count($params['settings']['tableSelectionActions'])) {
                $actions = $params['settings']['tableSelectionActions'];
                if (count($actions)) {
                    // custom page hook that can be controlled by third-party plugin eof
                    $action_selectbox .= '<select name="tx_multishop_pi1[action]" id="msAdminTableAction" class="form-control"><option value="">' . htmlspecialchars($this->pi_getLL('choose_action')) . '</option>';
                    foreach ($actions as $key => $value) {
                        $action_selectbox .= '<option value="' . htmlspecialchars($key) . '">' . htmlspecialchars($value) . '</option>';
                    }
                    $action_selectbox .= '</select>';
                    $tableContent .= $action_selectbox;
                }
            }
            if ($params['settings']['contentBelowTable']) {
                $tableContent .= $params['settings']['contentBelowTable'];
            }
            if ($params['settings']['enableActionSelectionForm'] && is_array($params['settings']['tableSelectionActions']) && count($params['settings']['tableSelectionActions'])) {
                $tableContent .= '<div class="form-group">
                    <input class="btn btn-success" type="submit" name="submit" value="' . htmlspecialchars($this->pi_getLL('submit_form')) . '" />
                </div>';
            }
            $tableContent .= '
			</div>
			';
            if (!$params['settings']['disableForm']) {
                $tableContent .= '</form>';
            }
            // pagination
            $paginationMarkup = '';
            if (!$params['settings']['skipPaginationMarkup'] and $pageset['total_rows'] > $that->ms['MODULES']['PAGESET_LIMIT']) {
                $total_pages = ceil($pageset['total_rows'] / $that->ms['MODULES']['PAGESET_LIMIT']);
                require \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('multishop') . 'scripts/admin_pages/includes/admin_pagination.php';
                $paginationMarkup = $tmp;
                $tableContent .= $tmp;
                $tmp = '';
            }
            // pagination eof
        }
        $content = '';
        $content .= '<div class="panel panel-default">';
        $content .= '<div class="panel-heading">';
        if ($params['interfaceTitle']) {
            $interfaceTitle = $params['interfaceTitle'];
        } else {
            $interfaceTitle = $params['title'];
        }
        $content .= '<h3>' . htmlspecialchars($interfaceTitle) . '</h3>';
        if (is_array($params['settings']['headingButtons'])) {
            $content .= '<div class="form-inline">';
            foreach ($params['settings']['headingButtons'] as $headingButton) {
                $content .= '<a href="' . $headingButton['href'] . '" class="' . $headingButton['btn_class'] . '"' . ($headingButton['attributes'] ? ' ' . $headingButton['attributes'] : '') . '><i class="' . $headingButton['fa_class'] . '"></i> ' . htmlspecialchars($headingButton['title']) . '</a> ';
            }
            $content .= '</div>';
        }
        $content .= '</div>';
        $content .= '<div class="panel-body">';
        if (!$params['settings']['skipTabMarkup']) {
            $GLOBALS['TSFE']->additionalHeaderData['msAdminTabJs'] = '<script type="text/javascript">
			jQuery(document).ready(function ($) {
				$(\'.nav-tabs a:first\').tab(\'show\');
			});
			</script>
			';
            $content .= '
				<div id="tab-container">
				<ul class="nav nav-tabs" id="admin_orders" role="tablist">
					<li role="presentation"><a href="#CmsListing" aria-controls="profile" role="tab" data-toggle="tab">' . htmlspecialchars($params['title']) . '</a></li>
				</ul>
				<div class="tab-content">
			';
        }
        $searchForm = '';
        if ($params['settings']['enableKeywordSearch']) {
            $searchForm = '
			<form id="form1" name="form1" method="get" action="index.php">
				<div class="well">
					<div class="row formfield-container-wrapper">
						';
            foreach ($params['searchForm']['hiddenFields'] as $key => $val) {
                $searchForm .= '<input name="' . $key . '" type="hidden" value="' . htmlspecialchars($val) . '" />' . "\n";
            }
            $searchForm .= '
						<div class="col-sm-8 formfield-wrapper">
							<div class="form-inline">
								<label class="control-label">' . $that->pi_getLL('keyword') . '</label>
								<input type="text" name="tx_multishop_pi1[keyword]" class="form-control" value="' . htmlspecialchars($that->get['tx_multishop_pi1']['keyword']) . '" />
								<input type="submit" name="Search" class="btn btn-success" value="' . $that->pi_getLL('search') . '" />
							</div>
						</div>
						<div class="col-sm-4 formfield-wrapper">
							<div class="pull-right form-inline">
								<label class="control-label">' . $that->pi_getLL('limit_number_of_records_to') . '</label>
								' . $limit_search_result_selectbox . '
							</div>
						</div>
					</div>
				</div>
			</form>
			';
            //hook to let other plugins further manipulate the method
            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/class.tx_mslib_admin_interface.php']['setAdminInterfaceSearchFormPostProc'])) {
                $interfaceKey =& $this->interfaceKey;
                $params_searchform = array('interfaceKey' => &$interfaceKey, 'searchForm' => &$searchForm, 'adminInterfaceParams' => &$params);
                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/class.tx_mslib_admin_interface.php']['setAdminInterfaceSearchFormPostProc'] as $funcRef) {
                    \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params_searchform, $this);
                }
            }
        }
        if (!$params['settings']['skipTabMarkup']) {
            $content .= '
				<div role="tabpanel" id="CmsListing" class="tab-pane">
					' . $searchForm . '
					' . $tableContent . '
				</div>
			</div>
			</div>
			';
        } else {
            $content .= $searchForm . $tableContent;
        }
        if ($params['settings']['skipRecordCount'] || $params['settings']['skipRecordCountWhenZeroResults'] && !$pageset['total_rows']) {
            $skipRecordCount = 1;
        }
        if ($params['settings']['skipTotalCount'] || $params['settings']['skipTotalCountWhenZeroResults'] && !$params['summarizeData']['totalRecordsInTable']) {
            $skipTotalCount = 1;
        }
        if (!$skipRecordCount) {
            $content .= '<p class="text-center">' . $this->pi_getLL('found_records') . ': <strong>' . number_format($pageset['total_rows'], 0, '', '.') . '</strong></p>';
        }
        if (!$skipTotalCount && isset($params['summarizeData']['totalRecordsInTable'])) {
            $content .= '<p class="text-center">' . $this->pi_getLL('total_records_in_database') . ': <strong>' . number_format($params['summarizeData']['totalRecordsInTable'], 0, '', '.') . '</strong></p>';
        }
        if (!$params['settings']['skipFooterMarkup']) {
            $content .= '<hr><div class="clearfix"><a class="btn btn-success msAdminBackToCatalog" href="' . mslib_fe::typolink() . '"><span class="fa-stack"><i class="fa fa-circle fa-stack-2x"></i><i class="fa fa-arrow-left fa-stack-1x"></i></span> ' . $that->pi_getLL('admin_close_and_go_back_to_catalog') . '</a></div>';
        }
        $content .= '</div>';
        $content .= '</div>';
        if ($params['settings']['returnOnlyWhenRecordsFound'] && !$pageset['total_rows']) {
            //return;
        } else {
            if ($params['settings']['returnResultSetAsArray']) {
                $array = array();
                $array['searchForm'] = $searchForm;
                $array['paginationMarkup'] = $paginationMarkup;
                $array['dataset'] = $pageset['dataset'];
                return $array;
            } else {
                return $content;
            }
        }
    }
Beispiel #8
0
 $array1[] = '###ORDER_DATE_LONG###';
 // ie woensdag 23 juni, 2010
 $array2[] = $long_date;
 // backwards compatibility
 $array1[] = '###LONG_DATE###';
 // ie woensdag 23 juni, 2010
 $array2[] = $long_date;
 $time = time();
 $long_date = strftime($this->pi_getLL('full_date_format'), $time);
 $array1[] = '###CURRENT_DATE_LONG###';
 // ie woensdag 23 juni, 2010
 $array2[] = $long_date;
 $array1[] = '###STORE_NAME###';
 $array2[] = $this->ms['MODULES']['STORE_NAME'];
 $array1[] = '###TOTAL_AMOUNT###';
 $array2[] = mslib_fe::amount2Cents($tmpArray['total_amount']);
 $array1[] = '###ORDER_NUMBER###';
 $array2[] = $tmpArray['orders_id'];
 $array1[] = '###ORDER_LINK###';
 $array2[] = '';
 $array1[] = '###CUSTOMER_ID###';
 $array2[] = $tmpArray['customer_id'];
 $link = $this->FULL_HTTP_URL . mslib_fe::typolink($tmpArray['page_uid'], 'tx_multishop_pi1[page_section]=payment_reminder_checkout&tx_multishop_pi1[hash]=' . $hashcode);
 $array1[] = '###PAYMENT_PAGE_LINK###';
 $array2[] = $link;
 // psp email template
 $psp_mail_template = array();
 if ($tmpArray['payment_method']) {
     $psp_data = mslib_fe::loadPaymentMethod($tmpArray['payment_method']);
     $psp_vars = unserialize($psp_data['vars']);
     if (isset($psp_vars['order_payment_reminder'])) {
Beispiel #9
0
            $order_list_button_extra .= '<td align="center">';
            $order_list_button_extra .= implode("&nbsp;", $orderlist_buttons);
            $order_list_button_extra .= '</td>';
        }
        $ip_address = '';
        if ($order['ip_address']) {
            $ip_address = $order['ip_address'];
        }
        $http_referer = '';
        if ($order['http_referer']) {
            $domain = parse_url($order['http_referer']);
            if ($domain['host']) {
                $http_referer = '<a href="' . $order['http_referer'] . '" target="_blank" rel="noreferrer">' . $domain['host'] . '</a>';
            }
        }
        $data[] = array('<a href="' . mslib_fe::typolink($this->shop_pid . ',2003', '&tx_multishop_pi1[page_section]=edit_order&orders_id=' . $order['orders_id'] . '&action=edit_order', 1) . '" title="Loading" class="popover-link" rel="' . $order['orders_id'] . '">' . $order['orders_id'] . '</a>', mslib_fe::amount2Cents($order['grand_total'], 0), strftime("%a. %x %X", $order['crdate']), $paid_status, '<span title="' . htmlspecialchars($order['payment_method_label']) . '">' . $order['payment_method_label'] . '</span>');
    }
    $counter = 0;
    $compiledWidget['content'] .= '<div id="tblWidgetOrdersLatest-wrapper"><table width="100%" class="table table-striped table-bordered" cellspacing="0" cellpadding="0" border="0" id="tblWidgetOrdersLatest">';
    $tr_type = '';
    $rowCounter = 0;
    foreach ($data as $host => $item) {
        $counter++;
        if ($counter == 1) {
            $compiledWidget['content'] .= '<tr class="tblHeader">';
            $colCounter = 0;
            foreach ($item as $col) {
                $colCounter++;
                $compiledWidget['content'] .= '
					<th class="tblHeadCol' . $colCounter . '" nowrap>' . $col . '</th>
				';
        }
    }
}
$data['old_price_format'] = '';
$data['old_price'] = 0;
$data['price_format'] = '';
$data['price'] = 0;
$data['price_format_excl_vat'] = '';
$data['price_excl_vat'] = 0;
$data['qty_correction'] = 0;
if ($price > 0) {
    if ($price != $original_price && $original_price > 0) {
        $data['old_price_format'] = mslib_fe::amount2Cents($original_price, 1);
        $data['old_price'] = $original_price;
    }
    $data['price_format'] = mslib_fe::amount2Cents($price, 1);
    $data['price'] = $price;
    $data['price_format_excl_vat'] = mslib_fe::amount2Cents($exclude_vat_price, 1) . ' ' . lcfirst($this->pi_getLL('excluding_vat'));
    $data['price_excl_vat'] = $exclude_vat_price;
    $data['qty_correction'] = $qty_decimal_correction;
}
// hook to let other plugins further manipulate the option values display
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/ajax_pages/get_staffel_price.php']['getPricePostProc'])) {
    $params = array('product_id' => $products_id, 'data' => &$data);
    foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/ajax_pages/get_staffel_price.php']['getPricePostProc'] as $funcRef) {
        \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
    }
}
// hook
echo json_encode($data, ENT_NOQUOTES);
exit;
Beispiel #11
0
 public function Money2Cents($amount, $customer_currency = 1)
 {
     return mslib_fe::amount2Cents($amount, $customer_currency);
 }
 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;
 }
Beispiel #13
0
                $tmp .= '<th class="cell_order_status">' . $this->pi_getLL('status') . '</th>';
                if ($this->ms['MODULES']['ENABLE_REORDER_FEATURE_IN_ACCOUNT_ORDER_HISTORY']) {
                    $tmp .= '<th class="cell_action">&nbsp;</th>';
                }
                $tmp .= '</tr></thead><tbody>';
                $tr_type = 'even';
                foreach ($tmporders as $order) {
                    if (!$tr_type or $tr_type == 'even') {
                        $tr_type = 'odd';
                    } else {
                        $tr_type = 'even';
                    }
                    $tmp .= '<tr class="' . $tr_type . '">';
                    $tmp .= '<td align="right" nowrap class="cell_orders_id">
					<a href="' . mslib_fe::typolink('', 'tx_multishop_pi1[page_section]=order_details&tx_multishop_pi1[orders_id]=' . $order['orders_id']) . '">' . $order['orders_id'] . '</a></td>';
                    $tmp .= '<td align="right" nowrap class="cell_amount">' . mslib_fe::amount2Cents(mslib_fe::getOrderTotalPrice($order['orders_id'])) . '</td>';
                    $tmp .= '<td align="center" nowrap class="cell_date">' . strftime("%x", $order['crdate']) . '</td>';
                    if ($this->ms['MODULES']['ADMIN_INVOICE_MODULE']) {
                        $tmp .= '<td align="center" nowrap class="cell_invoice">
						';
                        $invoice = mslib_fe::getInvoice($order['orders_id'], 'orders_id');
                        if ($invoice['id']) {
                            $tmp .= '<a href="' . $this->FULL_HTTP_URL . mslib_fe::typolink($this->shop_pid . ',2002', 'tx_multishop_pi1[page_section]=download_invoice&tx_multishop_pi1[hash]=' . $invoice['hash']) . '" target="_blank" class="msfront_download_invoice" title="download invoice">' . $this->pi_getLL('download') . '</a>';
                        }
                        $tmp .= '
						</td>';
                    }
                    //		$tmp.='<td align="left" nowrap>'.$order['shipping_method_label'].'</td>';
                    //		$tmp.='<td align="left" nowrap>'.$order['payment_method_label'].'</td>';
                    $tmp .= '<td align="left" nowrap class="cell_order_status">' . $order['orders_status'] . '</td>';
                    if ($this->ms['MODULES']['ENABLE_REORDER_FEATURE_IN_ACCOUNT_ORDER_HISTORY']) {
     foreach ($userGroupUids as $userGroupUid) {
         $usergroup = mslib_fe::getUserGroup($userGroupUid);
         if (is_array($usergroup) && $usergroup['title']) {
             $userGroupMarkupArray[] = '<span class="badge">' . htmlspecialchars($usergroup['title']) . '</span>';
         }
     }
 }
 $markerArray['CUSTOMERS_GROUP'] = '';
 if (count($userGroupMarkupArray)) {
     $markerArray['CUSTOMERS_GROUP'] = '<br/>' . implode(' ', $userGroupMarkupArray);
 }
 $markerArray['CUSTOMERS_CREATED'] = $customer['crdate'];
 $markerArray['CUSTOMERS_LATEST_LOGIN'] = $customer['lastlogin'];
 $markerArray['CUSTOMERS_LATEST_ORDER'] = $latest_order;
 $markerArray['CUSTOMERS_TURN_OVER'] = mslib_fe::amount2Cents($customer['grand_total'], 0);
 $markerArray['CUSTOMERS_TURN_OVER_THIS_YEAR'] = mslib_fe::amount2Cents($customer['grand_total_this_year'], 0);
 $markerArray['CUSTOMERS_LOGINAS_LINK'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_customers&login_as_customer=1&customer_id=' . $customer['uid']);
 $markerArray['CUSTOMERS_LOGINAS'] = htmlspecialchars($this->pi_getLL('login'));
 $markerArray['CUSTOMERS_STATUS'] = $status_html;
 $markerArray['CUSTOMERS_DELETE_LINK'] = mslib_fe::typolink($this->shop_pid . ',2003', '&tx_multishop_pi1[page_section]=' . $this->ms['page'] . '&customer_id=' . $customer['uid'] . '&delete=1&' . mslib_fe::tep_get_all_get_params(array('customer_id', 'delete', 'disable', 'clearcache')));
 $markerArray['CUSTOMERS_ONCLICK_DELETE_CONFIRM_JS'] = 'return confirm(\'' . htmlspecialchars($this->pi_getLL('are_you_sure')) . '?\')';
 $markerArray['ADMIN_LABEL_ALT_REMOVE'] = ucfirst($this->pi_getLL('admin_label_alt_remove'));
 $markerArray['MASTER_SHOP'] = $master_shop_col;
 $markerArray['CUSTOM_MARKER_0_BODY'] = '';
 $markerArray['CUSTOM_MARKER_1_BODY'] = '';
 // custom page hook that can be controlled by third-party plugin
 if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/includes/admin_customers_listing.php']['adminCustomersListingTmplIteratorPreProc'])) {
     $params = array('markerArray' => &$markerArray, 'customer' => &$customer);
     foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/includes/admin_customers_listing.php']['adminCustomersListingTmplIteratorPreProc'] as $funcRef) {
         \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
     }
    if ($month == 1) {
        $currentMonth = 1;
    }
} else {
    $month = 12;
    $dayOfTheYear = 365;
    $currentDay = 31;
    $currentYear = 0;
    $currentMonth = 0;
}
if ($total_amount_avg > 0 && $total_orders_avg > 0) {
    $totalSum = $total_amount_avg / $total_orders_avg;
} else {
    $totalSum = 0;
}
$content .= '<td align="right" nowrap>' . mslib_fe::amount2Cents($totalSum, 0) . '</td>';
$content .= '</tr>';
if (!$tr_type or $tr_type == 'even') {
    $tr_type = 'odd';
} else {
    $tr_type = 'even';
}
$content .= '
</tbody></table>';
// LAST MONTHS EOF
/*
$tr_type='even';
$dates=array();
$content.='<h3>'.htmlspecialchars($this->pi_getLL('sales_volume_by_day')).'</h3>';
if ($currentMonth) {
	$endDay=date("d");
 $array1[] = '###ORDER_DATE_LONG###';
 // ie woensdag 23 juni, 2010
 $array2[] = $long_date;
 // backwards compatibility
 $array1[] = '###LONG_DATE###';
 // ie woensdag 23 juni, 2010
 $array2[] = $long_date;
 $time = time();
 $long_date = strftime($this->pi_getLL('full_date_format'), $time);
 $array1[] = '###CURRENT_DATE_LONG###';
 // ie woensdag 23 juni, 2010
 $array2[] = $long_date;
 $array1[] = '###STORE_NAME###';
 $array2[] = $this->ms['MODULES']['STORE_NAME'];
 $array1[] = '###TOTAL_AMOUNT###';
 $array2[] = mslib_fe::amount2Cents($order['total_amount']);
 $array1[] = '###PROPOSAL_NUMBER###';
 $array2[] = $order['orders_id'];
 $array1[] = '###ORDER_NUMBER###';
 $array2[] = $order['orders_id'];
 $array1[] = '###ORDER_LINK###';
 $array2[] = '';
 $array1[] = '###ORDER_STATUS###';
 $array2[] = $order['orders_status'];
 $array1[] = '###TRACK_AND_TRACE_CODE###';
 $array2[] = $order['track_and_trace_code'];
 $array1[] = '###BILLING_BUILDING###';
 $array2[] = $order['billing_building'];
 $array1[] = '###BILLING_ADDRESS###';
 $array2[] = $billing_address;
 $array1[] = '###DELIVERY_BUILDING###';
     if (count($links)) {
         $markerArray['INVOICE_NUMBER'] .= implode('<br/>', $links);
     }
     $markerArray['INVOICE_NUMBER'] .= '</td>';
 }
 if (isset($this->get['tx_multishop_pi1']['is_proposal'])) {
     $markerArray['ORDER_EDIT_URL'] = mslib_fe::typolink($this->shop_pid . ',2003', '&tx_multishop_pi1[page_section]=edit_order&orders_id=' . $order['orders_id'] . '&action=edit_order&tx_multishop_pi1[is_proposal]=1');
 } else {
     $markerArray['ORDER_EDIT_URL'] = mslib_fe::typolink($this->shop_pid . ',2003', '&tx_multishop_pi1[page_section]=edit_order&orders_id=' . $order['orders_id'] . '&action=edit_order');
 }
 $markerArray['EDIT_ORDER_POPUP_WIDTH'] = $edit_order_popup_width;
 $markerArray['LABEL_LOADING'] = htmlspecialchars($this->pi_getLL('loading'));
 //$markerArray['ORDER_TOOLTIP_DATA_URL']=mslib_fe::typolink($this->shop_pid.',2002', '&tx_multishop_pi1[page_section]=getAdminOrdersListingDetails&tx_multishop_pi1[orders_id]='.$order['orders_id']);
 $markerArray['ORDER_CUSTOMER_NAME'] = implode('<br/>', $customerNameArray);
 $markerArray['ORDER_CREATE_DATE'] = '<a href="#" data-toggle="tooltip" class="btn-memo btn btn-default btn" data-title="' . htmlspecialchars(strftime("%a. %x<br/>%X", $order['crdate'])) . '" data-original-title="" title="">' . strftime("%x", $order['crdate']) . '</a>';
 $markerArray['ORDER_GRAND_TOTAL'] = mslib_fe::amount2Cents($order[$grandTotalColumnName], 0);
 $markerArray['ORDER_SHIPPING_METHOD'] = $order['shipping_method_label'];
 $markerArray['ORDER_PAYMENT_METHOD'] = $order['payment_method_label'];
 $markerArray['ORDER_STATUS'] = $order_status_selectbox;
 $markerArray['ORDER_LAST_MODIFIED'] = '';
 if ($order['status_last_modified']) {
     $markerArray['ORDER_LAST_MODIFIED'] = '<a href="#" data-toggle="tooltip" class="btn-memo btn btn-default btn" data-title="' . htmlspecialchars(strftime("%a. %x<br/>%X", $order['status_last_modified'])) . '" data-original-title="" title="">' . strftime("%x", $order['status_last_modified']) . '</a>';
 }
 $markerArray['ORDER_PAID_STATUS'] = $paid_status;
 $markerArray['PRINT_ORDER_LIST_BUTTON'] = $order_list_button_extra;
 $markerArray['PLUGIN_EXTRA_CONTENT'] = '';
 $markerArray['MASTER_SHOP'] = $master_shop_col;
 // custom page hook that can be controlled by third-party plugin
 if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/includes/orders/orders_listing_table.php']['adminOrdersListingTmplIteratorPreProc'])) {
     $params = array('markerArray' => &$markerArray, 'order' => &$order);
     foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/includes/orders/orders_listing_table.php']['adminOrdersListingTmplIteratorPreProc'] as $funcRef) {
            }
            if ($order['discount'] > 0) {
                $tmpcontent .= '
				<div class="form-group">
					<label class="control-label col-md-10">' . $this->pi_getLL('discount') . '</label>
					<div class="col-md-2">
					<p class="form-control-static order_total_value">' . mslib_fe::amount2Cents($order['discount'], 0) . '</p>
					</div>
				</div>
				';
            }
            $tmpcontent .= '
			<div class="form-group">
				<label class="control-label col-md-10">' . $this->pi_getLL('total') . '</label>
				<div class="col-md-2">
				<p class="form-control-static order_total_value">' . mslib_fe::amount2Cents($orders_tax_data['grand_total'], 0) . '</p>
				</div>
			</div>';
            if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
                $tmpcontent .= $content_vat;
            }
            $tmpcontent .= '</div>';
            $tmpcontent .= '</td></tr></tfoot></table>';
        }
        $tmpcontent .= '</table>';
        $tmpcontent .= '
		</div></div>
		' . ($order['customer_comments'] ? '
		<fieldset>
					<legend>' . $this->pi_getLL('comments') . '</legend>
					' . $order['customer_comments'] . '
Beispiel #19
0
 $output['label_checkout'] = $this->pi_getLL('proceed_to_checkout');
 // MINIMUM ORDER AMOUNT
 $count_products = count($cart['products']);
 $cart_total_amount = $mslib_cart->countCartTotalPrice(0);
 $minmax_warning = '';
 if (!empty($this->ms['MODULES']['MINIMUM_ORDER_AMOUNT']) && $this->ms['MODULES']['MINIMUM_ORDER_AMOUNT'] > 0) {
     if ($cart_total_amount < $this->ms['MODULES']['MINIMUM_ORDER_AMOUNT']) {
         $disable_checkout = true;
         $minmax_warning = sprintf($this->pi_getLL('minimum_cart_amount_must_at_least_x'), mslib_fe::amount2Cents($this->ms['MODULES']['MINIMUM_ORDER_AMOUNT']));
     }
 }
 // MAXIMUM ORDER AMOUNT
 if (!empty($this->ms['MODULES']['MAXIMUM_ORDER_AMOUNT']) && $this->ms['MODULES']['MAXIMUM_ORDER_AMOUNT'] > 0) {
     if ($cart_total_amount > $this->ms['MODULES']['MAXIMUM_ORDER_AMOUNT']) {
         $disable_checkout = true;
         $minmax_warning = sprintf($this->pi_getLL('maximum_cart_total_amount_are_x'), mslib_fe::amount2Cents($this->ms['MODULES']['MAXIMUM_ORDER_AMOUNT']));
     }
 }
 if (empty($minmax_warning)) {
     // clear coupon html
     // because the DISCOUNT_MODULE_WRAPPER is inside the CART_FOOTER wrapper we have to substitute it on the footer
     $subFooterparts = array();
     $subFooterparts['minmax_warning'] = $this->cObj->getSubpart($subparts['footer'], '###MIN_MAX_CART_AMOUNT_WRAPPER###');
     $subpartFooterArray = array();
     $subpartFooterArray['###MIN_MAX_CART_AMOUNT_WRAPPER###'] = '';
     $subparts['footer'] = $this->cObj->substituteMarkerArrayCached($subparts['footer'], array(), $subpartFooterArray);
 }
 if ($disable_checkout) {
     $output['checkout_link'] = 'javascript:void(0)';
 } else {
     $output['checkout_link'] = mslib_fe::typolink($this->conf['checkout_page_pid'], 'tx_multishop_pi1[page_section]=checkout');
 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;
 }
                    $tmp_content .= '<thead><tr>
					<th class="cellQty">' . $this->pi_getLL('qty') . '</th>
					<th class="cellName">' . $this->pi_getLL('products_name') . '</th>
					<th class="cellPrice">' . $this->pi_getLL('price') . '</th>
					</tr></thead><tbody>';
                    $sub_sub_tr_type = 'odd';
                    foreach ($products as $product) {
                        if (!$sub_sub_tr_type or $sub_sub_tr_type == 'even') {
                            $sub_sub_tr_type = 'odd';
                        } else {
                            $sub_sub_tr_type = 'even';
                        }
                        $tmp_content .= '<tr class="' . $sub_sub_tr_type . '">';
                        $tmp_content .= '<td class="cellQty">' . $product['qty'] . '</td>';
                        $tmp_content .= '<td class="cellName">' . $product['products_name'] . '</td>';
                        $tmp_content .= '<td class="cellPrice">' . mslib_fe::amount2Cents($product['final_price'], 0) . '</td>';
                        $tmp_content .= '</tr>';
                    }
                    $tmp_content .= '</tbody></table>';
                    //					$tmp_content.='</table>';
                    $tr_rows[] = '<th class="text-right" width="100">' . $this->pi_getLL('content') . '</th><td>' . $tmp_content . '</td>';
                    $sub_tr_type = 'odd';
                    foreach ($tr_rows as $tr_row) {
                        if (!$sub_tr_type or $sub_tr_type == 'even') {
                            $sub_tr_type = 'odd';
                        } else {
                            $sub_tr_type = 'even';
                        }
                        $content .= '<tr class="' . $sub_tr_type . '">' . $tr_row . '</tr>';
                    }
                    $content .= '</table>';
Beispiel #22
0
 } else {
     $price_excluding_vat = false;
 }
 if ($product['products_price'] != $product['final_price']) {
     if (!$this->ms['MODULES']['DB_PRICES_INCLUDE_VAT'] and ($product['tax_rate'] and $this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT'])) {
         $old_price = $product['products_price'] * (1 + $product['tax_rate']);
     } else {
         $old_price = $product['products_price'];
     }
     $old_price = mslib_fe::amount2Cents($old_price);
     $specials_price = mslib_fe::amount2Cents($final_price);
     $price = false;
 } else {
     $old_price = false;
     $specials_price = false;
     $price = mslib_fe::amount2Cents($final_price);
 }
 $temp_var_products['products_id'] = $product['products_id'];
 $temp_var_products['products_shortdescription'] = $product['products_shortdescription'];
 $temp_var_products['products_name'] = $product['products_name'];
 $temp_var_products['products_model'] = $product['products_model'];
 $temp_var_products['products_url'] = $product['products_url'];
 $temp_var_products['categories_name'] = $product['categories_name'];
 $temp_var_products['admin_edit_product_button'] = false;
 $temp_var_products['admin_edit_product'] = '';
 $temp_var_products['admin_delete_product'] = '';
 if ($this->ROOTADMIN_USER or $this->ADMIN_USER and $this->CATALOGADMIN_USER) {
     $temp_var_products['admin_edit_product_button'] = true;
     $temp_var_products['admin_edit_product'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=edit_product&cid=' . $product['categories_id'] . '&pid=' . $product['products_id'] . '&action=edit_product', 1);
     $temp_var_products['admin_delete_product'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=delete_product&cid=' . $product['categories_id'] . '&pid=' . $product['products_id'] . '&action=delete_product', 1);
 }
Beispiel #23
0
 function printInvoiceOrderDetailsTable($order, $invoice_number, $prefix = '', $display_currency_symbol = 1, $table_type = 'invoice')
 {
     switch ($table_type) {
         case 'invoice':
             if ($this->conf['order_details_table_invoice_pdf_tmpl_path']) {
                 $template = $this->cObj->fileResource($this->conf['order_details_table_invoice_pdf_tmpl_path']);
             } else {
                 $template = $this->cObj->fileResource(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('multishop') . 'templates/order_details_table_invoice_pdf.tmpl');
             }
             break;
         case 'packingslip':
             if ($this->conf['order_details_table_packingslip_pdf_tmpl_path']) {
                 $template = $this->cObj->fileResource($this->conf['order_details_table_packingslip_pdf_tmpl_path']);
             } else {
                 $template = $this->cObj->fileResource(\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath('multishop') . 'templates/order_details_table_packingslip_pdf.tmpl');
             }
             break;
     }
     if (is_array($order['products']) && count($order['products'])) {
         $contentItem = '';
         $displayDiscountColumn = 0;
         // First check if orders products rows have an discount amount
         foreach ($order['products'] as $product) {
             if ($product['discount_amount'] > 0) {
                 $displayDiscountColumn = 1;
                 break;
             }
         }
     }
     $customer_currency = 1;
     // Extract the subparts from the template
     $subparts = array();
     $subparts['template'] = $this->cObj->getSubpart($template, '###TEMPLATE###');
     $subparts['HEADER_NORMAL_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###HEADER_NORMAL_WRAPPER###');
     $subparts['HEADER_INCLUDE_VAT_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###HEADER_INCLUDE_VAT_WRAPPER###');
     $subparts['HEADER_EXCLUDE_VAT_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###HEADER_EXCLUDE_VAT_WRAPPER###');
     // items wrapper
     $subparts['ITEMS_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###ITEMS_WRAPPER###');
     $subparts['ITEM_WRAPPER'] = $this->cObj->getSubpart($subparts['ITEMS_WRAPPER'], '###ITEM_WRAPPER###');
     $subparts['ITEM_ATTRIBUTES_WRAPPER'] = $this->cObj->getSubpart($subparts['ITEMS_WRAPPER'], '###ITEM_ATTRIBUTES_WRAPPER###');
     //bottom row
     $subparts['SUBTOTAL_INCLUDE_VAT_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###SUBTOTAL_INCLUDE_VAT_WRAPPER###');
     $subparts['SUBTOTAL_EXCLUDE_VAT_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###SUBTOTAL_EXCLUDE_VAT_WRAPPER###');
     $subparts['DISCOUNT_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###DISCOUNT_WRAPPER###');
     $subparts['NEWSUBTOTAL_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###NEWSUBTOTAL_WRAPPER###');
     $subparts['TOTAL_VAT_ROW_INCLUDE_VAT'] = $this->cObj->getSubpart($subparts['template'], '###TOTAL_VAT_ROW_INCLUDE_VAT###');
     // single packing, shipping, payment costs line
     $subparts['SINGLE_SHIPPING_PACKING_COSTS_WRAPPER'] = $this->cObj->getSubpart($subparts['template'], '###SINGLE_SHIPPING_PACKING_COSTS_WRAPPER###');
     // parsing
     $subpartArray = array();
     //ITEMS_HEADER_WRAPPER
     $markerArray = array();
     $markerArray['LABEL_HEADER_QTY'] = ucfirst($this->pi_getLL('qty'));
     $markerArray['LABEL_HEADER_PRODUCT_NAME'] = $this->pi_getLL('products_name');
     $markerArray['LABEL_HEADER_SKU'] = $this->pi_getLL('sku_number', 'SKU');
     $markerArray['LABEL_HEADER__QUANTITY'] = $this->pi_getLL('qty');
     $markerArray['LABEL_HEADER_TOTAL'] = $this->pi_getLL('total');
     $markerArray['LABEL_HEADER_PRICE'] = $this->pi_getLL('price');
     //hook to let other plugins further manipulate the replacers
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['printInvoiceOrderDetailsTableHeaderNormalPostProc'])) {
         $params_internal = array('markerArray' => &$markerArray, 'table_type' => $table_type);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['printInvoiceOrderDetailsTableHeaderNormalPostProc'] as $funcRef) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params_internal, $this);
         }
     }
     $subpartArray['###HEADER_NORMAL_WRAPPER###'] = $this->cObj->substituteMarkerArray($subparts['HEADER_NORMAL_WRAPPER'], $markerArray, '###|###');
     $markerArray = array();
     $markerArray['LABEL_HEADER_VAT'] = $this->pi_getLL('vat');
     $markerArray['LABEL_HEADER_ITEM_NORMAL_PRICE'] = $this->pi_getLL('normal_price');
     $markerArray['LABEL_HEADER_ITEM_DISCOUNT'] = '';
     //hook to let other plugins further manipulate the replacers
     if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['printInvoiceOrderDetailsTableHeaderIncludeExcludeVatPostProc'])) {
         $params_internal = array('markerArray' => &$markerArray, 'table_type' => $table_type);
         foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['printInvoiceOrderDetailsTableHeaderIncludeExcludeVatPostProc'] as $funcRef) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params_internal, $this);
         }
     }
     if ($displayDiscountColumn) {
         $markerArray['LABEL_HEADER_ITEM_DISCOUNT'] = '<th align="right" class="cell_products_normal_price">' . $this->pi_getLL('discount') . '</th>';
     }
     if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
         $markerArray['LABEL_HEADER_ITEM_FINAL_PRICE'] = $this->pi_getLL('final_price_inc_vat');
         $subpartArray['###HEADER_INCLUDE_VAT_WRAPPER###'] = $this->cObj->substituteMarkerArray($subparts['HEADER_INCLUDE_VAT_WRAPPER'], $markerArray, '###|###');
     } else {
         $markerArray['LABEL_HEADER_ITEM_FINAL_PRICE'] = $this->pi_getLL('final_price_ex_vat');
         $subpartArray['###HEADER_EXCLUDE_VAT_WRAPPER###'] = $this->cObj->substituteMarkerArray($subparts['HEADER_EXCLUDE_VAT_WRAPPER'], $markerArray, '###|###');
     }
     // template wrapper
     // removal start
     $subpartsTemplateWrapperRemove = array();
     if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
         $subpartsTemplateWrapperRemove['###HEADER_EXCLUDE_VAT_WRAPPER###'] = '';
         $subpartsTemplateWrapperRemove['###SUBTOTAL_EXCLUDE_VAT_WRAPPER###'] = '';
     } else {
         $subpartsTemplateWrapperRemove['###HEADER_INCLUDE_VAT_WRAPPER###'] = '';
         $subpartsTemplateWrapperRemove['###SUBTOTAL_INCLUDE_VAT_WRAPPER###'] = '';
         $subpartsTemplateWrapperRemove['###TOTAL_VAT_ROW_INCLUDE_VAT###'] = '';
         if ($order['orders_tax_data']['shipping_tax'] || $order['orders_tax_data']['payment_tax']) {
             $subpartsTemplateWrapperRemove['###TOTAL_VAT_ROW_EXCLUDE_VAT_NO_SHIPPING_PAYMENT_TAX###'] = '';
         } else {
             $subpartsTemplateWrapperRemove['###TOTAL_VAT_ROW_EXCLUDE_VAT_HAVE_SHIPPING_PAYMENT_TAX###'] = '';
         }
     }
     if ($order['discount'] > -1 && $order['discount'] < 0.01) {
         $subpartsTemplateWrapperRemove['###DISCOUNT_WRAPPER###'] = '';
         $subpartsTemplateWrapperRemove['###NEWSUBTOTAL_WRAPPER###'] = '';
     }
     if (!empty($subparts['SINGLE_SHIPPING_PACKING_COSTS_WRAPPER'])) {
         $subpartsTemplateWrapperRemove['###SHIPPING_COSTS_WRAPPER###'] = '';
         $subpartsTemplateWrapperRemove['###PAYMENT_COSTS_WRAPPER###'] = '';
     }
     if (!$order['shipping_method_costs']) {
         // If shipping method costs are zero, then remove the whole subpart
         $subpartsTemplateWrapperRemove['###SHIPPING_COSTS_WRAPPER###'] = '';
     }
     if (!$order['payment_method_costs']) {
         // If payment method costs are zero, then remove the whole subpart
         $subpartsTemplateWrapperRemove['###PAYMENT_COSTS_WRAPPER###'] = '';
     }
     $subparts['template'] = $this->cObj->substituteMarkerArrayCached($subparts['template'], array(), $subpartsTemplateWrapperRemove);
     // items wrapper
     $subpartsItemsWrapperRemove = array();
     if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
         $subpartsItemsWrapperRemove['###ITEM_EXCLUDE_VAT_WRAPPER###'] = '';
     } else {
         $subpartsItemsWrapperRemove['###ITEM_INCLUDE_VAT_WRAPPER###'] = '';
     }
     $subparts['ITEM_WRAPPER'] = $this->cObj->substituteMarkerArrayCached($subparts['ITEM_WRAPPER'], array(), $subpartsItemsWrapperRemove);
     // item attributes wrapper
     $subpartsItemAttributesWrapperRemove = array();
     if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
         $subpartsItemAttributesWrapperRemove['###ITEM_ATTRIBUTE_EXCLUDE_VAT_WRAPPER###'] = '';
     } else {
         $subpartsItemAttributesWrapperRemove['###ITEM_ATTRIBUTE_INCLUDE_VAT_WRAPPER###'] = '';
     }
     $subparts['ITEM_ATTRIBUTES_WRAPPER'] = $this->cObj->substituteMarkerArrayCached($subparts['ITEM_ATTRIBUTES_WRAPPER'], array(), $subpartsItemAttributesWrapperRemove);
     // removal eol
     // tax subparts
     $subparts['TOTAL_VAT_ROW_EXCLUDE_VAT_NO_SHIPPING_PAYMENT_TAX'] = $this->cObj->getSubpart($subparts['template'], '###TOTAL_VAT_ROW_EXCLUDE_VAT_NO_SHIPPING_PAYMENT_TAX###');
     $subparts['TOTAL_VAT_ROW_EXCLUDE_VAT_HAVE_SHIPPING_PAYMENT_TAX'] = $this->cObj->getSubpart($subparts['template'], '###TOTAL_VAT_ROW_EXCLUDE_VAT_HAVE_SHIPPING_PAYMENT_TAX###');
     $subparts['TOTAL_VAT_ROW_INCLUDE_VAT'] = $this->cObj->getSubpart($subparts['template'], '###TOTAL_VAT_ROW_INCLUDE_VAT###');
     //print_r($subparts);
     //die();
     $total_tax = 0;
     $tr_type = 'even';
     $od_rows_count = 0;
     $product_counter = 1;
     $real_prefix = $prefix;
     if (is_array($order['products']) && count($order['products'])) {
         $contentItem = '';
         foreach ($order['products'] as $product) {
             $markerArray = array();
             $markerArray['ITEM_COUNTER'] = $product_counter;
             $od_rows_count++;
             if (!$tr_type or $tr_type == 'even') {
                 $tr_type = 'odd';
             } else {
                 $tr_type = 'even';
             }
             $markerArray['ITEM_ROW_TYPE'] = $tr_type;
             $markerArray['ITEM_PRODUCT_QTY'] = round($product['qty'], 2);
             $product_tmp = mslib_fe::getProduct($product['products_id']);
             $product_name = htmlspecialchars($product['products_name']);
             if ($product['products_article_number']) {
                 $product_name .= ' (' . htmlspecialchars($product['products_article_number']) . ')';
             }
             if ($this->ms['MODULES']['DISPLAY_SKU_IN_ORDER_DETAILS'] == '1' && !empty($product['sku_code'])) {
                 $product_name .= '<br/>' . htmlspecialchars($this->pi_getLL('admin_label_sku')) . ': ' . htmlspecialchars($product['sku_code']);
             }
             if ($this->ms['MODULES']['DISPLAY_PRODUCTS_MODEL_IN_ORDER_DETAILS'] == '1' && !empty($product['products_model'])) {
                 $product_name .= '<br/>Model: ' . htmlspecialchars($product['products_model']);
             }
             if ($product['products_description']) {
                 $product_name .= '<br/>' . nl2br(htmlspecialchars($product['products_description']));
             }
             if ($this->ms['MODULES']['DISPLAY_EAN_IN_ORDER_DETAILS'] == '1' && !empty($product['ean_code'])) {
                 $product_name .= '<br/>' . htmlspecialchars($this->pi_getLL('admin_label_ean')) . ': ' . htmlspecialchars($product['ean_code']);
             }
             if ($this->ms['MODULES']['DISPLAY_VENDOR_IN_ORDER_DETAILS'] == '1' && !empty($product['vendor_code'])) {
                 $product_name .= '<br/>' . htmlspecialchars($this->pi_getLL('admin_label_vendor_code')) . ': ' . htmlspecialchars($product['vendor_code']);
             }
             $markerArray['ITEM_PRODUCT_NAME'] = $product_name;
             // Seperate marker version
             $markerArray['ITEM_SEPERATE_PRODUCTS_NAME'] = htmlspecialchars($product['products_name']);
             $markerArray['ITEM_SEPERATE_PRODUCTS_DESCRIPTION'] = nl2br(htmlspecialchars($product['products_description']));
             $markerArray['ITEM_SEPERATE_PRODUCTS_MODEL'] = htmlspecialchars($product['products_model']);
             // Seperate marker version eol
             $markerArray['ITEM_VAT'] = str_replace('.00', '', number_format($product['products_tax'], 2)) . '%';
             $markerArray['ITEM_ORDER_UNIT'] = $product['order_unit_name'];
             // ITEM IMAGE
             $image_path = mslib_befe::getImagePath($product_tmp['products_image'], 'products', '50');
             if (isset($product_tmp['products_image']) && !empty($product_tmp['products_image'])) {
                 if (!strstr(mslib_befe::strtolower($product_tmp['products_image']), 'http://') and !strstr(mslib_befe::strtolower($product_tmp['products_image']), 'https://')) {
                     $product_tmp['products_image'] = $image_path;
                 }
                 $markerArray['ITEM_IMAGE'] = '<img src="' . $product_tmp['products_image'] . '" title="' . htmlspecialchars($product['products_name']) . '">';
             } else {
                 $markerArray['ITEM_IMAGE'] = '<div class="no_image_50"></div>';
             }
             if ($table_type == 'invoice' && $prefix == '-') {
                 if (strpos($product['final_price'], '-') !== false) {
                     $product['final_price'] = str_replace('-', '', $product['final_price']);
                 } else {
                     $product['final_price'] = $prefix . $product['final_price'];
                 }
             }
             if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
                 $markerArray['ITEM_NORMAL_PRICE'] = mslib_fe::amount2Cents($product['final_price'] + $product['products_tax_data']['total_tax'], $customer_currency, $display_currency_symbol, 0);
                 $markerArray['ITEM_FINAL_PRICE'] = mslib_fe::amount2Cents($product['qty'] * ($product['final_price'] + $product['products_tax_data']['total_tax']), $customer_currency, $display_currency_symbol, 0);
             } else {
                 $markerArray['ITEM_NORMAL_PRICE'] = mslib_fe::amount2Cents($product['final_price'], $customer_currency, $display_currency_symbol, 0);
                 $markerArray['ITEM_FINAL_PRICE'] = mslib_fe::amount2Cents($product['qty'] * $product['final_price'], $customer_currency, $display_currency_symbol, 0);
             }
             $markerArray['ITEM_DISCOUNT_AMOUNT'] = '';
             if ($displayDiscountColumn) {
                 $markerArray['ITEM_DISCOUNT_AMOUNT'] = '<td align="right" class="cell_products_normal_price">' . mslib_fe::amount2Cents($product['discount_amount'], 0) . '</td>';
                 if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
                     $markerArray['ITEM_DISCOUNT_AMOUNT'] = '<td align="right" class="cell_products_normal_price">' . mslib_fe::amount2Cents($product['discount_amount'] + $product['discount_amount'] * $product['products_tax'] / 100, 0) . '</td>';
                     $markerArray['ITEM_NORMAL_PRICE'] = mslib_fe::amount2Cents($product['final_price'] + $product['final_price'] * $product['products_tax'] / 100, $customer_currency, $display_currency_symbol, 0);
                     //$markerArray['ITEM_FINAL_PRICE'] = mslib_fe::amount2Cents($prefix . (($product['final_price'] - $product['discount_amount']) + $product['products_tax_data']['total_tax']), $customer_currency, $display_currency_symbol, 0);
                     $markerArray['ITEM_FINAL_PRICE'] = mslib_fe::amount2Cents($product['final_price'] + $product['products_tax_data']['total_tax'], $customer_currency, $display_currency_symbol, 0);
                 } else {
                     $markerArray['ITEM_NORMAL_PRICE'] = mslib_fe::amount2Cents($product['final_price'], $customer_currency, $display_currency_symbol, 0);
                     //$markerArray['ITEM_FINAL_PRICE'] = mslib_fe::amount2Cents($prefix . ($product['qty'] * ($product['final_price'] - $product['discount_amount'])), $customer_currency, $display_currency_symbol, 0);
                     $markerArray['ITEM_FINAL_PRICE'] = mslib_fe::amount2Cents($product['qty'] * $product['final_price'], $customer_currency, $display_currency_symbol, 0);
                 }
             }
             //hook to let other plugins further manipulate the replacers
             if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['printInvoiceOrderDetailsTableProductIteratorPostProc'])) {
                 $params_internal = array('markerArray' => &$markerArray, 'table_type' => $table_type, 'product' => $product_tmp, 'order_product' => $product);
                 foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_befe.php']['printInvoiceOrderDetailsTableProductIteratorPostProc'] as $funcRef) {
                     \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params_internal, $this);
                 }
             }
             $append_attributes_label_to_product_name = false;
             if (empty($subparts['ITEM_ATTRIBUTES_WRAPPER'])) {
                 $append_attributes_label_to_product_name = true;
             } else {
                 $contentItem .= $this->cObj->substituteMarkerArray($subparts['ITEM_WRAPPER'], $markerArray, '###|###');
             }
             if (is_array($product['attributes']) && count($product['attributes'])) {
                 foreach ($product['attributes'] as $tmpkey => $options) {
                     if ($options['products_options_values']) {
                         if ($table_type == 'invoice' && $prefix == '-') {
                             if (strpos($options['options_values_price'], '-') !== false) {
                                 $options['options_values_price'] = str_replace('-', '', $options['options_values_price']);
                             } else {
                                 $options['options_values_price'] = $prefix . $options['options_values_price'];
                             }
                         }
                         $attributeMarkerArray = array();
                         $attributeMarkerArray['ITEM_ATTRIBUTE_ROW_TYPE'] = $tr_type;
                         $attributeMarkerArray['ITEM_ATTRIBUTE'] = '';
                         if ($options['products_options'] && $options['products_options_values']) {
                             if ($append_attributes_label_to_product_name) {
                                 $markerArray['ITEM_PRODUCT_NAME'] .= ' <br />' . $options['products_options'] . ': ' . $options['products_options_values'];
                             }
                             $attributeMarkerArray['ITEM_ATTRIBUTE'] = htmlspecialchars($options['products_options']) . ': ' . htmlspecialchars($options['products_options_values']);
                         }
                         $attributeMarkerArray['ITEM_ATTRIBUTE_VAT'] = '';
                         // calculating
                         $od_rows_count++;
                         $cell_products_normal_price = '';
                         $cell_products_vat = '';
                         $cell_products_final_price = '';
                         if ($options['options_values_price'] > 0) {
                             if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
                                 $attributes_price = $options['price_prefix'] . $options['options_values_price'] + $options['attributes_tax_data']['tax'];
                                 $total_attributes_price = $attributes_price * $product['qty'];
                                 $cell_products_normal_price = mslib_fe::amount2Cents($attributes_price, $customer_currency, $display_currency_symbol, 0);
                                 $cell_products_final_price = mslib_fe::amount2Cents($total_attributes_price, $customer_currency, $display_currency_symbol, 0);
                             } else {
                                 $cell_products_normal_price = mslib_fe::amount2Cents($options['price_prefix'] . $options['options_values_price'], $customer_currency, $display_currency_symbol, 0);
                                 $cell_products_final_price = mslib_fe::amount2Cents(($options['price_prefix'] . $options['options_values_price']) * $product['qty'], $customer_currency, $display_currency_symbol, 0);
                             }
                         }
                         $attributeMarkerArray['ITEM_ATTRIBUTE_NORMAL_PRICE'] = $cell_products_normal_price;
                         $attributeMarkerArray['ITEM_ATTRIBUTE_DISCOUNT_AMOUNT'] = '';
                         if ($displayDiscountColumn) {
                             $attributeMarkerArray['ITEM_ATTRIBUTE_DISCOUNT_AMOUNT'] = '<td align="right" class="cell_products_normal_price">&nbsp;</td>';
                         }
                         $attributeMarkerArray['ITEM_ATTRIBUTE_FINAL_PRICE'] = $cell_products_final_price;
                     }
                     $contentItem .= $this->cObj->substituteMarkerArray($subparts['ITEM_ATTRIBUTES_WRAPPER'], $attributeMarkerArray, '###|###');
                 }
             }
             if (empty($subparts['ITEM_ATTRIBUTES_WRAPPER'])) {
                 $contentItem .= $this->cObj->substituteMarkerArray($subparts['ITEM_WRAPPER'], $markerArray, '###|###');
             }
             $subpartArray['###ITEM_ATTRIBUTES_WRAPPER###'] = '';
             // count the vat
             if ($order['final_price'] and $order['products_tax']) {
                 $item_tax = $order['qty'] * ($order['final_price'] * $order['products_tax'] / 100);
                 $total_tax = $total_tax + $item_tax;
             }
             $product_counter++;
         }
     } else {
         $subpartArray['###ITEM_ATTRIBUTES_WRAPPER###'] = '';
     }
     $subpartArray['###ITEM_WRAPPER###'] = $contentItem;
     if ($table_type == 'invoice' && $prefix == '-') {
         if (strpos($order['shipping_method_costs'], '-') !== false) {
             $prefix = '';
             $order['shipping_method_costs'] = str_replace('-', '', $order['shipping_method_costs']);
             $order['orders_tax_data']['shipping_tax'] = str_replace('-', '', $order['orders_tax_data']['shipping_tax']);
         } else {
             $prefix = '-';
         }
         if (strpos($order['payment_method_costs'], '-') !== false) {
             $prefix = '';
             $order['payment_method_costs'] = str_replace('-', '', $order['payment_method_costs']);
             $order['orders_tax_data']['payment_tax'] = str_replace('-', '', $order['orders_tax_data']['payment_tax']);
         } else {
             $prefix = '-';
         }
         if (strpos($order['orders_tax_data']['sub_total'], '-') !== false) {
             $prefix = '';
             $order['orders_tax_data']['sub_total'] = str_replace('-', '', $order['orders_tax_data']['sub_total']);
         } else {
             $prefix = '-';
         }
         if (strpos($order['subtotal_amount'], '-') !== false) {
             $prefix = '';
             $order['subtotal_amount'] = str_replace('-', '', $order['subtotal_amount']);
         } else {
             $prefix = '-';
         }
         if (strpos($order['discount'], '-') !== false) {
             $prefix = '';
             $order['discount'] = str_replace('-', '', $order['discount']);
         } else {
             $prefix = '-';
         }
         if (strpos($order['orders_tax_data']['grand_total'], '-') !== false) {
             $prefix = '';
             $order['orders_tax_data']['grand_total'] = str_replace('-', '', $order['orders_tax_data']['grand_total']);
         } else {
             $prefix = '-';
         }
     }
     if (!empty($subparts['SINGLE_SHIPPING_PACKING_COSTS_WRAPPER'])) {
         /*
         * special subparts
         <!-- ###SINGLE_SHIPPING_PACKING_COSTS_WRAPPER### begin -->
         				<tr class="###ITEM_SHIPPING_PAYMENT_COSTS_ROW_TYPE###">
         					<td align="right" class="cell_products_counter valign_top">###ITEM_SHIPPING_PAYMENT_COSTS_COUNTER###</td>
         					<td align="left" class="cell_products_name valign_top">###ITEM_SHIPPING_PAYMENT_COSTS_LABEL###</td>
         					<td align="right" class="cell_products_normal_price valign_top">###ITEM_SHIPPING_PAYMENT_COSTS_NORMAL_PRICE###</td>
         					<td align="right" class="cell_products_vat valign_top">###ITEM_SHIPPING_PAYMENT_COSTS_VAT###</td>
         					<td align="right" class="cell_products_final_price valign_top">###ITEM_SHIPPING_PAYMENT_COSTS_FINAL_PRICE###</td>
         				</tr>
         				<!-- ###SINGLE_SHIPPING_PACKING_COSTS_WRAPPER### end -->
         */
         $shipping_payment_costs_line = '';
         // payment costs
         if (!$tr_type or $tr_type == 'even') {
             $tr_type = 'odd';
         } else {
             $tr_type = 'even';
         }
         $payment_tax_rate = '-';
         if (!empty($order['orders_tax_data']['payment_total_tax_rate'])) {
             $payment_tax_rate = $order['orders_tax_data']['payment_total_tax_rate'] * 100 . '%';
         }
         $markerArray = array();
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_COUNTER'] = $product_counter;
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_LABEL'] = $this->pi_getLL('payment_costs') . ' (' . $order['payment_method_label'] . ')';
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_ROW_TYPE'] = $tr_type;
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_VAT'] = $payment_tax_rate;
         $payment_costs = '0';
         if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
             if ($order['payment_method_costs'] !== 0) {
                 $payment_costs = $prefix . ($order['payment_method_costs'] + $order['orders_tax_data']['payment_tax']);
             }
         } else {
             if ($order['payment_method_costs'] !== 0) {
                 $payment_costs = $prefix . $order['payment_method_costs'];
             }
         }
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_NORMAL_PRICE'] = mslib_fe::amount2Cents($payment_costs, $customer_currency, $display_currency_symbol, 0);
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_FINAL_PRICE'] = mslib_fe::amount2Cents($payment_costs, $customer_currency, $display_currency_symbol, 0);
         $shipping_payment_costs_line .= $this->cObj->substituteMarkerArray($subparts['SINGLE_SHIPPING_PACKING_COSTS_WRAPPER'], $markerArray, '###|###');
         $product_counter++;
         // shipping costs
         if (!$tr_type or $tr_type == 'even') {
             $tr_type = 'odd';
         } else {
             $tr_type = 'even';
         }
         $shipping_tax_rate = '0%';
         if (!empty($order['orders_tax_data']['shipping_total_tax_rate'])) {
             $shipping_tax_rate = $order['orders_tax_data']['shipping_total_tax_rate'] * 100 . '%';
         }
         $markerArray = array();
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_COUNTER'] = $product_counter;
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_LABEL'] = $this->pi_getLL('shipping_costs') . ' (' . $order['shipping_method_label'] . ')';
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_ROW_TYPE'] = $tr_type;
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_VAT'] = $shipping_tax_rate;
         $shipping_costs = '0';
         if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
             if ($order['shipping_method_costs'] !== 0) {
                 $shipping_costs = $prefix . ($order['shipping_method_costs'] + $order['orders_tax_data']['shipping_tax']);
             }
         } else {
             if ($order['shipping_method_costs'] !== 0) {
                 $shipping_costs = $prefix . $order['shipping_method_costs'];
             }
         }
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_NORMAL_PRICE'] = mslib_fe::amount2Cents($shipping_costs, $customer_currency, $display_currency_symbol, 0);
         $markerArray['ITEM_SHIPPING_PAYMENT_COSTS_FINAL_PRICE'] = mslib_fe::amount2Cents($shipping_costs, $customer_currency, $display_currency_symbol, 0);
         $shipping_payment_costs_line .= $this->cObj->substituteMarkerArray($subparts['SINGLE_SHIPPING_PACKING_COSTS_WRAPPER'], $markerArray, '###|###');
         $product_counter++;
         $subpartArray['###SINGLE_SHIPPING_PACKING_COSTS_WRAPPER###'] = $shipping_payment_costs_line;
     }
     // bottom row
     // taxes row renderer
     $vat_wrapper_keys = array();
     $vat_wrapper_keys[] = 'TOTAL_VAT_ROW_INCLUDE_VAT';
     $vat_wrapper_keys[] = 'TOTAL_VAT_ROW_EXCLUDE_VAT_NO_SHIPPING_PAYMENT_TAX';
     $vat_wrapper_keys[] = 'TOTAL_VAT_ROW_EXCLUDE_VAT_HAVE_SHIPPING_PAYMENT_TAX';
     foreach ($vat_wrapper_keys as $vat_wrapper_key) {
         if (!empty($subparts[$vat_wrapper_key])) {
             $vatItem = '';
             if (isset($order['orders_tax_data']['tax_separation']) && count($order['orders_tax_data']['tax_separation']) && !$order['discount']) {
                 foreach ($order['orders_tax_data']['tax_separation'] as $tax_sep_rate => $tax_sep_data) {
                     $markerArray = array();
                     if (isset($tax_sep_rate)) {
                         // If TAX seperation has only 1 entry always print it (0% TAX for example)
                         // Else only print the current TAX rate if it is higher than zero
                         if (count($order['orders_tax_data']['tax_separation']) == 1 || count($order['orders_tax_data']['tax_separation']) > 1 && $tax_sep_rate > 0) {
                             if (empty($tax_sep_data['shipping_tax'])) {
                                 $tax_sep_data['shipping_tax'] = 0;
                             }
                             if (empty($tax_sep_data['payment_tax'])) {
                                 $tax_sep_data['payment_tax'] = 0;
                             }
                             if ($table_type == 'invoice' && $real_prefix == '-') {
                                 if (strpos($tax_sep_data['products_total_tax'], '-') !== false) {
                                     $prefix = '';
                                     $tax_sep_data['products_total_tax'] = str_replace('-', '', $tax_sep_data['products_total_tax']);
                                     $tax_sep_data['shipping_tax'] = str_replace('-', '', $tax_sep_data['shipping_tax']);
                                     $tax_sep_data['payment_tax'] = str_replace('-', '', $tax_sep_data['payment_tax']);
                                 } else {
                                     $prefix = '-';
                                 }
                             }
                             $tax_sep_total = $prefix . ($tax_sep_data['products_total_tax'] + $tax_sep_data['shipping_tax'] + $tax_sep_data['payment_tax']);
                             if (count($order['orders_tax_data']['tax_separation']) == 1 || $tax_sep_total > 0) {
                                 // only print TAX rate if there is only 1 seperation OR if there are multiple seperations where each seperation amount is higher than 0
                                 if ($vat_wrapper_key == 'TOTAL_VAT_ROW_INCLUDE_VAT') {
                                     $markerArray['LABEL_INCLUDED_VAT_AMOUNT'] = $this->pi_getLL('included_vat_amount') . ' ' . $tax_sep_rate . '%';
                                 } else {
                                     // todo: add typoscript constant to enable/disable the view
                                     // Show the taken amount for the seperated VAT (i.e. BTW 21% from 10 Euro)
                                     //$markerArray['LABEL_VAT']=sprintf($this->pi_getLL('vat_nn_from_subtotal_nn'), $tax_sep_rate.'%', ($display_currency_symbol ? '' : 'EUR ').mslib_fe::amount2Cents($prefix.($tax_sep_data['products_sub_total_excluding_vat']+$tax_sep_data['shipping_costs']+$tax_sep_data['payment_costs']), $customer_currency, $display_currency_symbol, 0));
                                     // Show traditional label (i.e. BTW 21%)
                                     $markerArray['LABEL_VAT'] = $this->pi_getLL('vat') . ' ' . $tax_sep_rate . '%';
                                 }
                                 $markerArray['TOTAL_VAT'] = mslib_fe::amount2Cents($tax_sep_total, $customer_currency, $display_currency_symbol, 0);
                                 $vatItem .= $this->cObj->substituteMarkerArray($subparts[$vat_wrapper_key], $markerArray, '###|###');
                             }
                         }
                     }
                 }
             } else {
                 $markerArray = array();
                 if ($vat_wrapper_key == 'TOTAL_VAT_ROW_INCLUDE_VAT') {
                     $markerArray['LABEL_INCLUDED_VAT_AMOUNT'] = $this->pi_getLL('included_vat_amount');
                 } else {
                     $markerArray['LABEL_VAT'] = $this->pi_getLL('vat');
                 }
                 if ($table_type == 'invoice' && $real_prefix == '-') {
                     if (strpos($order['orders_tax_data']['total_orders_tax'], '-') !== false) {
                         $prefix = '';
                         $order['orders_tax_data']['total_orders_tax'] = str_replace('-', '', $order['orders_tax_data']['total_orders_tax']);
                     } else {
                         $prefix = '-';
                     }
                 }
                 $markerArray['TOTAL_VAT'] = mslib_fe::amount2Cents($prefix . $order['orders_tax_data']['total_orders_tax'], $customer_currency, $display_currency_symbol, 0);
                 $vatItem .= $this->cObj->substituteMarkerArray($subparts[$vat_wrapper_key], $markerArray, '###|###');
             }
             $subpartArray['###' . $vat_wrapper_key . '###'] = $vatItem;
             break;
         }
     }
     $hr_colspan = 3;
     $colspan = 5;
     if ($displayDiscountColumn) {
         $hr_colspan = 4;
         $colspan = 6;
     }
     $subpartArray['###INVOICE_HR_COLSPAN###'] = $hr_colspan;
     $subpartArray['###INVOICE_TOTAL_COLSPAN###'] = $colspan;
     $subpartArray['###LABEL_SUBTOTAL###'] = $this->pi_getLL('sub_total');
     //$subpartArray['###LABEL_VAT###']=$this->pi_getLL('vat');
     $subpartArray['###LABEL_SHIPPING_COSTS###'] = $this->pi_getLL('shipping_costs');
     $subpartArray['###LABEL_PAYMENT_COSTS###'] = $this->pi_getLL('payment_costs');
     $subpartArray['###LABEL_PAYMENT_COSTS###'] = $this->pi_getLL('payment_costs');
     if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
         if (!empty($subparts['SINGLE_SHIPPING_PACKING_COSTS_WRAPPER'])) {
             $subpartArray['###SUBTOTAL###'] = mslib_fe::amount2Cents($prefix . ($order['orders_tax_data']['sub_total'] + $shipping_costs + $payment_costs), $customer_currency, $display_currency_symbol, 0);
             $subpartArray['###SUBTOTAL_EXTRA###'] = mslib_fe::amount2Cents($prefix . ($order['orders_tax_data']['sub_total'] + $shipping_costs + $payment_costs), $customer_currency, $display_currency_symbol, 0);
         } else {
             $subpartArray['###SUBTOTAL###'] = mslib_fe::amount2Cents($prefix . $order['orders_tax_data']['sub_total'], $customer_currency, $display_currency_symbol, 0);
             $subpartArray['###SUBTOTAL_EXTRA###'] = mslib_fe::amount2Cents($prefix . $order['orders_tax_data']['sub_total'], $customer_currency, $display_currency_symbol, 0);
         }
         //$subpartArray['###TOTAL_VAT###']=mslib_fe::amount2Cents($prefix.($order['orders_tax_data']['total_orders_tax']), 0,$display_currency_symbol,0);
         $subpartArray['###TOTAL_SHIPPING_COSTS###'] = mslib_fe::amount2Cents($prefix . ($order['shipping_method_costs'] + $order['orders_tax_data']['shipping_tax']), $customer_currency, $display_currency_symbol, 0);
         $subpartArray['###TOTAL_PAYMENT_COSTS###'] = mslib_fe::amount2Cents($prefix . ($order['payment_method_costs'] + $order['orders_tax_data']['payment_tax']), $customer_currency, $display_currency_symbol, 0);
     } else {
         if (!empty($subparts['SINGLE_SHIPPING_PACKING_COSTS_WRAPPER'])) {
             $subpartArray['###SUBTOTAL###'] = mslib_fe::amount2Cents($prefix . ($order['subtotal_amount'] + $shipping_costs + $payment_costs), $customer_currency, $display_currency_symbol, 0);
             $subpartArray['###SUBTOTAL_EXTRA###'] = mslib_fe::amount2Cents($prefix . ($order['subtotal_amount'] + $shipping_costs + $payment_costs), $customer_currency, $display_currency_symbol, 0);
         } else {
             $subpartArray['###SUBTOTAL###'] = mslib_fe::amount2Cents($prefix . $order['subtotal_amount'], $customer_currency, $display_currency_symbol, 0);
             $subpartArray['###SUBTOTAL_EXTRA###'] = mslib_fe::amount2Cents($prefix . $order['subtotal_amount'], $customer_currency, $display_currency_symbol, 0);
         }
         //$subpartArray['###TOTAL_VAT###']=mslib_fe::amount2Cents($prefix.($order['orders_tax_data']['total_orders_tax']), 0,$display_currency_symbol,0);
         $subpartArray['###TOTAL_SHIPPING_COSTS###'] = mslib_fe::amount2Cents($prefix . $order['shipping_method_costs'], $customer_currency, $display_currency_symbol, 0);
         $subpartArray['###TOTAL_PAYMENT_COSTS###'] = mslib_fe::amount2Cents($prefix . $order['payment_method_costs'], $customer_currency, $display_currency_symbol, 0);
     }
     if ($order['discount'] < 0 || $order['discount'] > 0) {
         $subpartArray['###LABEL_DISCOUNT###'] = $this->pi_getLL('discount');
         $subpartArray['###TOTAL_DISCOUNT###'] = mslib_fe::amount2Cents($prefix . $order['discount'], $customer_currency, $display_currency_symbol, 0);
         //
         $subpartArray['###PRODUCTS_NEWSUB_TOTAL_PRICE_LABEL###'] = $this->pi_getLL('subtotal');
         $subpartArray['###PRODUCTS_NEWTOTAL_PRICE###'] = mslib_fe::amount2Cents($order['subtotal_amount'] - $order['discount'], $customer_currency, $display_currency_symbol, 0);
     }
     //$subpartArray['###LABEL_INCLUDED_VAT_AMOUNT###']=$this->pi_getLL('included_vat_amount');
     $subpartArray['###LABEL_GRAND_TOTAL_EXCLUDING_VAT###'] = $this->pi_getLL('grand_total_excluding_vat') . ' ';
     $subpartArray['###GRAND_TOTAL_EXCLUDING_VAT###'] = mslib_fe::amount2Cents($prefix . $order['orders_tax_data']['grand_total_excluding_vat'], $customer_currency, $display_currency_symbol, 0);
     $subpartArray['###LABEL_GRAND_TOTAL###'] = $this->pi_getLL('total');
     $subpartArray['###GRAND_TOTAL###'] = mslib_fe::amount2Cents($prefix . $order['orders_tax_data']['grand_total'], $customer_currency, $display_currency_symbol, 0);
     $tmpcontent = $this->cObj->substituteMarkerArrayCached($subparts['template'], null, $subpartArray);
     return $tmpcontent;
 }
            if (!empty($item['description'])) {
                $shipping_method_description = '<div class="description">' . $item['description'] . '</div>';
            }
            if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/front_pages/includes/checkout/multistep/checkout_shipping_payment_method']['checkoutMultistepShippingMethodSelectionHook'])) {
                $params = array('shipping_method' => &$shipping_method, 'item' => &$item, 'shipping_method_description' => &$shipping_method_description);
                foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/front_pages/includes/checkout/multistep/checkout_shipping_payment_method']['checkoutMultistepShippingMethodSelectionHook'] as $funcRef) {
                    \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
                }
            }
            $count++;
            // costs
            $price_wrap = '';
            $priceArray = mslib_fe::getShippingCosts($countries_id, $item['id']);
            if ($priceArray['shipping_costs_including_vat'] > 0 || $this->ms['MODULES']['ALWAYS_DISPLAY_SHIPPING_COSTS'] > 0) {
                $data['shipping_cost'] = $priceArray['shipping_costs_including_vat'];
                $price_wrap = '<div class="shipping_price" style="float:right" id="shipping_price_' . $item['id'] . '">' . mslib_fe::amount2Cents($priceArray['shipping_costs_including_vat']) . '</div>';
            }
            // costs eof
            $content .= '<li id="multishop_shipping_method_' . $item['id'] . '" class="col-sm-4"><label for="shipping_method_' . $item['id'] . '" class="name" id="label_shipping_method_' . $item['id'] . '"><div class="listing_item">';
            if ($price_wrap) {
                $content .= $price_wrap;
            }
            $content .= '<input name="shipping_method" id="shipping_method_' . $item['id'] . '" type="radio" value="' . htmlspecialchars($item['id']) . '" ' . (($this->post['tx_multishop_pi1']['previous_checkout_section'] != current($stepCodes) and $count == 1) ? 'checked' : '') . ' /><strong class="method_name">' . $item['name'] . '</strong>';
            $content .= $shipping_method_description;
            $content .= '</div></label>';
            $content .= '</li>';
        }
        $content .= '
		 </ul>
	 	 </div>
		 ';
        }
        $str = "SELECT i.reversal_invoice,i.invoice_id, i.invoice_id, o.orders_id, o.grand_total  FROM tx_multishop_orders o, tx_multishop_invoices i  WHERE (" . implode(" AND ", $data_query['where']) . ") and (i.crdate BETWEEN " . $start_time . " and " . $end_time . ") AND o.orders_id=i.orders_id";
        $qry = $GLOBALS['TYPO3_DB']->sql_query($str);
        while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) != false) {
            if (!$row['reversal_invoice']) {
                $total_price = $total_price + $row['grand_total'];
            } else {
                $total_price = $total_price - $row['grand_total'];
            }
            $total_orders++;
        }
        $total_amount = $total_amount + $total_price;
        $total_orders_per_year = $total_orders_per_year + $total_orders;
    }
    $year_total_amount[$yr] = mslib_fe::amount2Cents($total_amount, 0);
    $year_total_order[$yr] = mslib_fe::amount2Cents($total_amount / $total_orders_per_year, 0);
}
if (!$tr_type or $tr_type == 'even') {
    $tr_type = 'odd';
} else {
    $tr_type = 'even';
}
$tr_type = 'even';
$content .= '<h3>' . htmlspecialchars($this->pi_getLL('sales_volume_by_year', 'Sales volume by year')) . '</h3>';
$content .= '<table class="table table-striped table-bordered" id="product_import_table">
<thead><tr>
	<th width="200">' . htmlspecialchars($this->pi_getLL('year', 'Year')) . '</th>
	<th align="right">' . htmlspecialchars($this->pi_getLL('amount', 'Amount')) . '</th>
	<th align="right">' . htmlspecialchars($this->pi_getLL('average', 'Average')) . '</th>
</tr></thead><tbody>';
foreach ($year_total_amount as $years => $year_total) {
Beispiel #26
0
             $return_data['delivery_time'] = trim($product_data['delivery_time']);
         }
         $str2 = "SELECT * from static_countries sc, tx_multishop_countries_to_zones c2z, tx_multishop_shipping_countries c where c.page_uid='" . $this->showCatalogFromPage . "' and sc.cn_iso_nr=c.cn_iso_nr and c2z.cn_iso_nr=sc.cn_iso_nr group by c.cn_iso_nr order by c2z.zone_id asc, sc.cn_short_" . $this->lang . " asc";
         //$str2="SELECT * from static_countries c, tx_multishop_countries_to_zones c2z where c2z.cn_iso_nr=c.cn_iso_nr order by c.cn_short_en";
         $qry2 = $GLOBALS['TYPO3_DB']->sql_query($str2);
         $enabled_countries = array();
         while (($row2 = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry2)) != false) {
             $shipping_cost_data = array();
             $shipping_cost_data = mslib_fe::getProductShippingCostsOverview($row2['cn_iso_nr'], $this->post['tx_multishop_pi1']['pid'], $this->post['tx_multishop_pi1']['qty']);
             foreach ($shipping_cost_data as $shipping_code => $shipping_cost) {
                 if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
                     $return_data['shipping_cost'][$row2['zone_id']][$shipping_code][$row2['cn_iso_nr']] = $shipping_cost['shipping_costs_including_vat'];
                     $return_data['shipping_costs_display'][$row2['zone_id']][$shipping_code][$row2['cn_iso_nr']] = mslib_fe::amount2Cents($shipping_cost['shipping_costs_including_vat']);
                 } else {
                     $return_data['shipping_cost'][$row2['zone_id']][$shipping_code][$row2['cn_iso_nr']] = $shipping_cost['shipping_costs'];
                     $return_data['shipping_costs_display'][$row2['zone_id']][$shipping_code][$row2['cn_iso_nr']] = mslib_fe::amount2Cents($shipping_cost['shipping_costs']);
                 }
                 $return_data['deliver_to'][$row2['zone_id']][$shipping_code][$row2['cn_iso_nr']] = htmlspecialchars(mslib_fe::getTranslatedCountryNameByEnglishName($this->lang, $row2['cn_short_en']));
                 $return_data['deliver_by'][$row2['zone_id']][$shipping_code][$row2['cn_iso_nr']] = $shipping_cost['deliver_by'];
                 $return_data['shipping_method'][$row2['zone_id']][$shipping_code][$row2['cn_iso_nr']] = $shipping_cost;
                 $return_data['products_name'] = $shipping_cost['product_name'];
             }
         }
         echo json_encode($return_data);
     }
     exit;
     break;
 case 'get_images_for_crop':
     switch ($this->get['tx_multishop_pi1']['crop_section']) {
         case 'manufacturers':
             $image_type = 'manufacturers';
$subpartArray['###HEADER_INVOICES_DATE_LAST_SENT###'] = $this->pi_getLL('date_last_sent');
$subpartArray['###HEADER_INVOICES_PAID_STATUS###'] = $this->pi_getLL('admin_paid');
$subpartArray['###HEADER_INVOICES_ACTION###'] = $this->pi_getLL('action');
//
$subpartArray['###PAGINATION###'] = $pagination_listing;
$subpartArray['###INVOICES_LISTING###'] = $invoiceItem;
$subpartArray['###FORM_FIELDS_LISTING_ACTION_BLOCK###'] = $form_fields_listing_block;
//
$subpartArray['###FOOTER_INVOICES_NUMBER###'] = $this->pi_getLL('invoice_number');
$subpartArray['###FOOTER_INVOICES_ORDER_ID###'] = $this->pi_getLL('orders_id');
$subpartArray['###FOOTER_MASTER_SHOP###'] = $master_shop;
$subpartArray['###FOOTER_INVOICES_CUSTOMER###'] = $this->pi_getLL('customers');
$subpartArray['###FOOTER_INVOICES_ORDER_DATE###'] = $this->pi_getLL('order_date');
$subpartArray['###FOOTER_INVOICES_PAYMENT_METHOD###'] = $this->pi_getLL('payment_method');
$subpartArray['###FOOTER_INVOICES_PAYMENT_CONDITION###'] = $this->pi_getLL('payment_condition');
$subpartArray['###FOOTER_INVOICES_AMOUNT###'] = mslib_fe::amount2Cents($totalAmount, 0);
$subpartArray['###FOOTER_INVOICES_DATE_LAST_SENT###'] = $this->pi_getLL('date_last_sent');
$subpartArray['###FOOTER_INVOICES_PAID_STATUS###'] = $this->pi_getLL('admin_paid');
$subpartArray['###FOOTER_INVOICES_ACTION###'] = $this->pi_getLL('action');
$subpartArray['###CUSTOM_MARKER_0_HEADER###'] = '';
$subpartArray['###CUSTOM_MARKER_0_FOOTER###'] = '';
$subpartArray['###CUSTOM_MARKER_1_HEADER###'] = '';
$subpartArray['###CUSTOM_MARKER_1_FOOTER###'] = '';
$subpartArray['###SHOP_PID2###'] = $this->shop_pid;
$subpartArray['###FORM_POST_ACTION_URL###'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=admin_invoices');
// custom page hook that can be controlled by third-party plugin
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/includes/invoices/invoices_listing_table.php']['adminInvoicesListingTmplPreProc'])) {
    $params = array('subpartArray' => &$subpartArray, 'invoice' => &$invoice);
    foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/includes/invoices/invoices_listing_table.php']['adminInvoicesListingTmplPreProc'] as $funcRef) {
        \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
    }
        }
        if (!empty($discount_content)) {
            $coupon_code = '';
            if (!empty($orders['coupon_code'])) {
                $coupon_code = ' (code: ' . $orders['coupon_code'] . ')';
            }
            $content_discount = '
			<div class="account-field">
				<label>' . $this->pi_getLL('discount') . $coupon_code . '</label>
				<span class="order_total_value">' . $discount_content . '</span>
			</div>';
        }
        $content_total = '
		<div class="account-field">
			<label>' . $this->pi_getLL('total') . '</label>
			<span class="order_total_value">' . mslib_fe::amount2Cents($orders_tax_data['grand_total'], 0) . '</span>
		</div>';
        if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
            $tmpcontent .= $content_shipping_costs;
            $tmpcontent .= $content_payment_costs;
            $tmpcontent .= $content_discount;
            $tmpcontent .= $content_total;
            $tmpcontent .= $content_subtotal_tax;
        } else {
            if ($orders_tax_data['shipping_tax'] || $orders_tax_data['payment_tax']) {
                $tmpcontent .= $content_shipping_costs;
                $tmpcontent .= $content_payment_costs;
                $tmpcontent .= $content_discount;
                $tmpcontent .= $content_subtotal_tax;
                $tmpcontent .= $content_total;
            } else {
Beispiel #29
0
					' . $quantity_html . '
				</div>
				<input type="hidden" name="products_id" value="' . $current_product['products_id'] . '" />
				' . $button_submit . '
			</form>
		</div>
		';
        //$markerArray['MANUFACTURERS_ADVICE_PRICE']=mslib_fe::amount2Cents($current_product['manufacturers_advice_price']);
        $markerArray['MANUFACTURERS_ADVICE_PRICE'] = '';
        if ($current_product['manufacturers_advice_price']) {
            if (!$this->ms['MODULES']['DB_PRICES_INCLUDE_VAT'] && ($current_product['tax_rate'] && $this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT'])) {
                $amount = $current_product['manufacturers_advice_price'] * (1 + $current_product['tax_rate']);
            } else {
                $amount = $current_product['manufacturers_advice_price'];
            }
            $markerArray['MANUFACTURERS_ADVICE_PRICE'] = mslib_fe::amount2Cents($amount);
        }
        // ADD TO CART BUTTON WITH QUANTITY FIELD EOL
        $plugins_item_extra_content = array();
        // shipping cost popup
        if ($this->ms['MODULES']['DISPLAY_SHIPPING_COSTS_ON_PRODUCTS_LISTING_PAGE']) {
            $plugins_item_extra_content[] = '<div class="shipping_cost_popup_link_wrapper"><a href="#" class="show_shipping_cost_table" class="btn btn-primary" data-toggle="modal" data-target="#productsListingShippingCostsModal" data-productid="' . $current_product['products_id'] . '"><span>' . $this->pi_getLL('shipping_costs') . '</span></a></div>';
        }
        // custom hook that can be controlled by third-party plugin
        if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/front_pages/products_listing.php']['productsListingRecordHook'])) {
            $params = array('markerArray' => &$markerArray, 'product' => &$current_product, 'output' => &$output, 'products_compare' => &$products_compare, 'plugins_item_extra_content' => &$plugins_item_extra_content, 'limit_per_page' => &$limit_per_page, 'p' => &$p);
            foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/front_pages/products_listing.php']['productsListingRecordHook'] as $funcRef) {
                \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
            }
        }
        $markerArray['PRODUCT_LISTING_ITEM_PLUGIN_EXTRA_CONTENT'] = '';
Beispiel #30
0
     $old_price = $product['products_price'];
 }
 $special_section_price = '';
 $current_product = $product;
 if ($current_product['tax_rate'] and $this->ms['MODULES']['SHOW_PRICES_WITH_AND_WITHOUT_VAT']) {
     $output['products_price'] .= '<div class="price_excluding_vat">' . $this->pi_getLL('excluding_vat') . ' ' . mslib_fe::amount2Cents($current_product['final_price']) . '</div>';
 }
 if ($current_product['products_price'] != $current_product['final_price']) {
     if (!$this->ms['MODULES']['DB_PRICES_INCLUDE_VAT'] and ($current_product['tax_rate'] and $this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT'])) {
         $old_price = $current_product['products_price'] * (1 + $current_product['tax_rate']);
     } else {
         $old_price = $current_product['products_price'];
     }
     $output['products_price'] .= '<div class="old_price">' . mslib_fe::amount2Cents($old_price) . '</div><div class="specials_price">' . mslib_fe::amount2Cents($final_price) . '</div>';
 } else {
     $output['products_price'] .= '<div class="price">' . mslib_fe::amount2Cents($final_price) . '</div>';
 }
 $output['special_section_price'] = $output['products_price'];
 /*
 if ($old_price and $final_price) {
     $output['special_section_price']='<div class="old_price">'.mslib_fe::amount2Cents($old_price).'</div><div class="specials_price">'.mslib_fe::amount2Cents($final_price).'</div>';
 } else {
     $output['special_section_price']='<div class="price">'.mslib_fe::amount2Cents($final_price).'</div>';
 }
 */
 $output['products_name'] = htmlspecialchars($product['products_name']);
 $markerArray['ITEM_PRODUCTS_ID'] = $product['products_id'];
 $markerArray['ITEM_DETAILS_PAGE_LINK'] = $output['link'];
 $markerArray['ITEM_PRODUCTS_NAME'] = $output['products_name'];
 $markerArray['ITEM_PRODUCTS_PRICE'] = $output['special_section_price'];
 $markerArray['ITEM_LABEL_SHIPPING_COSTS_OVERVIEW'] = '';