本文整理汇总了PHP中mslib_fe::getProduct方法的典型用法代码示例。如果您正苦于以下问题:PHP mslib_fe::getProduct方法的具体用法?PHP mslib_fe::getProduct怎么用?PHP mslib_fe::getProduct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mslib_fe
的用法示例。
在下文中一共展示了mslib_fe::getProduct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: while
}
}
}
}
} else {
if (isset($this->get['valid'])) {
$sql_option = "select pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.options_values_id, pa.price_prefix from tx_multishop_products_attributes pa, tx_multishop_products_options_values pov, tx_multishop_products_options_values_to_products_options povp where pa.products_id = '" . $this->get['pid'] . "' and pa.page_uid='" . $this->showCatalogFromPage . "' and pa.options_id = '" . $this->get['optid'] . "' and pa.options_values_id='" . $this->get['valid'] . "' and pov.language_id = '" . $this->sys_language_uid . "' and pa.options_values_id = pov.products_options_values_id and povp.products_options_values_id=pov.products_options_values_id order by pa.sort_order_option_name asc, pa.sort_order_option_value asc";
} else {
$sql_option = "select pa.sort_order_option_name, pa.sort_order_option_value, pov.products_options_values_id, pov.products_options_values_name, pa.options_values_price, pa.options_values_id, pa.price_prefix from tx_multishop_products_attributes pa, tx_multishop_products_options_values pov, tx_multishop_products_options_values_to_products_options povp where pa.products_id = '" . $this->get['pid'] . "' and pa.page_uid='" . $this->showCatalogFromPage . "' and pa.options_id = '" . $this->get['optid'] . "' and pov.language_id = '" . $this->sys_language_uid . "' and povp.products_options_id='" . $this->get['optid'] . "' and pa.options_values_id = pov.products_options_values_id and povp.products_options_values_id=pov.products_options_values_id and povp.products_options_id=pa.options_id order by pa.sort_order_option_name asc, pa.sort_order_option_value asc";
}
//var_dump($sql_option);
$qry_option = $GLOBALS['TYPO3_DB']->sql_query($sql_option);
$ctr = 0;
if ($GLOBALS['TYPO3_DB']->sql_num_rows($qry_option) > 0) {
while (($rs_option = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry_option)) != false) {
$product = mslib_fe::getProduct($this->get['pid'], '', '', 1, 1);
$data = mslib_fe::getTaxRuleSet($product['tax_id'], $product['products_price']);
$product_tax_rate = $data['total_tax_rate'];
$attributes_tax = mslib_fe::taxDecimalCrop($rs_option['options_values_price'] * $product_tax_rate / 100);
$attribute_price_display_incl = mslib_fe::taxDecimalCrop($rs_option['options_values_price'] + $attributes_tax, 2, false, false);
$option_data[$ctr]['sort_order'] = (int) $rs_option['sort_order_option_name'];
$option_data[$ctr]['optid'] = $this->get['optid'];
$option_data[$ctr]['valid'] = $rs_option['options_values_id'];
$option_data[$ctr]['valname'] = $rs_option['products_options_values_name'];
$option_data[$ctr]['values_price'] = $rs_option['options_values_price'];
$option_data[$ctr]['display_values_price'] = mslib_fe::taxDecimalCrop($rs_option['options_values_price'], 2, false, false);
$option_data[$ctr]['display_values_price_including_vat'] = $attribute_price_display_incl;
$option_data[$ctr]['price_prefix'] = $rs_option['price_prefix'];
$ctr++;
}
}
示例2: foreach
foreach ($cart['products'] as $shopping_cart_item => $value) {
if (!isset($value['products_id']) || isset($value['products_id']) && !$value['products_id']) {
$count_product = 0;
}
}
}
if ($count_product > 0) {
$output['shopping_cart_form_action_url'] = mslib_fe::typolink($this->conf['shoppingcart_page_pid'], '&tx_multishop_pi1[page_section]=shopping_cart');
$output['col_header_shopping_cart_product'] = ucfirst($this->pi_getLL('product'));
$output['col_header_shopping_cart_qty'] = ucfirst($this->pi_getLL('qty'));
$output['col_header_shopping_cart_total'] = ucfirst($this->pi_getLL('total'));
$contentItem = '';
foreach ($cart['products'] as $shopping_cart_item => $value) {
if (is_numeric($value['products_id'])) {
$ordered_qty = $value['qty'];
$product_info = mslib_fe::getProduct($value['products_id']);
$products_id = $value['products_id'];
$product = $value;
if (!$output['product_row_type'] || $output['product_row_type'] == 'even') {
$output['product_row_type'] = 'odd';
} else {
$output['product_row_type'] = 'even';
}
if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
if ($value['country_tax_rate'] && $value['region_tax_rate']) {
$country_tax_rate = mslib_fe::taxDecimalCrop($value['final_price'] * $value['country_tax_rate']);
$region_tax_rate = mslib_fe::taxDecimalCrop($value['final_price'] * $value['region_tax_rate']);
$tax_rate = $country_tax_rate + $region_tax_rate;
} else {
$tax_rate = mslib_fe::taxDecimalCrop($value['final_price'] * $value['tax_rate']);
}
示例3: array
// lets create the products sitemap
if (!$this->get['skip_products']) {
$filterProducts = array();
$filterProducts[] = 'products_status=1';
$filterProducts[] = 'page_uid=' . $this->showCatalogFromPage;
// hook
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/admin_sitemap_generator.php']['sitemapGeneratorProductsQueryFilter'])) {
$params = array('filterProducts' => &$filterProducts);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/admin_pages/admin_sitemap_generator.php']['sitemapGeneratorProductsQueryFilter'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
}
// hook eof
$qry = $GLOBALS['TYPO3_DB']->sql_query("SELECT products_id from tx_multishop_products where " . implode(" and ", $filterProducts));
while (($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) != false) {
$product = mslib_fe::getProduct($row['products_id']);
$where = '';
if ($product['categories_id']) {
// get all cats to generate multilevel fake url
$level = 0;
$cats = mslib_fe::Crumbar($product['categories_id']);
$cats = array_reverse($cats);
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
示例4: array
$tmpcontent .= '<td align="right" class="cell_products_normal_price" id="edit_order_product_price">';
if ($this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
$tmpcontent .= '<input class="text" style="width:44px" type="text" id="display_product_price" value="' . ($order['final_price'] + $order_products_tax_data['total_tax']) . '" />
<input type="hidden" name="product_price" id="product_price" value="' . $order['final_price'] . '" />';
} else {
$tmpcontent .= '<input class="text" style="width:44px" type="text" name="product_price" id="product_price" value="' . $order['final_price'] . '" />';
}
$tmpcontent .= '</td>';
if (!$this->ms['MODULES']['SHOW_PRICES_INCLUDING_VAT']) {
$tmpcontent .= $vat_input_row_col;
}
$tmpcontent .= $total_product_row_col;
} else {
$row = array();
$where = '';
$product = mslib_fe::getProduct($order['products_id']);
if ($product['categories_id']) {
// get all cats to generate multilevel fake url
$level = 0;
$cats = mslib_fe::Crumbar($product['categories_id']);
$cats = array_reverse($cats);
$where = '';
if (count($cats) > 0) {
foreach ($cats as $cat) {
$where .= "categories_id[" . $level . "]=" . $cat['id'] . "&";
$level++;
}
$where = substr($where, 0, strlen($where) - 1);
$where .= '&';
}
// get all cats to generate multilevel fake url eof
示例5: array
$return_data['option_id'] = $option_id;
$return_data['option_value_id'] = $option_value_id;
$return_data['option_name'] = mslib_fe::getRealNameOptions($option_id);
$return_data['option_value_name'] = mslib_fe::getNameOptions($option_value_id);
$return_data['data_id'] = $this->post['data_id'];
$return_data['delete_status'] = 'notok';
$have_entries_in_pa_table = false;
if ($option_value_id > 0) {
$str = "select products_id from tx_multishop_products_attributes where options_id='" . $option_id . "' and options_values_id=" . $option_value_id;
$qry = $GLOBALS['TYPO3_DB']->sql_query($str);
$total_product = $GLOBALS['TYPO3_DB']->sql_num_rows($qry);
if ($total_product > 0) {
$ctr = 0;
$return_data['products'] = array();
while ($rs = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) {
$product = mslib_fe::getProduct($rs['products_id'], '', '', 1);
if (!empty($product['products_name'])) {
$return_data['products'][$ctr]['name'] = $product['products_name'];
$return_data['products'][$ctr]['link'] = mslib_fe::typolink($this->shop_pid . ',2003', 'tx_multishop_pi1[page_section]=edit_product&pid=' . $rs['products_id'] . '&cid=' . $product['categories_id'] . '&action=edit_product');
$ctr++;
} else {
$have_entries_in_pa_table = true;
$total_product--;
}
}
}
if (!$total_product && $have_entries_in_pa_table) {
$this->get['force_delete'] = 1;
}
if (isset($this->get['force_delete']) && $this->get['force_delete'] == 1) {
//if (!$total_product) {
示例6: updateCart
function updateCart()
{
if (!$this->ms['MODULES']['ALLOW_ORDER_OUT_OF_STOCK_PRODUCT']) {
$product_id = $this->post['products_id'];
if (is_numeric($this->get['products_id']) and $this->get['tx_multishop_pi1']['action'] == 'add_to_cart') {
$product_id = $this->get['products_id'];
}
if (is_numeric($product_id)) {
$product = mslib_fe::getProduct($product_id);
if ($product['products_quantity'] < 1 && !$this->ms['MODULES']['ALLOW_ORDER_OUT_OF_STOCK_PRODUCT']) {
if ($product['categories_id']) {
// get all cats to generate multilevel fake url
$level = 0;
$cats = mslib_fe::Crumbar($product['categories_id']);
$cats = array_reverse($cats);
$where = '';
if (count($cats) > 0) {
foreach ($cats as $cat) {
$where .= "categories_id[" . $level . "]=" . $cat['id'] . "&";
$level++;
}
$where = substr($where, 0, strlen($where) - 1);
}
}
$link = mslib_fe::typolink($this->conf['products_detail_page_pid'], '&' . $where . '&products_id=' . $product_id . '&tx_multishop_pi1[page_section]=products_detail');
header("Location: " . $this->FULL_HTTP_URL . $link);
exit;
}
}
}
// error_log("bastest");
// hook
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['updateCart'])) {
$params = array();
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['updateCart'] as $funcRef) {
$content .= \TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
} else {
// custom hook that can be controlled by third-party plugin
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['updateCartPreHook'])) {
$params = array('get' => &$this->get, 'post' => &$this->post);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['updateCartPreHook'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
}
// custom hook that can be controlled by third-party plugin eof
$GLOBALS['dont_update_cart'] = 1;
//$cart=$GLOBALS['TSFE']->fe_user->getKey('ses', $this->cart_page_uid);
require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('multishop') . 'pi1/classes/class.tx_mslib_cart.php';
$mslib_cart = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_mslib_cart');
$mslib_cart->init($this);
$cart = $mslib_cart->getCart();
if (is_numeric($this->get['products_id']) and $this->get['tx_multishop_pi1']['action'] == 'add_to_cart') {
$this->post['products_id'] = $this->get['products_id'];
}
if (is_numeric($this->post['products_id'])) {
$shopping_cart_item = $this->post['products_id'];
if ($this->post['tx_multishop_pi1']['cart_item']) {
$shopping_cart_item = $this->post['tx_multishop_pi1']['cart_item'];
} elseif (is_array($this->post['attributes'])) {
$shopping_cart_item = md5($this->post['products_id'] . serialize($this->post['attributes']));
}
// custom hook that can be controlled by third-party plugin
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['updateCartSetShoppingCartItemPostProc'])) {
$params = array('shopping_cart_item' => $shopping_cart_item, 'product' => &$product);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/pi1/classes/class.mslib_fe.php']['updateCartSetShoppingCartItemPostProc'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
}
// custom hook that can be controlled by third-party plugin eof
if (is_numeric($cart['products'][$shopping_cart_item]['products_id'])) {
$products_id = $cart['products'][$shopping_cart_item]['products_id'];
} else {
$products_id = $this->post['products_id'];
}
$product = mslib_fe::getProduct($products_id);
if ($product['products_id']) {
$product['products_shortdescription_raw'] = $product['products_shortdescription'];
$product['products_description_raw'] = $product['products_description'];
if ($product['products_image']) {
$product['products_image_200'] = mslib_befe::getImagePath($product['products_image'], 'products', '200');
$product['products_image'] = mslib_befe::getImagePath($product['products_image'], 'products', '50');
}
//
$query = $GLOBALS['TYPO3_DB']->SELECTquery('pa.*', 'tx_multishop_products_attributes pa, tx_multishop_products_options po', 'pa.products_id="' . addslashes($product['products_id']) . '" and pa.page_uid=\'' . $this->showCatalogFromPage . '\' and po.hide!=1 and po.hide_in_cart!=1 and po.language_id=' . $this->sys_language_uid . ' and po.products_options_id=pa.options_id', '', 'pa.sort_order_option_name asc, pa.sort_order_option_value asc', '');
$product_attributes = array();
$res = $GLOBALS['TYPO3_DB']->sql_query($query);
if ($GLOBALS['TYPO3_DB']->sql_num_rows($res) > 0) {
while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
$product_attributes[$row['options_id']][] = $row['options_values_id'];
}
}
//
//if (mslib_fe::ProductHasAttributes($product['products_id']) and !count($this->post['attributes'])) {
if (is_array($product_attributes) && count($product_attributes) && !count($this->post['attributes'])) {
// Product has attributes. We need to redirect the customer to the product detail page so the attributes can be selected
if ($product['categories_id']) {
// get all cats to generate multilevel fake url
$level = 0;
$cats = mslib_fe::Crumbar($product['categories_id']);
//.........这里部分代码省略.........
示例7: checkoutValidateProductStatus
public function checkoutValidateProductStatus($product_id)
{
$product = mslib_fe::getProduct($product_id, '', '', 1, 1);
if (!$product || !$product['products_status']) {
return false;
}
return true;
}
示例8: die
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
$output = array();
$js_detail_page_triggers = array();
if ($this->ADMIN_USER) {
$include_disabled_products = 1;
} else {
$include_disabled_products = 0;
}
$product = mslib_fe::getProduct($this->get['products_id'], $this->get['categories_id'], '', $include_disabled_products);
if (!$product['products_id']) {
header('HTTP/1.0 404 Not Found');
$output_array['http_header'] = 'HTTP/1.0 404 Not Found';
// set custom 404 message
$page = mslib_fe::getCMScontent('product_not_found_message', $GLOBALS['TSFE']->sys_language_uid);
if ($page[0]['name']) {
$content = '<div class="main-title"><h1>' . $page[0]['name'] . '</h1></div>';
} else {
$content = '<div class="main-title"><h1>' . $this->pi_getLL('the_requested_product_does_not_exist') . '</h1></div>';
}
if ($page[0]['content']) {
$content .= $page[0]['content'];
}
} else {
if ($this->conf['imageWidth']) {
$this->imageWidth = $this->conf['imageWidth'];
}
if (!$this->imageWidth) {
示例9: getOrderWeight
function getOrderWeight($orders_id)
{
if (is_numeric($orders_id)) {
$weight = 0;
$order = mslib_fe::getOrder($orders_id);
foreach ($order['products'] as $product) {
if (is_numeric($product['products_id'])) {
$product_db = mslib_fe::getProduct($product['products_id']);
$weight = $weight + $product['qty'] * $product_db['products_weight'];
}
}
return $weight;
}
}
示例10: explode
// 1.23 corrected to 1.2
$qty_decimal_correction = '';
if (strstr($qty, ".")) {
$decimals = explode('.', $qty);
if (strlen($decimals[1]) > 1) {
$decimals[1] = $decimals[1][0];
$qty = implode('.', $decimals);
$qty_decimal_correction = $qty;
}
}
// caller marker for the mslib_fe::getProduct
$this->post['caller_script'] = 'get_staffel_price';
if ($this->ADMIN_USER) {
$product = mslib_fe::getProduct($products_id, '', '', 1);
} else {
$product = mslib_fe::getProduct($products_id);
}
// hook
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/ajax_pages/get_staffel_price.php']['getProductPostProc'])) {
$params = array('products_id' => &$products_id, 'product' => &$product);
foreach ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/ajax_pages/get_staffel_price.php']['getProductPostProc'] as $funcRef) {
\TYPO3\CMS\Core\Utility\GeneralUtility::callUserFunction($funcRef, $params, $this);
}
}
// hook eof
$disableFeFromCalculatingVatPrices = $this->conf['disableFeFromCalculatingVatPrices'];
$this->conf['disableFeFromCalculatingVatPrices'] = 1;
$exclude_vat_price = mslib_fe::final_products_price($product, $qty, 0) * $qty;
$this->conf['disableFeFromCalculatingVatPrices'] = $disableFeFromCalculatingVatPrices;
// count normal price
$price = mslib_fe::final_products_price($product, $qty, 0) * $qty;
示例11: while
<tr class="' . $tr_type . '">
<th valign="top">Qty</td>
<th valign="top">Product</td>
</tr>
';
$total_amount = 0;
while (($product = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($qry)) != false) {
if (!$tr_type or $tr_type == 'even') {
$tr_type = 'odd';
} else {
$tr_type = 'even';
}
$where = '';
if (!$product['categories_id']) {
// fix fold old orders that did not have categories id in orders_products table
$tmpProduct = mslib_fe::getProduct($product['products_id']);
$product['categories_id'] = $tmpProduct;
}
if ($product['categories_id']) {
// get all cats to generate multilevel fake url
$level = 0;
$cats = mslib_fe::Crumbar($product['categories_id']);
$cats = array_reverse($cats);
$where = '';
if (count($cats) > 0) {
foreach ($cats as $cat) {
$where .= "categories_id[" . $level . "]=" . $cat['id'] . "&";
$level++;
}
$where = substr($where, 0, strlen($where) - 1);
}
示例12: die
<?php
if (!defined('TYPO3_MODE')) {
die('Access denied.');
}
require_once \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath('multishop') . 'pi1/classes/class.tx_mslib_cart.php';
$mslib_cart = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('tx_mslib_cart');
$mslib_cart->init($this);
$data = array();
if ($this->post['products_id']) {
$product = mslib_fe::getProduct($this->post['products_id']);
if ($product['products_id']) {
$mslib_cart->updateCart();
$data['added_product']['products_name'] = $product['products_name'];
$data['added_product']['products_model'] = $product['products_model'];
}
}
//$cart = $GLOBALS['TSFE']->fe_user->getKey('ses',$this->cart_page_uid);
$cart = $mslib_cart->getCart();
$totalitems = 0;
if (count($cart['products']) > 0) {
foreach ($cart['products'] as $product) {
if ($product['qty'] > 0) {
$totalitems = $totalitems + $product['qty'];
}
}
}
$totalitems = ceil($totalitems);
// hook
if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['ext/multishop/scripts/ajax_pages/products_to_basket.php']['CartItemsCountLabelPostHook'])) {
$params = array('cart' => &$cart, 'totalitems' => &$totalitems);
示例13:
mslib_befe::enableProduct($rs_product['products_id']);
}
}
}
if ($rs_product['products_status'] == '1' && $rs_product['endtime'] > 0) {
if ($rs_product['endtime'] <= $current_tstamp) {
mslib_befe::disableProduct($rs_product['products_id']);
}
}
}
}
}
}
if (is_numeric($this->get['products_id'])) {
// overwrite multishop settings loaded from the product
$product = mslib_fe::getProduct($this->get['products_id'], $this->get['categories_id'], 'p.custom_settings', 1, 1);
if ($product['custom_settings']) {
mslib_fe::updateCustomSettings($product['custom_settings']);
}
}
// overwrite multishop settings loaded from the content element
if ($this->customSettings) {
mslib_fe::updateCustomSettings($this->customSettings);
}
// overwrite multishop settings loaded from the content element eof
if (!$this->conf['admin_template_folder']) {
$this->conf['admin_template_folder'] = 'admin_multishop';
}
// reset the fileadmin admin folder to local plugin location
if (!$this->conf['search_page_pid']) {
$this->conf['search_page_pid'] = $this->shop_pid;
示例14: printInvoiceOrderDetailsTable
//.........这里部分代码省略.........
// 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;
示例15: foreach
<th class="cellModel">' . $this->pi_getLL('products_model') . '</th>
<th class="cellName">' . $this->pi_getLL('products_name') . '</th>
</tr></thead>';
}
$total_tax = 0;
foreach ($order['products'] as $product) {
if (!$tr_type or $tr_type == 'even') {
$tr_type = 'odd';
} else {
$tr_type = 'even';
}
$tmpcontent .= '<tr class="' . $tr_type . '">';
$tmpcontent .= '<td class="cellQty">' . number_format($product['qty']) . '</td>';
$tmpcontent .= '<td class="cellID">' . $product['products_id'] . '</td>';
$tmpcontent .= '<td class="cellModel">' . $product['products_model'] . '</td>';
$product_tmp = mslib_fe::getProduct($product['products_id']);
if ($this->ms['MODULES']['DISPLAY_PRODUCT_IMAGE_IN_ADMIN_PACKING_SLIP'] and $product_tmp['products_image']) {
$tmpcontent .= '<td class="cellName"><strong>';
$tmpcontent .= '<img src="' . mslib_befe::getImagePath($product_tmp['products_image'], 'products', '50') . '"> ';
$tmpcontent .= $product['products_name'];
} else {
$tmpcontent .= '<td class="cellName"><strong>' . $product['products_name'];
}
if ($product['products_article_number']) {
$tmpcontent .= ' (' . $product['products_article_number'] . ')';
}
$tmpcontent .= '</strong>';
if ($this->ms['MODULES']['DISPLAY_EAN_IN_ORDER_DETAILS'] == '1' && !empty($product['ean_code'])) {
$tmpcontent .= '<br/>' . $this->pi_getLL('admin_label_ean') . ': ' . $product['ean_code'];
}
if ($this->ms['MODULES']['DISPLAY_SKU_IN_ORDER_DETAILS'] == '1' && !empty($product['sku_code'])) {