public function __construct($id_shop = null, $id_lang = null, $id_store = null) { if (empty($id_shop)) { parent::__construct($id_store, $id_lang); $shop = Db::getInstance()->getRow('SELECT sh.* FROM `' . _DB_PREFIX_ . 'store_shop` ss JOIN `' . _DB_PREFIX_ . 'shop` sh ON ss.id_shop=sh.id_shop WHERE ss.id_store = ' . (int) $this->id); $this->id_shop = (int) $shop['id_shop']; $this->bg_color = $this->bo_color; $this->text_color = Tools::getBrightness($this->bo_color) < 128 ? 'white' : '#383838'; } else { $this->id_shop = $id_shop; $shop = Db::getInstance()->getRow('SELECT ss.id_store,sh.id_shop_group FROM `' . _DB_PREFIX_ . 'store_shop` ss JOIN `' . _DB_PREFIX_ . 'shop` sh ON ss.id_shop=sh.id_shop WHERE sh.id_shop = ' . (int) $id_shop); $this->id = (int) $shop['id_store']; parent::__construct($this->id, $id_lang); $this->bg_color = $this->bo_color; $this->text_color = Tools::getBrightness($this->bo_color) < 128 ? 'white' : '#383838'; } $this->id_owner = Db::getInstance()->getValue('SELECT id_employee FROM `' . _DB_PREFIX_ . 'employee_shop` a JOIN `' . _DB_PREFIX_ . '_employee` e ON a.id_employee = e.id_employee WHERE id_shop = ' . $this->id_shop . ' AND id_profile = ' . Configuration::get('APH_PROFILE_STORE_OWNER')); $this->id_shop_group = (int) $shop['id_shop_group']; $url = Db::getInstance()->getRow('SELECT * FROM `' . _DB_PREFIX_ . 'shop_url` WHERE id_shop = ' . $this->id_shop); $this->link_rewrite = $url['virtual_uri']; $this->full_address = '-----'; //TODO }
function content_56277f85ed24d4_90701549($_smarty_tpl) { if (!is_callable('smarty_modifier_replace')) { include '/home/u481889647/public_html/tools/smarty/plugins/modifier.replace.php'; } if (!is_callable('smarty_function_counter')) { include '/home/u481889647/public_html/tools/smarty/plugins/function.counter.php'; } if (!is_callable('smarty_modifier_regex_replace')) { include '/home/u481889647/public_html/tools/smarty/plugins/modifier.regex_replace.php'; } if (isset($_smarty_tpl->tpl_vars['order']->value)) { if (isset($_smarty_tpl->tpl_vars['reorderingAllowed']->value) && $_smarty_tpl->tpl_vars['reorderingAllowed']->value) { ?> <div class="box box-small clearfix"> <form id="submitReorder" action="<?php if (isset($_smarty_tpl->tpl_vars['opc']->value) && $_smarty_tpl->tpl_vars['opc']->value) { echo $_smarty_tpl->tpl_vars['link']->value->getPageLink('order-opc', true); } else { echo $_smarty_tpl->tpl_vars['link']->value->getPageLink('order', true); } ?> " method="post" class="submit"> <input type="hidden" value="<?php echo $_smarty_tpl->tpl_vars['order']->value->id; ?> " name="id_order"/> <input type="hidden" value="" name="submitReorder"/> <a href="#" onclick="$(this).closest('form').submit(); return false;" class="button btn btn-default button-medium pull-right"><span><?php echo smartyTranslate(array('s' => 'Reorder'), $_smarty_tpl); ?> <i class="icon-chevron-right right"></i></span></a> <p class="dark"> <strong><?php echo smartyTranslate(array('s' => 'Order Reference %s - placed on', 'sprintf' => $_smarty_tpl->tpl_vars['order']->value->getUniqReference()), $_smarty_tpl); ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['dateFormat'][0][0]->dateFormat(array('date' => $_smarty_tpl->tpl_vars['order']->value->date_add, 'full' => 0), $_smarty_tpl); ?> </strong> </p> </form> </div> <?php } ?> <div class="info-order box"> <?php if ($_smarty_tpl->tpl_vars['carrier']->value->id) { ?> <p><strong class="dark"><?php echo smartyTranslate(array('s' => 'Carrier'), $_smarty_tpl); ?> </strong> <?php if ($_smarty_tpl->tpl_vars['carrier']->value->name == "0") { echo htmlspecialchars($_smarty_tpl->tpl_vars['shop_name']->value, ENT_QUOTES, 'UTF-8', true); } else { echo htmlspecialchars($_smarty_tpl->tpl_vars['carrier']->value->name, ENT_QUOTES, 'UTF-8', true); } ?> </p><?php } ?> <p><strong class="dark"><?php echo smartyTranslate(array('s' => 'Payment method'), $_smarty_tpl); ?> </strong> <span class="color-myaccount"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value->payment, ENT_QUOTES, 'UTF-8', true); ?> </span></p> <?php if ($_smarty_tpl->tpl_vars['invoice']->value && $_smarty_tpl->tpl_vars['invoiceAllowed']->value) { ?> <p> <i class="icon-file-text"></i> <a target="_blank" href="<?php echo $_smarty_tpl->tpl_vars['link']->value->getPageLink('pdf-invoice', true); ?> ?id_order=<?php echo intval($_smarty_tpl->tpl_vars['order']->value->id); if ($_smarty_tpl->tpl_vars['is_guest']->value) { ?> &secure_key=<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value->secure_key, ENT_QUOTES, 'UTF-8', true); } ?> "><?php echo smartyTranslate(array('s' => 'Download your invoice as a PDF file.'), $_smarty_tpl); ?> </a> </p> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['order']->value->recyclable) { ?> <p><i class="icon-repeat"></i> <?php echo smartyTranslate(array('s' => 'You have given permission to receive your order in recycled packaging.'), $_smarty_tpl); ?> </p> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['order']->value->gift) { ?> <p><i class="icon-gift"></i> <?php echo smartyTranslate(array('s' => 'You have requested gift wrapping for this order.'), $_smarty_tpl); ?> </p> <p><strong class="dark"><?php echo smartyTranslate(array('s' => 'Message'), $_smarty_tpl); ?> </strong> <?php echo nl2br($_smarty_tpl->tpl_vars['order']->value->gift_message); ?> </p> <?php } ?> </div> <?php if (count($_smarty_tpl->tpl_vars['order_history']->value)) { ?> <h1 class="page-heading"><?php echo smartyTranslate(array('s' => 'Follow your order\'s status step-by-step'), $_smarty_tpl); ?> </h1> <div class="table_block"> <table class="detail_step_by_step table table-bordered"> <thead> <tr> <th class="first_item"><?php echo smartyTranslate(array('s' => 'Date'), $_smarty_tpl); ?> </th> <th class="last_item"><?php echo smartyTranslate(array('s' => 'Status'), $_smarty_tpl); ?> </th> </tr> </thead> <tbody> <?php $_smarty_tpl->tpl_vars['state'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['state']->_loop = false; $_from = $_smarty_tpl->tpl_vars['order_history']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['state']->total = $_smarty_tpl->_count($_from); $_smarty_tpl->tpl_vars['state']->iteration = 0; $_smarty_tpl->tpl_vars['state']->index = -1; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["orderStates"]['index'] = -1; foreach ($_from as $_smarty_tpl->tpl_vars['state']->key => $_smarty_tpl->tpl_vars['state']->value) { $_smarty_tpl->tpl_vars['state']->_loop = true; $_smarty_tpl->tpl_vars['state']->iteration++; $_smarty_tpl->tpl_vars['state']->index++; $_smarty_tpl->tpl_vars['state']->first = $_smarty_tpl->tpl_vars['state']->index === 0; $_smarty_tpl->tpl_vars['state']->last = $_smarty_tpl->tpl_vars['state']->iteration === $_smarty_tpl->tpl_vars['state']->total; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["orderStates"]['first'] = $_smarty_tpl->tpl_vars['state']->first; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["orderStates"]['index']++; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["orderStates"]['last'] = $_smarty_tpl->tpl_vars['state']->last; ?> <tr class="<?php if ($_smarty_tpl->getVariable('smarty')->value['foreach']['orderStates']['first']) { ?> first_item<?php } elseif ($_smarty_tpl->getVariable('smarty')->value['foreach']['orderStates']['last']) { ?> last_item<?php } ?> <?php if ($_smarty_tpl->getVariable('smarty')->value['foreach']['orderStates']['index'] % 2) { ?> alternate_item<?php } else { ?> item<?php } ?> "> <td class="step-by-step-date"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['dateFormat'][0][0]->dateFormat(array('date' => $_smarty_tpl->tpl_vars['state']->value['date_add'], 'full' => 0), $_smarty_tpl); ?> </td> <td><span<?php if (isset($_smarty_tpl->tpl_vars['state']->value['color']) && $_smarty_tpl->tpl_vars['state']->value['color']) { ?> style="background-color:<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['state']->value['color'], ENT_QUOTES, 'UTF-8', true); ?> ; border-color:<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['state']->value['color'], ENT_QUOTES, 'UTF-8', true); ?> ;"<?php } ?> class="label<?php if (isset($_smarty_tpl->tpl_vars['state']->value['color']) && Tools::getBrightness($_smarty_tpl->tpl_vars['state']->value['color']) > 128) { ?> dark<?php } ?> "><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['state']->value['ostate_name'], ENT_QUOTES, 'UTF-8', true); ?> </span></td> </tr> <?php } ?> </tbody> </table> </div> <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['followup']->value)) { ?> <p class="bold"><?php echo smartyTranslate(array('s' => 'Click the following link to track the delivery of your order'), $_smarty_tpl); ?> </p> <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['followup']->value, ENT_QUOTES, 'UTF-8', true); ?> "><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['followup']->value, ENT_QUOTES, 'UTF-8', true); ?> </a> <?php } ?> <div class="adresses_bloc"> <div class="row"> <div class="col-xs-12 col-sm-6"<?php if ($_smarty_tpl->tpl_vars['order']->value->isVirtual()) { ?> style="display:none;"<?php } ?> > <ul class="address alternate_item box"> <li><h3 class="page-subheading"><?php echo smartyTranslate(array('s' => 'Delivery address'), $_smarty_tpl); ?> (<?php echo $_smarty_tpl->tpl_vars['address_delivery']->value->alias; ?> )</h3></li> <?php $_smarty_tpl->tpl_vars['field_item'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['field_item']->_loop = false; $_from = $_smarty_tpl->tpl_vars['dlv_adr_fields']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['field_item']->key => $_smarty_tpl->tpl_vars['field_item']->value) { $_smarty_tpl->tpl_vars['field_item']->_loop = true; ?> <?php if ($_smarty_tpl->tpl_vars['field_item']->value == "company" && isset($_smarty_tpl->tpl_vars['address_delivery']->value->company)) { ?> <li class="address_company"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['address_delivery']->value->company, ENT_QUOTES, 'UTF-8', true); ?> </li> <?php } elseif ($_smarty_tpl->tpl_vars['field_item']->value == "address2" && $_smarty_tpl->tpl_vars['address_delivery']->value->address2) { ?> <li class="address_address2"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['address_delivery']->value->address2, ENT_QUOTES, 'UTF-8', true); ?> </li> <?php } elseif ($_smarty_tpl->tpl_vars['field_item']->value == "phone_mobile" && $_smarty_tpl->tpl_vars['address_delivery']->value->phone_mobile) { ?> <li class="address_phone_mobile"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['address_delivery']->value->phone_mobile, ENT_QUOTES, 'UTF-8', true); ?> </li> <?php } else { ?> <?php $_smarty_tpl->tpl_vars['address_words'] = new Smarty_variable(explode(" ", $_smarty_tpl->tpl_vars['field_item']->value), null, 0); ?> <li><?php $_smarty_tpl->tpl_vars['word_item'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['word_item']->_loop = false; $_from = $_smarty_tpl->tpl_vars['address_words']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['word_item']->index = -1; foreach ($_from as $_smarty_tpl->tpl_vars['word_item']->key => $_smarty_tpl->tpl_vars['word_item']->value) { $_smarty_tpl->tpl_vars['word_item']->_loop = true; $_smarty_tpl->tpl_vars['word_item']->index++; $_smarty_tpl->tpl_vars['word_item']->first = $_smarty_tpl->tpl_vars['word_item']->index === 0; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["word_loop"]['first'] = $_smarty_tpl->tpl_vars['word_item']->first; if (!$_smarty_tpl->getVariable('smarty')->value['foreach']['word_loop']['first']) { ?> <?php } ?> <span class="address_<?php echo smarty_modifier_replace($_smarty_tpl->tpl_vars['word_item']->value, ',', ''); ?> "><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['deliveryAddressFormatedValues']->value[smarty_modifier_replace($_smarty_tpl->tpl_vars['word_item']->value, ',', '')], ENT_QUOTES, 'UTF-8', true); ?> </span><?php } ?> </li> <?php } ?> <?php } ?> </ul> </div> <div class="col-xs-12 col-sm-6"> <ul class="address item <?php if ($_smarty_tpl->tpl_vars['order']->value->isVirtual()) { ?> full_width<?php } ?> box"> <li><h3 class="page-subheading"><?php echo smartyTranslate(array('s' => 'Invoice address'), $_smarty_tpl); ?> (<?php echo $_smarty_tpl->tpl_vars['address_invoice']->value->alias; ?> )</h3></li> <?php $_smarty_tpl->tpl_vars['field_item'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['field_item']->_loop = false; $_from = $_smarty_tpl->tpl_vars['inv_adr_fields']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['field_item']->key => $_smarty_tpl->tpl_vars['field_item']->value) { $_smarty_tpl->tpl_vars['field_item']->_loop = true; ?> <?php if ($_smarty_tpl->tpl_vars['field_item']->value == "company" && isset($_smarty_tpl->tpl_vars['address_invoice']->value->company)) { ?> <li class="address_company"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['address_invoice']->value->company, ENT_QUOTES, 'UTF-8', true); ?> </li> <?php } elseif ($_smarty_tpl->tpl_vars['field_item']->value == "address2" && $_smarty_tpl->tpl_vars['address_invoice']->value->address2) { ?> <li class="address_address2"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['address_invoice']->value->address2, ENT_QUOTES, 'UTF-8', true); ?> </li> <?php } elseif ($_smarty_tpl->tpl_vars['field_item']->value == "phone_mobile" && $_smarty_tpl->tpl_vars['address_invoice']->value->phone_mobile) { ?> <li class="address_phone_mobile"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['address_invoice']->value->phone_mobile, ENT_QUOTES, 'UTF-8', true); ?> </li> <?php } else { ?> <?php $_smarty_tpl->tpl_vars['address_words'] = new Smarty_variable(explode(" ", $_smarty_tpl->tpl_vars['field_item']->value), null, 0); ?> <li><?php $_smarty_tpl->tpl_vars['word_item'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['word_item']->_loop = false; $_from = $_smarty_tpl->tpl_vars['address_words']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['word_item']->index = -1; foreach ($_from as $_smarty_tpl->tpl_vars['word_item']->key => $_smarty_tpl->tpl_vars['word_item']->value) { $_smarty_tpl->tpl_vars['word_item']->_loop = true; $_smarty_tpl->tpl_vars['word_item']->index++; $_smarty_tpl->tpl_vars['word_item']->first = $_smarty_tpl->tpl_vars['word_item']->index === 0; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["word_loop"]['first'] = $_smarty_tpl->tpl_vars['word_item']->first; if (!$_smarty_tpl->getVariable('smarty')->value['foreach']['word_loop']['first']) { ?> <?php } ?> <span class="address_<?php echo smarty_modifier_replace($_smarty_tpl->tpl_vars['word_item']->value, ',', ''); ?> "><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['invoiceAddressFormatedValues']->value[smarty_modifier_replace($_smarty_tpl->tpl_vars['word_item']->value, ',', '')], ENT_QUOTES, 'UTF-8', true); ?> </span><?php } ?> </li> <?php } ?> <?php } ?> </ul> </div> </div> </div> <?php echo $_smarty_tpl->tpl_vars['HOOK_ORDERDETAILDISPLAYED']->value; ?> <?php if (!$_smarty_tpl->tpl_vars['is_guest']->value) { ?> <form action="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('order-follow', true), ENT_QUOTES, 'UTF-8', true); ?> " method="post"><?php } ?> <div id="order-detail-content" class="table_block table-responsive"> <table class="table table-bordered"> <thead> <tr> <?php if ($_smarty_tpl->tpl_vars['return_allowed']->value) { ?> <th class="first_item"><input type="checkbox" /></th><?php } ?> <th class="<?php if ($_smarty_tpl->tpl_vars['return_allowed']->value) { ?> item<?php } else { ?> first_item<?php } ?> "><?php echo smartyTranslate(array('s' => 'Reference'), $_smarty_tpl); ?> </th> <th class="item"><?php echo smartyTranslate(array('s' => 'Product'), $_smarty_tpl); ?> </th> <th class="item"><?php echo smartyTranslate(array('s' => 'Quantity'), $_smarty_tpl); ?> </th> <?php if ($_smarty_tpl->tpl_vars['order']->value->hasProductReturned()) { ?> <th class="item"><?php echo smartyTranslate(array('s' => 'Returned'), $_smarty_tpl); ?> </th> <?php } ?> <th class="item"><?php echo smartyTranslate(array('s' => 'Unit price'), $_smarty_tpl); ?> </th> <th class="last_item"><?php echo smartyTranslate(array('s' => 'Total price'), $_smarty_tpl); ?> </th> </tr> </thead> <tfoot> <?php if ($_smarty_tpl->tpl_vars['priceDisplay']->value && $_smarty_tpl->tpl_vars['use_tax']->value) { ?> <tr class="item"> <td colspan="<?php if ($_smarty_tpl->tpl_vars['return_allowed']->value) { ?> 2<?php } else { ?> 1<?php } ?> "> <strong><?php echo smartyTranslate(array('s' => 'Items (tax excl.)'), $_smarty_tpl); ?> </strong> </td> <td colspan="<?php if ($_smarty_tpl->tpl_vars['order']->value->hasProductReturned()) { ?> 5<?php } else { ?> 4<?php } ?> "> <span class="price"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['displayWtPriceWithCurrency'][0][0]->displayWtPriceWithCurrency(array('price' => $_smarty_tpl->tpl_vars['order']->value->getTotalProductsWithoutTaxes(), 'currency' => $_smarty_tpl->tpl_vars['currency']->value), $_smarty_tpl); ?> </span> </td> </tr> <?php } ?> <tr class="item"> <td colspan="<?php if ($_smarty_tpl->tpl_vars['return_allowed']->value) { ?> 2<?php } else { ?> 1<?php } ?> "> <strong><?php echo smartyTranslate(array('s' => 'Items'), $_smarty_tpl); ?> <?php if ($_smarty_tpl->tpl_vars['use_tax']->value) { echo smartyTranslate(array('s' => '(tax incl.)'), $_smarty_tpl); } ?> </strong> </td> <td colspan="<?php if ($_smarty_tpl->tpl_vars['order']->value->hasProductReturned()) { ?> 5<?php } else { ?> 4<?php } ?> "> <span class="price"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['displayWtPriceWithCurrency'][0][0]->displayWtPriceWithCurrency(array('price' => $_smarty_tpl->tpl_vars['order']->value->getTotalProductsWithTaxes(), 'currency' => $_smarty_tpl->tpl_vars['currency']->value), $_smarty_tpl); ?> </span> </td> </tr> <?php if ($_smarty_tpl->tpl_vars['order']->value->total_discounts > 0) { ?> <tr class="item"> <td colspan="<?php if ($_smarty_tpl->tpl_vars['return_allowed']->value) { ?> 2<?php } else { ?> 1<?php } ?> "> <strong><?php echo smartyTranslate(array('s' => 'Total vouchers'), $_smarty_tpl); ?> </strong> </td> <td colspan="<?php if ($_smarty_tpl->tpl_vars['order']->value->hasProductReturned()) { ?> 5<?php } else { ?> 4<?php } ?> "> <span class="price-discount"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['displayWtPriceWithCurrency'][0][0]->displayWtPriceWithCurrency(array('price' => $_smarty_tpl->tpl_vars['order']->value->total_discounts, 'currency' => $_smarty_tpl->tpl_vars['currency']->value, 'convert' => 1), $_smarty_tpl); ?> </span> </td> </tr> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['order']->value->total_wrapping > 0) { ?> <tr class="item"> <td colspan="<?php if ($_smarty_tpl->tpl_vars['return_allowed']->value) { ?> 2<?php } else { ?> 1<?php } ?> "> <strong><?php echo smartyTranslate(array('s' => 'Total gift wrapping cost'), $_smarty_tpl); ?> </strong> </td> <td colspan="<?php if ($_smarty_tpl->tpl_vars['order']->value->hasProductReturned()) { ?> 5<?php } else { ?> 4<?php } ?> "> <span class="price-wrapping"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['displayWtPriceWithCurrency'][0][0]->displayWtPriceWithCurrency(array('price' => $_smarty_tpl->tpl_vars['order']->value->total_wrapping, 'currency' => $_smarty_tpl->tpl_vars['currency']->value), $_smarty_tpl); ?> </span> </td> </tr> <?php } ?> <tr class="item"> <td colspan="<?php if ($_smarty_tpl->tpl_vars['return_allowed']->value) { ?> 2<?php } else { ?> 1<?php } ?> "> <strong><?php echo smartyTranslate(array('s' => 'Shipping & handling'), $_smarty_tpl); ?> <?php if ($_smarty_tpl->tpl_vars['use_tax']->value) { echo smartyTranslate(array('s' => '(tax incl.)'), $_smarty_tpl); } ?> </strong> </td> <td colspan="<?php if ($_smarty_tpl->tpl_vars['order']->value->hasProductReturned()) { ?> 5<?php } else { ?> 4<?php } ?> "> <span class="price-shipping"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['displayWtPriceWithCurrency'][0][0]->displayWtPriceWithCurrency(array('price' => $_smarty_tpl->tpl_vars['order']->value->total_shipping, 'currency' => $_smarty_tpl->tpl_vars['currency']->value), $_smarty_tpl); ?> </span> </td> </tr> <tr class="totalprice item"> <td colspan="<?php if ($_smarty_tpl->tpl_vars['return_allowed']->value) { ?> 2<?php } else { ?> 1<?php } ?> "> <strong><?php echo smartyTranslate(array('s' => 'Total'), $_smarty_tpl); ?> </strong> </td> <td colspan="<?php if ($_smarty_tpl->tpl_vars['order']->value->hasProductReturned()) { ?> 5<?php } else { ?> 4<?php } ?> "> <span class="price"><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['displayWtPriceWithCurrency'][0][0]->displayWtPriceWithCurrency(array('price' => $_smarty_tpl->tpl_vars['order']->value->total_paid, 'currency' => $_smarty_tpl->tpl_vars['currency']->value), $_smarty_tpl); ?> </span> </td> </tr> </tfoot> <tbody> <?php $_smarty_tpl->tpl_vars['product'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['product']->_loop = false; $_from = $_smarty_tpl->tpl_vars['products']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['smarty']->value['foreach']['products']['index'] = -1; foreach ($_from as $_smarty_tpl->tpl_vars['product']->key => $_smarty_tpl->tpl_vars['product']->value) { $_smarty_tpl->tpl_vars['product']->_loop = true; $_smarty_tpl->tpl_vars['smarty']->value['foreach']['products']['index']++; ?> <?php if (!isset($_smarty_tpl->tpl_vars['product']->value['deleted'])) { ?> <?php $_smarty_tpl->tpl_vars['productId'] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['product_id'], null, 0); ?> <?php $_smarty_tpl->tpl_vars['productAttributeId'] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['product_attribute_id'], null, 0); ?> <?php if (isset($_smarty_tpl->tpl_vars['product']->value['customizedDatas'])) { ?> <?php $_smarty_tpl->tpl_vars['productQuantity'] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['product_quantity'] - $_smarty_tpl->tpl_vars['product']->value['customizationQuantityTotal'], null, 0); ?> <?php } else { ?> <?php $_smarty_tpl->tpl_vars['productQuantity'] = new Smarty_variable($_smarty_tpl->tpl_vars['product']->value['product_quantity'], null, 0); ?> <?php } ?> <!-- Customized products --> <?php if (isset($_smarty_tpl->tpl_vars['product']->value['customizedDatas'])) { ?> <tr class="item"> <?php if ($_smarty_tpl->tpl_vars['return_allowed']->value) { ?> <td class="order_cb"></td><?php } ?> <td><label for="cb_<?php echo intval($_smarty_tpl->tpl_vars['product']->value['id_order_detail']); ?> "><?php if ($_smarty_tpl->tpl_vars['product']->value['product_reference']) { echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_reference'], ENT_QUOTES, 'UTF-8', true); } else { ?> --<?php } ?> </label></td> <td class="bold"> <label for="cb_<?php echo intval($_smarty_tpl->tpl_vars['product']->value['id_order_detail']); ?> "><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_name'], ENT_QUOTES, 'UTF-8', true); ?> </label> </td> <td> <input class="order_qte_input form-control grey" name="order_qte_input[<?php echo $_smarty_tpl->getVariable('smarty')->value['foreach']['products']['index']; ?> ]" type="text" size="2" value="<?php echo intval($_smarty_tpl->tpl_vars['product']->value['customizationQuantityTotal']); ?> " /> <div class="clearfix return_quantity_buttons"> <a href="#" class="return_quantity_down btn btn-default button-minus"><span><i class="icon-minus"></i></span></a> <a href="#" class="return_quantity_up btn btn-default button-plus"><span><i class="icon-plus"></i></span></a> </div> <label for="cb_<?php echo intval($_smarty_tpl->tpl_vars['product']->value['id_order_detail']); ?> "><span class="order_qte_span editable"><?php echo intval($_smarty_tpl->tpl_vars['product']->value['customizationQuantityTotal']); ?> </span></label></td> <?php if ($_smarty_tpl->tpl_vars['order']->value->hasProductReturned()) { ?> <td> <?php echo $_smarty_tpl->tpl_vars['product']->value['qty_returned']; ?> </td> <?php } ?> <td> <label class="price" for="cb_<?php echo intval($_smarty_tpl->tpl_vars['product']->value['id_order_detail']); ?> "> <?php if ($_smarty_tpl->tpl_vars['group_use_tax']->value) { ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPriceWithCurrency'][0][0]->convertPriceWithCurrency(array('price' => $_smarty_tpl->tpl_vars['product']->value['unit_price_tax_incl'], 'currency' => $_smarty_tpl->tpl_vars['currency']->value), $_smarty_tpl); ?> <?php } else { ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPriceWithCurrency'][0][0]->convertPriceWithCurrency(array('price' => $_smarty_tpl->tpl_vars['product']->value['unit_price_tax_excl'], 'currency' => $_smarty_tpl->tpl_vars['currency']->value), $_smarty_tpl); ?> <?php } ?> </label> </td> <td> <label class="price" for="cb_<?php echo intval($_smarty_tpl->tpl_vars['product']->value['id_order_detail']); ?> "> <?php if (isset($_smarty_tpl->tpl_vars['customizedDatas']->value[$_smarty_tpl->tpl_vars['productId']->value][$_smarty_tpl->tpl_vars['productAttributeId']->value])) { ?> <?php if ($_smarty_tpl->tpl_vars['group_use_tax']->value) { ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPriceWithCurrency'][0][0]->convertPriceWithCurrency(array('price' => $_smarty_tpl->tpl_vars['product']->value['total_customization_wt'], 'currency' => $_smarty_tpl->tpl_vars['currency']->value), $_smarty_tpl); ?> <?php } else { ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPriceWithCurrency'][0][0]->convertPriceWithCurrency(array('price' => $_smarty_tpl->tpl_vars['product']->value['total_customization'], 'currency' => $_smarty_tpl->tpl_vars['currency']->value), $_smarty_tpl); ?> <?php } ?> <?php } else { ?> <?php if ($_smarty_tpl->tpl_vars['group_use_tax']->value) { ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPriceWithCurrency'][0][0]->convertPriceWithCurrency(array('price' => $_smarty_tpl->tpl_vars['product']->value['total_price_tax_incl'], 'currency' => $_smarty_tpl->tpl_vars['currency']->value), $_smarty_tpl); ?> <?php } else { ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPriceWithCurrency'][0][0]->convertPriceWithCurrency(array('price' => $_smarty_tpl->tpl_vars['product']->value['total_price_tax_excl'], 'currency' => $_smarty_tpl->tpl_vars['currency']->value), $_smarty_tpl); ?> <?php } ?> <?php } ?> </label> </td> </tr> <?php $_smarty_tpl->tpl_vars['customizationPerAddress'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['customizationPerAddress']->_loop = false; $_from = $_smarty_tpl->tpl_vars['product']->value['customizedDatas']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['customizationPerAddress']->key => $_smarty_tpl->tpl_vars['customizationPerAddress']->value) { $_smarty_tpl->tpl_vars['customizationPerAddress']->_loop = true; ?> <?php $_smarty_tpl->tpl_vars['customization'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['customization']->_loop = false; $_smarty_tpl->tpl_vars['customizationId'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['customizationPerAddress']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['customization']->key => $_smarty_tpl->tpl_vars['customization']->value) { $_smarty_tpl->tpl_vars['customization']->_loop = true; $_smarty_tpl->tpl_vars['customizationId']->value = $_smarty_tpl->tpl_vars['customization']->key; ?> <tr class="alternate_item"> <?php if ($_smarty_tpl->tpl_vars['return_allowed']->value) { ?> <td class="order_cb"><input type="checkbox" id="cb_<?php echo intval($_smarty_tpl->tpl_vars['product']->value['id_order_detail']); ?> " name="customization_ids[<?php echo intval($_smarty_tpl->tpl_vars['product']->value['id_order_detail']); ?> ][]" value="<?php echo intval($_smarty_tpl->tpl_vars['customizationId']->value); ?> " /></td><?php } ?> <td colspan="2"> <?php $_smarty_tpl->tpl_vars['datas'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['datas']->_loop = false; $_smarty_tpl->tpl_vars['type'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['customization']->value['datas']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['datas']->key => $_smarty_tpl->tpl_vars['datas']->value) { $_smarty_tpl->tpl_vars['datas']->_loop = true; $_smarty_tpl->tpl_vars['type']->value = $_smarty_tpl->tpl_vars['datas']->key; ?> <?php if ($_smarty_tpl->tpl_vars['type']->value == $_smarty_tpl->tpl_vars['CUSTOMIZE_FILE']->value) { ?> <ul class="customizationUploaded"> <?php $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['data']->_loop = false; $_from = $_smarty_tpl->tpl_vars['datas']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['data']->key => $_smarty_tpl->tpl_vars['data']->value) { $_smarty_tpl->tpl_vars['data']->_loop = true; ?> <li><img src="<?php echo $_smarty_tpl->tpl_vars['pic_dir']->value; echo $_smarty_tpl->tpl_vars['data']->value['value']; ?> _small" alt="" class="customizationUploaded" /></li> <?php } ?> </ul> <?php } elseif ($_smarty_tpl->tpl_vars['type']->value == $_smarty_tpl->tpl_vars['CUSTOMIZE_TEXTFIELD']->value) { ?> <ul class="typedText"><?php echo smarty_function_counter(array('start' => 0, 'print' => false), $_smarty_tpl); ?> <?php $_smarty_tpl->tpl_vars['data'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['data']->_loop = false; $_from = $_smarty_tpl->tpl_vars['datas']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['data']->key => $_smarty_tpl->tpl_vars['data']->value) { $_smarty_tpl->tpl_vars['data']->_loop = true; ?> <?php $_smarty_tpl->tpl_vars['customizationFieldName'] = new Smarty_variable("Text #" . $_smarty_tpl->tpl_vars['data']->value['id_customization_field'], null, 0); ?> <li><?php echo ($tmp = @$_smarty_tpl->tpl_vars['data']->value['name']) === null || $tmp === '' ? $_smarty_tpl->tpl_vars['customizationFieldName']->value : $tmp; ?> : <?php echo $_smarty_tpl->tpl_vars['data']->value['value']; ?> </li> <?php } ?> </ul> <?php } ?> <?php } ?> </td> <td> <input class="order_qte_input form-control grey" name="customization_qty_input[<?php echo intval($_smarty_tpl->tpl_vars['customizationId']->value); ?> ]" type="text" size="2" value="<?php echo intval($_smarty_tpl->tpl_vars['customization']->value['quantity']); ?> " /> <div class="clearfix return_quantity_buttons"> <a href="#" class="return_quantity_down btn btn-default button-minus"><span><i class="icon-minus"></i></span></a> <a href="#" class="return_quantity_up btn btn-default button-plus"><span><i class="icon-plus"></i></span></a> </div> <label for="cb_<?php echo intval($_smarty_tpl->tpl_vars['product']->value['id_order_detail']); ?> "><span class="order_qte_span editable"><?php echo intval($_smarty_tpl->tpl_vars['customization']->value['quantity']); ?> </span></label> </td> <td colspan="2"></td> </tr> <?php } ?> <?php } ?> <?php } ?> <!-- Classic products --> <?php if ($_smarty_tpl->tpl_vars['product']->value['product_quantity'] > $_smarty_tpl->tpl_vars['product']->value['customizationQuantityTotal']) { ?> <tr class="item"> <?php if ($_smarty_tpl->tpl_vars['return_allowed']->value) { ?> <td class="order_cb"><input type="checkbox" id="cb_<?php echo intval($_smarty_tpl->tpl_vars['product']->value['id_order_detail']); ?> " name="ids_order_detail[<?php echo intval($_smarty_tpl->tpl_vars['product']->value['id_order_detail']); ?> ]" value="<?php echo intval($_smarty_tpl->tpl_vars['product']->value['id_order_detail']); ?> " /></td><?php } ?> <td><label for="cb_<?php echo intval($_smarty_tpl->tpl_vars['product']->value['id_order_detail']); ?> "><?php if ($_smarty_tpl->tpl_vars['product']->value['product_reference']) { echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_reference'], ENT_QUOTES, 'UTF-8', true); } else { ?> --<?php } ?> </label></td> <td class="bold"> <label for="cb_<?php echo intval($_smarty_tpl->tpl_vars['product']->value['id_order_detail']); ?> "> <?php if ($_smarty_tpl->tpl_vars['product']->value['download_hash'] && $_smarty_tpl->tpl_vars['logable']->value && $_smarty_tpl->tpl_vars['product']->value['display_filename'] != '' && $_smarty_tpl->tpl_vars['product']->value['product_quantity_refunded'] == 0 && $_smarty_tpl->tpl_vars['product']->value['product_quantity_return'] == 0) { ?> <?php if (isset($_smarty_tpl->tpl_vars['is_guest']->value) && $_smarty_tpl->tpl_vars['is_guest']->value) { ?> <a href="<?php ob_start(); echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['filename'], ENT_QUOTES, 'UTF-8', true); $_tmp31 = ob_get_clean(); ob_start(); echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['download_hash'], ENT_QUOTES, 'UTF-8', true); $_tmp32 = ob_get_clean(); echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('get-file', true, null, "key=" . $_tmp31 . "-" . $_tmp32 . "&id_order=" . (string) $_smarty_tpl->tpl_vars['order']->value->id . "&secure_key=" . (string) $_smarty_tpl->tpl_vars['order']->value->secure_key), ENT_QUOTES, 'UTF-8', true); ?> " title="<?php echo smartyTranslate(array('s' => 'Download this product'), $_smarty_tpl); ?> "> <?php } else { ?> <a href="<?php ob_start(); echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['filename'], ENT_QUOTES, 'UTF-8', true); $_tmp33 = ob_get_clean(); ob_start(); echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['download_hash'], ENT_QUOTES, 'UTF-8', true); $_tmp34 = ob_get_clean(); echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('get-file', true, null, "key=" . $_tmp33 . "-" . $_tmp34), ENT_QUOTES, 'UTF-8', true); ?> " title="<?php echo smartyTranslate(array('s' => 'Download this product'), $_smarty_tpl); ?> "> <?php } ?> <img src="<?php echo $_smarty_tpl->tpl_vars['img_dir']->value; ?> icon/download_product.gif" class="icon" alt="<?php echo smartyTranslate(array('s' => 'Download product'), $_smarty_tpl); ?> " /> </a> <?php if (isset($_smarty_tpl->tpl_vars['is_guest']->value) && $_smarty_tpl->tpl_vars['is_guest']->value) { ?> <a href="<?php ob_start(); echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['filename'], ENT_QUOTES, 'UTF-8', true); $_tmp35 = ob_get_clean(); ob_start(); echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['download_hash'], ENT_QUOTES, 'UTF-8', true); $_tmp36 = ob_get_clean(); echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('get-file', true, null, "key=" . $_tmp35 . "-" . $_tmp36 . "&id_order=" . (string) $_smarty_tpl->tpl_vars['order']->value->id . "&secure_key=" . (string) $_smarty_tpl->tpl_vars['order']->value->secure_key), ENT_QUOTES, 'UTF-8', true); ?> " title="<?php echo smartyTranslate(array('s' => 'Download this product'), $_smarty_tpl); ?> "> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_name'], ENT_QUOTES, 'UTF-8', true); ?> </a> <?php } else { ?> <a href="<?php ob_start(); echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['filename'], ENT_QUOTES, 'UTF-8', true); $_tmp37 = ob_get_clean(); ob_start(); echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['download_hash'], ENT_QUOTES, 'UTF-8', true); $_tmp38 = ob_get_clean(); echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('get-file', true, null, "key=" . $_tmp37 . "-" . $_tmp38), ENT_QUOTES, 'UTF-8', true); ?> " title="<?php echo smartyTranslate(array('s' => 'Download this product'), $_smarty_tpl); ?> "> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_name'], ENT_QUOTES, 'UTF-8', true); ?> </a> <?php } ?> <?php } else { ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['product']->value['product_name'], ENT_QUOTES, 'UTF-8', true); ?> <?php } ?> </label> </td> <td class="return_quantity"> <input class="order_qte_input form-control grey" name="order_qte_input[<?php echo intval($_smarty_tpl->tpl_vars['product']->value['id_order_detail']); ?> ]" type="text" size="2" value="<?php echo intval($_smarty_tpl->tpl_vars['productQuantity']->value); ?> " /> <div class="clearfix return_quantity_buttons"> <a href="#" class="return_quantity_down btn btn-default button-minus"><span><i class="icon-minus"></i></span></a> <a href="#" class="return_quantity_up btn btn-default button-plus"><span><i class="icon-plus"></i></span></a> </div> <label for="cb_<?php echo intval($_smarty_tpl->tpl_vars['product']->value['id_order_detail']); ?> "><span class="order_qte_span editable"><?php echo intval($_smarty_tpl->tpl_vars['productQuantity']->value); ?> </span></label></td> <?php if ($_smarty_tpl->tpl_vars['order']->value->hasProductReturned()) { ?> <td> <?php echo $_smarty_tpl->tpl_vars['product']->value['qty_returned']; ?> </td> <?php } ?> <td class="price"> <label for="cb_<?php echo intval($_smarty_tpl->tpl_vars['product']->value['id_order_detail']); ?> "> <?php if ($_smarty_tpl->tpl_vars['group_use_tax']->value) { ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPriceWithCurrency'][0][0]->convertPriceWithCurrency(array('price' => $_smarty_tpl->tpl_vars['product']->value['unit_price_tax_incl'], 'currency' => $_smarty_tpl->tpl_vars['currency']->value), $_smarty_tpl); ?> <?php } else { ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPriceWithCurrency'][0][0]->convertPriceWithCurrency(array('price' => $_smarty_tpl->tpl_vars['product']->value['unit_price_tax_excl'], 'currency' => $_smarty_tpl->tpl_vars['currency']->value), $_smarty_tpl); ?> <?php } ?> </label> </td> <td class="price"> <label for="cb_<?php echo intval($_smarty_tpl->tpl_vars['product']->value['id_order_detail']); ?> "> <?php if ($_smarty_tpl->tpl_vars['group_use_tax']->value) { ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPriceWithCurrency'][0][0]->convertPriceWithCurrency(array('price' => $_smarty_tpl->tpl_vars['product']->value['total_price_tax_incl'], 'currency' => $_smarty_tpl->tpl_vars['currency']->value), $_smarty_tpl); ?> <?php } else { ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPriceWithCurrency'][0][0]->convertPriceWithCurrency(array('price' => $_smarty_tpl->tpl_vars['product']->value['total_price_tax_excl'], 'currency' => $_smarty_tpl->tpl_vars['currency']->value), $_smarty_tpl); ?> <?php } ?> </label> </td> </tr> <?php } ?> <?php } ?> <?php } ?> <?php $_smarty_tpl->tpl_vars['discount'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['discount']->_loop = false; $_from = $_smarty_tpl->tpl_vars['discounts']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['discount']->key => $_smarty_tpl->tpl_vars['discount']->value) { $_smarty_tpl->tpl_vars['discount']->_loop = true; ?> <tr class="item"> <td><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['discount']->value['name'], ENT_QUOTES, 'UTF-8', true); ?> </td> <td><?php echo smartyTranslate(array('s' => 'Voucher'), $_smarty_tpl); ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['discount']->value['name'], ENT_QUOTES, 'UTF-8', true); ?> </td> <td><span class="order_qte_span editable">1</span></td> <td> </td> <td><?php if ($_smarty_tpl->tpl_vars['discount']->value['value'] != 0.0) { ?> -<?php } echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['convertPriceWithCurrency'][0][0]->convertPriceWithCurrency(array('price' => $_smarty_tpl->tpl_vars['discount']->value['value'], 'currency' => $_smarty_tpl->tpl_vars['currency']->value), $_smarty_tpl); ?> </td> <?php if ($_smarty_tpl->tpl_vars['return_allowed']->value) { ?> <td> </td> <?php } ?> </tr> <?php } ?> </tbody> </table> </div> <?php if ($_smarty_tpl->tpl_vars['return_allowed']->value) { ?> <div id="returnOrderMessage"> <h3 class="page-heading bottom-indent"><?php echo smartyTranslate(array('s' => 'Merchandise return'), $_smarty_tpl); ?> </h3> <p><?php echo smartyTranslate(array('s' => 'If you wish to return one or more products, please mark the corresponding boxes and provide an explanation for the return. When complete, click the button below.'), $_smarty_tpl); ?> </p> <p class="form-group"> <textarea class="form-control" cols="67" rows="3" name="returnText"></textarea> </p> <p class="form-group"> <button type="submit" name="submitReturnMerchandise" class="btn btn-default button button-small"><span><?php echo smartyTranslate(array('s' => 'Make an RMA slip'), $_smarty_tpl); ?> <i class="icon-chevron-right right"></i></span></button> <input type="hidden" class="hidden" value="<?php echo intval($_smarty_tpl->tpl_vars['order']->value->id); ?> " name="id_order" /> </p> </div> <?php } ?> </form> <?php $_smarty_tpl->tpl_vars['carriers'] = new Smarty_variable($_smarty_tpl->tpl_vars['order']->value->getShipping(), null, 0); if (count($_smarty_tpl->tpl_vars['carriers']->value) > 0 && isset($_smarty_tpl->tpl_vars['carriers']->value[0]['carrier_name']) && $_smarty_tpl->tpl_vars['carriers']->value[0]['carrier_name']) { ?> <table class="table table-bordered footab"> <thead> <tr> <th class="first_item"><?php echo smartyTranslate(array('s' => 'Date'), $_smarty_tpl); ?> </th> <th class="item" data-sort-ignore="true"><?php echo smartyTranslate(array('s' => 'Carrier'), $_smarty_tpl); ?> </th> <th data-hide="phone" class="item"><?php echo smartyTranslate(array('s' => 'Weight'), $_smarty_tpl); ?> </th> <th data-hide="phone" class="item"><?php echo smartyTranslate(array('s' => 'Shipping cost'), $_smarty_tpl); ?> </th> <th data-hide="phone" class="last_item" data-sort-ignore="true"><?php echo smartyTranslate(array('s' => 'Tracking number'), $_smarty_tpl); ?> </th> </tr> </thead> <tbody> <?php $_smarty_tpl->tpl_vars['line'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['line']->_loop = false; $_from = $_smarty_tpl->tpl_vars['carriers']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['line']->key => $_smarty_tpl->tpl_vars['line']->value) { $_smarty_tpl->tpl_vars['line']->_loop = true; ?> <tr class="item"> <td data-value="<?php echo smarty_modifier_regex_replace($_smarty_tpl->tpl_vars['line']->value['date_add'], "/[\\-\\:\\ ]/", ''); ?> "><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['dateFormat'][0][0]->dateFormat(array('date' => $_smarty_tpl->tpl_vars['line']->value['date_add'], 'full' => 0), $_smarty_tpl); ?> </td> <td><?php echo $_smarty_tpl->tpl_vars['line']->value['carrier_name']; ?> </td> <td data-value="<?php if ($_smarty_tpl->tpl_vars['line']->value['weight'] > 0) { echo sprintf("%.3f", $_smarty_tpl->tpl_vars['line']->value['weight']); } else { ?> 0<?php } ?> "><?php if ($_smarty_tpl->tpl_vars['line']->value['weight'] > 0) { echo sprintf("%.3f", $_smarty_tpl->tpl_vars['line']->value['weight']); ?> <?php echo Configuration::get('PS_WEIGHT_UNIT'); } else { ?> -<?php } ?> </td> <td data-value="<?php if ($_smarty_tpl->tpl_vars['order']->value->getTaxCalculationMethod() == @constant('PS_TAX_INC')) { echo $_smarty_tpl->tpl_vars['line']->value['shipping_cost_tax_incl']; } else { echo $_smarty_tpl->tpl_vars['line']->value['shipping_cost_tax_excl']; } ?> "><?php if ($_smarty_tpl->tpl_vars['order']->value->getTaxCalculationMethod() == @constant('PS_TAX_INC')) { echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['displayPrice'][0][0]->displayPriceSmarty(array('price' => $_smarty_tpl->tpl_vars['line']->value['shipping_cost_tax_incl'], 'currency' => $_smarty_tpl->tpl_vars['currency']->value->id), $_smarty_tpl); } else { echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['displayPrice'][0][0]->displayPriceSmarty(array('price' => $_smarty_tpl->tpl_vars['line']->value['shipping_cost_tax_excl'], 'currency' => $_smarty_tpl->tpl_vars['currency']->value->id), $_smarty_tpl); } ?> </td> <td> <span class="shipping_number_show"><?php if ($_smarty_tpl->tpl_vars['line']->value['tracking_number']) { if ($_smarty_tpl->tpl_vars['line']->value['url'] && $_smarty_tpl->tpl_vars['line']->value['tracking_number']) { ?> <a href="<?php echo smarty_modifier_replace($_smarty_tpl->tpl_vars['line']->value['url'], '@', $_smarty_tpl->tpl_vars['line']->value['tracking_number']); ?> "><?php echo $_smarty_tpl->tpl_vars['line']->value['tracking_number']; ?> </a><?php } else { echo $_smarty_tpl->tpl_vars['line']->value['tracking_number']; } } else { ?> -<?php } ?> </span> </td> </tr> <?php } ?> </tbody> </table> <?php } if (!$_smarty_tpl->tpl_vars['is_guest']->value) { ?> <?php if (count($_smarty_tpl->tpl_vars['messages']->value)) { ?> <h3 class="page-heading"><?php echo smartyTranslate(array('s' => 'Messages'), $_smarty_tpl); ?> </h3> <div class="table_block"> <table class="detail_step_by_step table table-bordered"> <thead> <tr> <th class="first_item" style="width:150px;"><?php echo smartyTranslate(array('s' => 'From'), $_smarty_tpl); ?> </th> <th class="last_item"><?php echo smartyTranslate(array('s' => 'Message'), $_smarty_tpl); ?> </th> </tr> </thead> <tbody> <?php $_smarty_tpl->tpl_vars['message'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['message']->_loop = false; $_from = $_smarty_tpl->tpl_vars['messages']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['message']->total = $_smarty_tpl->_count($_from); $_smarty_tpl->tpl_vars['message']->iteration = 0; $_smarty_tpl->tpl_vars['message']->index = -1; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["messageList"]['index'] = -1; foreach ($_from as $_smarty_tpl->tpl_vars['message']->key => $_smarty_tpl->tpl_vars['message']->value) { $_smarty_tpl->tpl_vars['message']->_loop = true; $_smarty_tpl->tpl_vars['message']->iteration++; $_smarty_tpl->tpl_vars['message']->index++; $_smarty_tpl->tpl_vars['message']->first = $_smarty_tpl->tpl_vars['message']->index === 0; $_smarty_tpl->tpl_vars['message']->last = $_smarty_tpl->tpl_vars['message']->iteration === $_smarty_tpl->tpl_vars['message']->total; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["messageList"]['first'] = $_smarty_tpl->tpl_vars['message']->first; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["messageList"]['index']++; $_smarty_tpl->tpl_vars['smarty']->value['foreach']["messageList"]['last'] = $_smarty_tpl->tpl_vars['message']->last; ?> <tr class="<?php if ($_smarty_tpl->getVariable('smarty')->value['foreach']['messageList']['first']) { ?> first_item<?php } elseif ($_smarty_tpl->getVariable('smarty')->value['foreach']['messageList']['last']) { ?> last_item<?php } ?> <?php if ($_smarty_tpl->getVariable('smarty')->value['foreach']['messageList']['index'] % 2) { ?> alternate_item<?php } else { ?> item<?php } ?> "> <td> <strong class="dark"> <?php if (isset($_smarty_tpl->tpl_vars['message']->value['elastname']) && $_smarty_tpl->tpl_vars['message']->value['elastname']) { ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['message']->value['efirstname'], ENT_QUOTES, 'UTF-8', true); ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['message']->value['elastname'], ENT_QUOTES, 'UTF-8', true); ?> <?php } elseif ($_smarty_tpl->tpl_vars['message']->value['clastname']) { ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['message']->value['cfirstname'], ENT_QUOTES, 'UTF-8', true); ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['message']->value['clastname'], ENT_QUOTES, 'UTF-8', true); ?> <?php } else { ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['shop_name']->value, ENT_QUOTES, 'UTF-8', true); ?> <?php } ?> </strong> <br /> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['dateFormat'][0][0]->dateFormat(array('date' => $_smarty_tpl->tpl_vars['message']->value['date_add'], 'full' => 1), $_smarty_tpl); ?> </td> <td><?php echo nl2br(htmlspecialchars($_smarty_tpl->tpl_vars['message']->value['message'], ENT_QUOTES, 'UTF-8', true)); ?> </td> </tr> <?php } ?> </tbody> </table> </div> <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['errors']->value) && $_smarty_tpl->tpl_vars['errors']->value) { ?> <div class="alert alert-danger"> <p><?php if (count($_smarty_tpl->tpl_vars['errors']->value) > 1) { echo smartyTranslate(array('s' => 'There are %d errors', 'sprintf' => count($_smarty_tpl->tpl_vars['errors']->value)), $_smarty_tpl); } else { echo smartyTranslate(array('s' => 'There is %d error', 'sprintf' => count($_smarty_tpl->tpl_vars['errors']->value)), $_smarty_tpl); } ?> </p> <ol> <?php $_smarty_tpl->tpl_vars['error'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['error']->_loop = false; $_smarty_tpl->tpl_vars['k'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['errors']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['error']->key => $_smarty_tpl->tpl_vars['error']->value) { $_smarty_tpl->tpl_vars['error']->_loop = true; $_smarty_tpl->tpl_vars['k']->value = $_smarty_tpl->tpl_vars['error']->key; ?> <li><?php echo $_smarty_tpl->tpl_vars['error']->value; ?> </li> <?php } ?> </ol> </div> <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['message_confirmation']->value) && $_smarty_tpl->tpl_vars['message_confirmation']->value) { ?> <p class="alert alert-success"> <?php echo smartyTranslate(array('s' => 'Message successfully sent'), $_smarty_tpl); ?> </p> <?php } ?> <form action="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('order-detail', true), ENT_QUOTES, 'UTF-8', true); ?> " method="post" class="std" id="sendOrderMessage"> <h3 class="page-heading bottom-indent"><?php echo smartyTranslate(array('s' => 'Add a message'), $_smarty_tpl); ?> </h3> <p><?php echo smartyTranslate(array('s' => 'If you would like to add a comment about your order, please write it in the field below.'), $_smarty_tpl); ?> </p> <p class="form-group"> <label for="id_product"><?php echo smartyTranslate(array('s' => 'Product'), $_smarty_tpl); ?> </label> <select name="id_product" class="form-control"> <option value="0"><?php echo smartyTranslate(array('s' => '-- Choose --'), $_smarty_tpl); ?> </option> <?php $_smarty_tpl->tpl_vars['product'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['product']->_loop = false; $_from = $_smarty_tpl->tpl_vars['products']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['smarty']->value['foreach']['products']['index'] = -1; foreach ($_from as $_smarty_tpl->tpl_vars['product']->key => $_smarty_tpl->tpl_vars['product']->value) { $_smarty_tpl->tpl_vars['product']->_loop = true; $_smarty_tpl->tpl_vars['smarty']->value['foreach']['products']['index']++; ?> <option value="<?php echo $_smarty_tpl->tpl_vars['product']->value['product_id']; ?> "><?php echo $_smarty_tpl->tpl_vars['product']->value['product_name']; ?> </option> <?php } ?> </select> </p> <p class="form-group"> <textarea class="form-control" cols="67" rows="3" name="msgText"></textarea> </p> <div class="submit"> <input type="hidden" name="id_order" value="<?php echo intval($_smarty_tpl->tpl_vars['order']->value->id); ?> " /> <input type="submit" class="unvisible" name="submitMessage" value="<?php echo smartyTranslate(array('s' => 'Send'), $_smarty_tpl); ?> "/> <button type="submit" name="submitMessage" class="button btn btn-default button-medium"><span><?php echo smartyTranslate(array('s' => 'Send'), $_smarty_tpl); ?> <i class="icon-chevron-right right"></i></span></button> </div> </form> <?php } else { ?> <p class="alert alert-info"><i class="icon-info-sign"></i><?php echo smartyTranslate(array('s' => 'You cannot return merchandise with a guest account'), $_smarty_tpl); ?> </p> <?php } } }
function content_56fb07cfb00857_87035871($_smarty_tpl) { if (!is_callable('smarty_modifier_regex_replace')) { include 'E:\\www\\etec\\terceiro-modulo\\MKT\\Aula05\\prestashop\\tools\\smarty\\plugins\\modifier.regex_replace.php'; } $_smarty_tpl->_capture_stack[0][] = array('path', null, null); ob_start(); ?> <a href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('my-account', true), ENT_QUOTES, 'UTF-8', true); ?> "> <?php echo smartyTranslate(array('s' => 'My account'), $_smarty_tpl); ?> </a> <span class="navigation-pipe"><?php echo $_smarty_tpl->tpl_vars['navigationPipe']->value; ?> </span> <span class="navigation_page"><?php echo smartyTranslate(array('s' => 'Order history'), $_smarty_tpl); ?> </span> <?php list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['tpl_dir']->value . "./errors.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0); ?> <h1 class="page-heading bottom-indent"><?php echo smartyTranslate(array('s' => 'Order history'), $_smarty_tpl); ?> </h1> <p class="info-title"><?php echo smartyTranslate(array('s' => 'Here are the orders you\'ve placed since your account was created.'), $_smarty_tpl); ?> </p> <?php if ($_smarty_tpl->tpl_vars['slowValidation']->value) { ?> <p class="alert alert-warning"><?php echo smartyTranslate(array('s' => 'If you have just placed an order, it may take a few minutes for it to be validated. Please refresh this page if your order is missing.'), $_smarty_tpl); ?> </p> <?php } ?> <div class="block-center" id="block-history"> <?php if ($_smarty_tpl->tpl_vars['orders']->value && count($_smarty_tpl->tpl_vars['orders']->value)) { ?> <table id="order-list" class="table table-bordered footab"> <thead> <tr> <th class="first_item" data-sort-ignore="true"><?php echo smartyTranslate(array('s' => 'Order reference'), $_smarty_tpl); ?> </th> <th class="item"><?php echo smartyTranslate(array('s' => 'Date'), $_smarty_tpl); ?> </th> <th data-hide="phone" class="item"><?php echo smartyTranslate(array('s' => 'Total price'), $_smarty_tpl); ?> </th> <th data-sort-ignore="true" data-hide="phone,tablet" class="item"><?php echo smartyTranslate(array('s' => 'Payment'), $_smarty_tpl); ?> </th> <th class="item"><?php echo smartyTranslate(array('s' => 'Status'), $_smarty_tpl); ?> </th> <th data-sort-ignore="true" data-hide="phone,tablet" class="item"><?php echo smartyTranslate(array('s' => 'Invoice'), $_smarty_tpl); ?> </th> <th data-sort-ignore="true" data-hide="phone,tablet" class="last_item"> </th> </tr> </thead> <tbody> <?php $_smarty_tpl->tpl_vars['order'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['order']->_loop = false; $_from = $_smarty_tpl->tpl_vars['orders']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['order']->total = $_smarty_tpl->_count($_from); $_smarty_tpl->tpl_vars['order']->iteration = 0; $_smarty_tpl->tpl_vars['order']->index = -1; $_smarty_tpl->tpl_vars['smarty']->value['foreach']['myLoop']['index'] = -1; foreach ($_from as $_smarty_tpl->tpl_vars['order']->key => $_smarty_tpl->tpl_vars['order']->value) { $_smarty_tpl->tpl_vars['order']->_loop = true; $_smarty_tpl->tpl_vars['order']->iteration++; $_smarty_tpl->tpl_vars['order']->index++; $_smarty_tpl->tpl_vars['order']->first = $_smarty_tpl->tpl_vars['order']->index === 0; $_smarty_tpl->tpl_vars['order']->last = $_smarty_tpl->tpl_vars['order']->iteration === $_smarty_tpl->tpl_vars['order']->total; $_smarty_tpl->tpl_vars['smarty']->value['foreach']['myLoop']['first'] = $_smarty_tpl->tpl_vars['order']->first; $_smarty_tpl->tpl_vars['smarty']->value['foreach']['myLoop']['index']++; $_smarty_tpl->tpl_vars['smarty']->value['foreach']['myLoop']['last'] = $_smarty_tpl->tpl_vars['order']->last; ?> <tr class="<?php if ($_smarty_tpl->getVariable('smarty')->value['foreach']['myLoop']['first']) { ?> first_item<?php } elseif ($_smarty_tpl->getVariable('smarty')->value['foreach']['myLoop']['last']) { ?> last_item<?php } else { ?> item<?php } ?> <?php if ($_smarty_tpl->getVariable('smarty')->value['foreach']['myLoop']['index'] % 2) { ?> alternate_item<?php } ?> "> <td class="history_link bold"> <?php if (isset($_smarty_tpl->tpl_vars['order']->value['invoice']) && $_smarty_tpl->tpl_vars['order']->value['invoice'] && isset($_smarty_tpl->tpl_vars['order']->value['virtual']) && $_smarty_tpl->tpl_vars['order']->value['virtual']) { ?> <img class="icon" src="<?php echo $_smarty_tpl->tpl_vars['img_dir']->value; ?> icon/download_product.gif" alt="<?php echo smartyTranslate(array('s' => 'Products to download'), $_smarty_tpl); ?> " title="<?php echo smartyTranslate(array('s' => 'Products to download'), $_smarty_tpl); ?> " /> <?php } ?> <a class="color-myaccount" href="javascript:showOrder(1, <?php echo intval($_smarty_tpl->tpl_vars['order']->value['id_order']); ?> , '<?php ob_start(); echo intval($_smarty_tpl->tpl_vars['order']->value['id_order']); $_tmp5 = ob_get_clean(); echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('order-detail', true, null, "id_order=" . $_tmp5), ENT_QUOTES, 'UTF-8', true); ?> ');"> <?php echo Order::getUniqReferenceOf($_smarty_tpl->tpl_vars['order']->value['id_order']); ?> </a> </td> <td data-value="<?php echo smarty_modifier_regex_replace($_smarty_tpl->tpl_vars['order']->value['date_add'], "/[\\-\\:\\ ]/", ''); ?> " class="history_date bold"> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['dateFormat'][0][0]->dateFormat(array('date' => $_smarty_tpl->tpl_vars['order']->value['date_add'], 'full' => 0), $_smarty_tpl); ?> </td> <td class="history_price" data-value="<?php echo $_smarty_tpl->tpl_vars['order']->value['total_paid']; ?> "> <span class="price"> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['displayPrice'][0][0]->displayPriceSmarty(array('price' => $_smarty_tpl->tpl_vars['order']->value['total_paid'], 'currency' => $_smarty_tpl->tpl_vars['order']->value['id_currency'], 'no_utf8' => false, 'convert' => false), $_smarty_tpl); ?> </span> </td> <td class="history_method"><?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['payment'], ENT_QUOTES, 'UTF-8', true); ?> </td> <td<?php if (isset($_smarty_tpl->tpl_vars['order']->value['order_state'])) { ?> data-value="<?php echo $_smarty_tpl->tpl_vars['order']->value['id_order_state']; ?> "<?php } ?> class="history_state"> <?php if (isset($_smarty_tpl->tpl_vars['order']->value['order_state'])) { ?> <span class="label<?php if (isset($_smarty_tpl->tpl_vars['order']->value['order_state_color']) && Tools::getBrightness($_smarty_tpl->tpl_vars['order']->value['order_state_color']) > 128) { ?> dark<?php } ?> "<?php if (isset($_smarty_tpl->tpl_vars['order']->value['order_state_color']) && $_smarty_tpl->tpl_vars['order']->value['order_state_color']) { ?> style="background-color:<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['order_state_color'], ENT_QUOTES, 'UTF-8', true); ?> ; border-color:<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['order_state_color'], ENT_QUOTES, 'UTF-8', true); ?> ;"<?php } ?> > <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['order']->value['order_state'], ENT_QUOTES, 'UTF-8', true); ?> </span> <?php } ?> </td> <td class="history_invoice"> <?php if (isset($_smarty_tpl->tpl_vars['order']->value['invoice']) && $_smarty_tpl->tpl_vars['order']->value['invoice'] && isset($_smarty_tpl->tpl_vars['order']->value['invoice_number']) && $_smarty_tpl->tpl_vars['order']->value['invoice_number'] && isset($_smarty_tpl->tpl_vars['invoiceAllowed']->value) && $_smarty_tpl->tpl_vars['invoiceAllowed']->value == true) { ?> <a class="link-button" href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('pdf-invoice', true, null, "id_order=" . (string) $_smarty_tpl->tpl_vars['order']->value['id_order']), ENT_QUOTES, 'UTF-8', true); ?> " title="<?php echo smartyTranslate(array('s' => 'Invoice'), $_smarty_tpl); ?> " target="_blank"> <i class="icon-file-text large"></i><?php echo smartyTranslate(array('s' => 'PDF'), $_smarty_tpl); ?> </a> <?php } else { ?> - <?php } ?> </td> <td class="history_detail"> <a class="btn btn-default button button-small" href="javascript:showOrder(1, <?php echo intval($_smarty_tpl->tpl_vars['order']->value['id_order']); ?> , '<?php ob_start(); echo intval($_smarty_tpl->tpl_vars['order']->value['id_order']); $_tmp6 = ob_get_clean(); echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('order-detail', true, null, "id_order=" . $_tmp6), ENT_QUOTES, 'UTF-8', true); ?> ');"> <span> <?php echo smartyTranslate(array('s' => 'Details'), $_smarty_tpl); ?> <i class="icon-chevron-right right"></i> </span> </a> <?php if (isset($_smarty_tpl->tpl_vars['opc']->value) && $_smarty_tpl->tpl_vars['opc']->value) { ?> <a class="link-button" href="<?php ob_start(); echo intval($_smarty_tpl->tpl_vars['order']->value['id_order']); $_tmp7 = ob_get_clean(); echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('order-opc', true, null, "submitReorder&id_order=" . $_tmp7), ENT_QUOTES, 'UTF-8', true); ?> " title="<?php echo smartyTranslate(array('s' => 'Reorder'), $_smarty_tpl); ?> "> <?php } else { ?> <a class="link-button" href="<?php ob_start(); echo intval($_smarty_tpl->tpl_vars['order']->value['id_order']); $_tmp8 = ob_get_clean(); echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('order', true, null, "submitReorder&id_order=" . $_tmp8), ENT_QUOTES, 'UTF-8', true); ?> " title="<?php echo smartyTranslate(array('s' => 'Reorder'), $_smarty_tpl); ?> "> <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['reorderingAllowed']->value) && $_smarty_tpl->tpl_vars['reorderingAllowed']->value) { ?> <i class="icon-refresh"></i><?php echo smartyTranslate(array('s' => 'Reorder'), $_smarty_tpl); ?> <?php } ?> </a> </td> </tr> <?php } ?> </tbody> </table> <div id="block-order-detail" class="unvisible"> </div> <?php } else { ?> <p class="alert alert-warning"><?php echo smartyTranslate(array('s' => 'You have not placed any orders.'), $_smarty_tpl); ?> </p> <?php } ?> </div> <ul class="footer_links clearfix"> <li> <a class="btn btn-default button button-small" href="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('my-account', true), ENT_QUOTES, 'UTF-8', true); ?> "> <span> <i class="icon-chevron-left"></i> <?php echo smartyTranslate(array('s' => 'Back to Your Account'), $_smarty_tpl); ?> </span> </a> </li> <li> <a class="btn btn-default button button-small" href="<?php echo $_smarty_tpl->tpl_vars['base_dir']->value; ?> "> <span><i class="icon-chevron-left"></i> <?php echo smartyTranslate(array('s' => 'Home'), $_smarty_tpl); ?> </span> </a> </li> </ul> <?php }
/** * Assign smarty variables for the header */ public function initHeader() { header('Cache-Control: no-store, no-cache'); // Multishop $is_multishop = Shop::isFeatureActive(); // Quick access $quick_access = QuickAccess::getQuickAccesses($this->context->language->id); foreach ($quick_access as $index => $quick) { if ($quick['link'] == '../' && Shop::getContext() == Shop::CONTEXT_SHOP) { $url = $this->context->shop->getBaseURL(); if (!$url) { unset($quick_access[$index]); continue; } $quick_access[$index]['link'] = $url; } else { preg_match('/controller=(.+)(&.+)?$/', $quick['link'], $admin_tab); if (isset($admin_tab[1])) { if (strpos($admin_tab[1], '&')) { $admin_tab[1] = substr($admin_tab[1], 0, strpos($admin_tab[1], '&')); } $token = Tools::getAdminToken($admin_tab[1] . (int) Tab::getIdFromClassName($admin_tab[1]) . (int) $this->context->employee->id); $quick_access[$index]['target'] = $admin_tab[1]; $quick_access[$index]['link'] .= '&token=' . $token; } } } //$link = preg_replace('/&token=[a-z0-9]{32}/', '', basename($_SERVER['REQUEST_URI'])); //$currentPage = 'index.php?controller='.$this->context->controller->controller_name."&".$this->display.$this->table; // Tab list $tabs = Tab::getTabs($this->context->language->id, 0); $current_id = Tab::getCurrentParentId(); foreach ($tabs as $index => $tab) { if (!Tab::checkTabRights($tab['id_tab']) || $tab['class_name'] == 'AdminStock' && Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') == 0 || $tab['class_name'] == 'AdminCarrierWizard') { unset($tabs[$index]); continue; } $img_cache_url = 'themes/' . $this->context->employee->bo_theme . '/img/t/' . $tab['class_name'] . '.png'; $img_exists_cache = Tools::file_exists_cache(_PS_ADMIN_DIR_ . $img_cache_url); // retrocompatibility : change png to gif if icon not exists if (!$img_exists_cache) { $img_exists_cache = Tools::file_exists_cache(_PS_ADMIN_DIR_ . str_replace('.png', '.gif', $img_cache_url)); } if ($img_exists_cache) { $path_img = $img = $img_exists_cache; } else { $path_img = _PS_IMG_DIR_ . 't/' . $tab['class_name'] . '.png'; // Relative link will always work, whatever the base uri set in the admin $img = '../img/t/' . $tab['class_name'] . '.png'; } if (trim($tab['module']) != '') { $path_img = _PS_MODULE_DIR_ . $tab['module'] . '/' . $tab['class_name'] . '.png'; // Relative link will always work, whatever the base uri set in the admin $img = '../modules/' . $tab['module'] . '/' . $tab['class_name'] . '.png'; } // retrocompatibility if (!file_exists($path_img)) { $img = str_replace('png', 'gif', $img); } // tab[class_name] does not contains the "Controller" suffix $tabs[$index]['current'] = $tab['class_name'] . 'Controller' == get_class($this) || $current_id == $tab['id_tab']; $tabs[$index]['img'] = $img; $tabs[$index]['href'] = $this->context->link->getAdminLink($tab['class_name']); $sub_tabs = Tab::getTabs($this->context->language->id, $tab['id_tab']); foreach ($sub_tabs as $index2 => $sub_tab) { //check if module is enable and if (isset($sub_tab['module']) && !empty($sub_tab['module'])) { $module = Module::getInstanceByName($sub_tab['module']); if (is_object($module) && !$module->isEnabledForShopContext()) { unset($sub_tabs[$index2]); continue; } } if (Tab::checkTabRights($sub_tab['id_tab']) === true && (bool) $sub_tab['active'] && $sub_tab['class_name'] != 'AdminCarrierWizard') { $sub_tabs[$index2]['href'] = $this->context->link->getAdminLink($sub_tab['class_name']); $sub_tabs[$index2]['current'] = $sub_tab['class_name'] . 'Controller' == get_class($this) || $sub_tab['class_name'] == Tools::getValue('controller'); } elseif ($sub_tab['class_name'] == 'AdminCarrierWizard' && $sub_tab['class_name'] . 'Controller' == get_class($this)) { foreach ($sub_tabs as $i => $tab) { if ($tab['class_name'] == 'AdminCarriers') { break; } } $sub_tabs[$i]['current'] = true; unset($sub_tabs[$index2]); } else { unset($sub_tabs[$index2]); } } $tabs[$index]['sub_tabs'] = $sub_tabs; } if (Validate::isLoadedObject($this->context->employee)) { $accesses = Profile::getProfileAccesses($this->context->employee->id_profile, 'class_name'); /* Hooks are volontary out the initialize array (need those variables already assigned) */ $bo_color = empty($this->context->employee->bo_color) ? '#FFFFFF' : $this->context->employee->bo_color; $this->context->smarty->assign(array('autorefresh_notifications' => Configuration::get('PS_ADMINREFRESH_NOTIFICATION'), 'help_box' => Configuration::get('PS_HELPBOX'), 'round_mode' => Configuration::get('PS_PRICE_ROUND_MODE'), 'brightness' => Tools::getBrightness($bo_color) < 128 ? 'white' : '#383838', 'bo_width' => (int) $this->context->employee->bo_width, 'bo_color' => isset($this->context->employee->bo_color) ? Tools::htmlentitiesUTF8($this->context->employee->bo_color) : null, 'show_new_orders' => Configuration::get('PS_SHOW_NEW_ORDERS') && isset($accesses['AdminOrders']) && $accesses['AdminOrders']['view'], 'show_new_customers' => Configuration::get('PS_SHOW_NEW_CUSTOMERS') && isset($accesses['AdminCustomers']) && $accesses['AdminCustomers']['view'], 'show_new_messages' => Configuration::get('PS_SHOW_NEW_MESSAGES') && isset($accesses['AdminCustomerThreads']) && $accesses['AdminCustomerThreads']['view'], 'employee' => $this->context->employee, 'search_type' => Tools::getValue('bo_search_type'), 'bo_query' => Tools::safeOutput(Tools::stripslashes(Tools::getValue('bo_query'))), 'quick_access' => $quick_access, 'multi_shop' => Shop::isFeatureActive(), 'shop_list' => Helper::renderShopList(), 'shop' => $this->context->shop, 'shop_group' => new ShopGroup((int) Shop::getContextShopGroupID()), 'current_parent_id' => (int) Tab::getCurrentParentId(), 'tabs' => $tabs, 'is_multishop' => $is_multishop, 'multishop_context' => $this->multishop_context, 'default_tab_link' => $this->context->link->getAdminLink(Tab::getClassNameById((int) Context::getContext()->employee->default_tab)), 'collapse_menu' => isset($this->context->cookie->collapse_menu) ? (int) $this->context->cookie->collapse_menu : 0)); } else { $this->context->smarty->assign('default_tab_link', $this->context->link->getAdminLink('AdminDashboard')); } // Shop::initialize() in config.php may empty $this->context->shop->virtual_uri so using a new shop instance for getBaseUrl() $this->context->shop = new Shop((int) $this->context->shop->id); $this->context->smarty->assign(array('img_dir' => _PS_IMG_, 'iso' => $this->context->language->iso_code, 'class_name' => $this->className, 'iso_user' => $this->context->language->iso_code, 'country_iso_code' => $this->context->country->iso_code, 'version' => _PS_VERSION_, 'lang_iso' => $this->context->language->iso_code, 'full_language_code' => $this->context->language->language_code, 'link' => $this->context->link, 'shop_name' => Configuration::get('PS_SHOP_NAME'), 'base_url' => $this->context->shop->getBaseURL(), 'tab' => isset($tab) ? $tab : null, 'current_parent_id' => (int) Tab::getCurrentParentId(), 'tabs' => $tabs, 'install_dir_exists' => file_exists(_PS_ADMIN_DIR_ . '/../install'), 'pic_dir' => _THEME_PROD_PIC_DIR_, 'controller_name' => htmlentities(Tools::getValue('controller')), 'currentIndex' => self::$currentIndex, 'bootstrap' => $this->bootstrap, 'default_language' => (int) Configuration::get('PS_LANG_DEFAULT'), 'display_addons_connection' => Tab::checkTabRights(Tab::getIdFromClassName('AdminModulesController')))); $module = Module::getInstanceByName('themeconfigurator'); $lang = ''; if (Configuration::get('PS_REWRITING_SETTINGS') && count(Language::getLanguages(true)) > 1) { $lang = Language::getIsoById($this->context->employee->id_lang) . '/'; } if (is_object($module) && $module->active && (int) Configuration::get('PS_TC_ACTIVE') == 1 && $this->context->shop->getBaseURL()) { $this->context->smarty->assign('base_url_tc', $this->context->shop->getBaseUrl() . (Configuration::get('PS_REWRITING_SETTINGS') ? '' : 'index.php') . $lang . '?live_configurator_token=' . $module->getLiveConfiguratorToken() . '&id_employee=' . (int) $this->context->employee->id . '&id_shop=' . (int) $this->context->shop->id . (Configuration::get('PS_TC_THEME') != '' ? '&theme=' . Configuration::get('PS_TC_THEME') : '') . (Configuration::get('PS_TC_FONT') != '' ? '&theme_font=' . Configuration::get('PS_TC_FONT') : '')); } }
public function renderView() { $order = new Order(Tools::getValue('id_order')); if (!Validate::isLoadedObject($order)) { $this->errors[] = Tools::displayError('The order cannot be found within your database.'); } $customer = new Customer($order->id_customer); $carrier = new Carrier($order->id_carrier); $products = $this->getProducts($order); $order_details = AphOrderDetail::getList($order->id); foreach ($order_details as &$order_detail) { $products[$order_detail['id_order_detail']]['delivery_date'] = $order_detail['delivery_date']; $products[$order_detail['id_order_detail']]['delivery_time_from'] = $order_detail['delivery_time_from']; $products[$order_detail['id_order_detail']]['delivery_time_to'] = $order_detail['delivery_time_to']; } $currency = new Currency((int) $order->id_currency); // Carrier module call $carrier_module_call = null; if ($carrier->is_module) { $module = Module::getInstanceByName($carrier->external_module_name); if (method_exists($module, 'displayInfoByCart')) { $carrier_module_call = call_user_func(array($module, 'displayInfoByCart'), $order->id_cart); } } // Retrieve addresses information $addressInvoice = new Address($order->id_address_invoice, $this->context->language->id); if (Validate::isLoadedObject($addressInvoice) && $addressInvoice->id_state) { $invoiceState = new State((int) $addressInvoice->id_state); } if ($order->id_address_invoice == $order->id_address_delivery) { $addressDelivery = $addressInvoice; if (isset($invoiceState)) { $deliveryState = $invoiceState; } } else { $addressDelivery = new Address($order->id_address_delivery, $this->context->language->id); if (Validate::isLoadedObject($addressDelivery) && $addressDelivery->id_state) { $deliveryState = new State((int) $addressDelivery->id_state); } } $this->toolbar_title = sprintf($this->l('Order #%1$d (%2$s) - %3$s %4$s'), $order->id, $order->reference, $customer->firstname, $customer->lastname); if (Shop::isFeatureActive()) { $shop = new Shop((int) $order->id_shop); $this->toolbar_title .= ' - ' . sprintf($this->l('Shop: %s'), $shop->name); } // gets warehouses to ship products, if and only if advanced stock management is activated $warehouse_list = null; $order_details = $order->getOrderDetailList(); foreach ($order_details as $order_detail) { $product = new Product($order_detail['product_id']); if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && $product->advanced_stock_management) { $warehouses = Warehouse::getWarehousesByProductId($order_detail['product_id'], $order_detail['product_attribute_id']); foreach ($warehouses as $warehouse) { if (!isset($warehouse_list[$warehouse['id_warehouse']])) { $warehouse_list[$warehouse['id_warehouse']] = $warehouse; } } } } $payment_methods = array(); foreach (PaymentModule::getInstalledPaymentModules() as $payment) { $module = Module::getInstanceByName($payment['name']); if (Validate::isLoadedObject($module) && $module->active) { $payment_methods[] = $module->displayName; } } // display warning if there are products out of stock $display_out_of_stock_warning = false; $current_order_state = $order->getCurrentOrderState(); if (Configuration::get('PS_STOCK_MANAGEMENT') && (!Validate::isLoadedObject($current_order_state) || $current_order_state->delivery != 1 && $current_order_state->shipped != 1)) { $display_out_of_stock_warning = true; } // products current stock (from stock_available) foreach ($products as &$product) { // Get total customized quantity for current product $customized_product_quantity = 0; if (is_array($product['customizedDatas'])) { foreach ($product['customizedDatas'] as $customizationPerAddress) { foreach ($customizationPerAddress as $customizationId => $customization) { $customized_product_quantity += (int) $customization['quantity']; } } } $product['customized_product_quantity'] = $customized_product_quantity; $product['current_stock'] = StockAvailable::getQuantityAvailableByProduct($product['product_id'], $product['product_attribute_id'], $product['id_shop']); $resume = OrderSlip::getProductSlipResume($product['id_order_detail']); $product['quantity_refundable'] = $product['product_quantity'] - $resume['product_quantity']; $product['amount_refundable'] = $product['total_price_tax_excl'] - $resume['amount_tax_excl']; $product['amount_refundable_tax_incl'] = $product['total_price_tax_incl'] - $resume['amount_tax_incl']; $product['amount_refund'] = Tools::displayPrice($resume['amount_tax_incl'], $currency); $product['refund_history'] = OrderSlip::getProductSlipDetail($product['id_order_detail']); $product['return_history'] = OrderReturn::getProductReturnDetail($product['id_order_detail']); // if the current stock requires a warning if ($product['current_stock'] <= 0 && $display_out_of_stock_warning) { $this->displayWarning($this->l('This product is out of stock: ') . ' ' . $product['product_name']); } if ($product['id_warehouse'] != 0) { $warehouse = new Warehouse((int) $product['id_warehouse']); $product['warehouse_name'] = $warehouse->name; $warehouse_location = WarehouseProductLocation::getProductLocation($product['product_id'], $product['product_attribute_id'], $product['id_warehouse']); if (!empty($warehouse_location)) { $product['warehouse_location'] = $warehouse_location; } else { $product['warehouse_location'] = false; } } else { $product['warehouse_name'] = '--'; $product['warehouse_location'] = false; } } $gender = new Gender((int) $customer->id_gender, $this->context->language->id); $history = $order->getHistory($this->context->language->id); foreach ($history as &$order_state) { $order_state['text-color'] = Tools::getBrightness($order_state['color']) < 128 ? 'white' : 'black'; } // Smarty assign $this->tpl_view_vars = array('order' => $order, 'cart' => new Cart($order->id_cart), 'customer' => $customer, 'gender' => $gender, 'customer_addresses' => $customer->getAddresses($this->context->language->id), 'addresses' => array('delivery' => $addressDelivery, 'deliveryState' => isset($deliveryState) ? $deliveryState : null, 'invoice' => $addressInvoice, 'invoiceState' => isset($invoiceState) ? $invoiceState : null), 'customerStats' => $customer->getStats(), 'products' => $products, 'discounts' => $order->getCartRules(), 'orders_total_paid_tax_incl' => $order->getOrdersTotalPaid(), 'total_paid' => $order->getTotalPaid(), 'returns' => OrderReturn::getOrdersReturn($order->id_customer, $order->id), 'customer_thread_message' => CustomerThread::getCustomerMessages($order->id_customer, null, $order->id), 'orderMessages' => OrderMessage::getOrderMessages($order->id_lang), 'messages' => Message::getMessagesByOrderId($order->id, true), 'carrier' => new Carrier($order->id_carrier), 'history' => $history, 'states' => OrderState::getOrderStates($this->context->language->id), 'warehouse_list' => $warehouse_list, 'sources' => ConnectionsSource::getOrderSources($order->id), 'currentState' => $order->getCurrentOrderState(), 'currency' => new Currency($order->id_currency), 'currencies' => Currency::getCurrenciesByIdShop($order->id_shop), 'previousOrder' => $order->getPreviousOrderId(), 'nextOrder' => $order->getNextOrderId(), 'current_index' => self::$currentIndex, 'carrierModuleCall' => $carrier_module_call, 'iso_code_lang' => $this->context->language->iso_code, 'id_lang' => $this->context->language->id, 'can_edit' => $this->tabAccess['edit'] == 1, 'current_id_lang' => $this->context->language->id, 'invoices_collection' => $order->getInvoicesCollection(), 'not_paid_invoices_collection' => $order->getNotPaidInvoicesCollection(), 'payment_methods' => $payment_methods, 'invoice_management_active' => Configuration::get('PS_INVOICE', null, null, $order->id_shop), 'display_warehouse' => (int) Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'), 'HOOK_CONTENT_ORDER' => Hook::exec('displayAdminOrderContentOrder', array('order' => $order, 'products' => $products, 'customer' => $customer)), 'HOOK_CONTENT_SHIP' => Hook::exec('displayAdminOrderContentShip', array('order' => $order, 'products' => $products, 'customer' => $customer)), 'HOOK_TAB_ORDER' => Hook::exec('displayAdminOrderTabOrder', array('order' => $order, 'products' => $products, 'customer' => $customer)), 'HOOK_TAB_SHIP' => Hook::exec('displayAdminOrderTabShip', array('order' => $order, 'products' => $products, 'customer' => $customer))); $options_time = array(); $time_slice = Configuration::get('APH_CALENDAR_TIME_SLICE'); for ($hours = 0; $hours < 24; $hours++) { // the interval for hours is '1' for ($mins = 0; $mins < 60; $mins += $time_slice) { // the interval for mins is 'APH_CALENDAR_TIME_SLICE' $options_time[str_pad($hours, 2, '0', STR_PAD_LEFT) . ':' . str_pad($mins, 2, '0', STR_PAD_LEFT)] = str_pad($hours, 2, '0', STR_PAD_LEFT) . ':' . str_pad($mins, 2, '0', STR_PAD_LEFT); } } $this->tpl_view_vars['options_time'] = $options_time; $employees = array(); $e = AphEmployeeProduct::getEmployeesByShop((int) Context::getContext()->shop->id); foreach ($e as $employee) { $employees[$employee['id_employee']] = $employee['fullName']; } $this->tpl_view_vars['employees'] = $employees; $helper = new HelperView($this); $this->setHelperDisplay($helper); $helper->tpl_vars = $this->getTemplateViewVars(); $helper->base_folder = $this->getTemplatePath() . 'aph_orders/helpers/'; $helper->base_tpl = 'view/view.tpl'; $view = $helper->generateView(); return $view; }
</script> <script type="text/javascript" src="' . _PS_JS_DIR_ . 'jquery/jquery-1.4.4.min.js"></script> <script type="text/javascript" src="' . _PS_JS_DIR_ . 'jquery/jquery.hoverIntent.minified.js"></script> <script type="text/javascript" src="' . _PS_JS_DIR_ . 'jquery/jquery.cluetip.js"></script> <script type="text/javascript" src="' . _PS_JS_DIR_ . 'admin.js"></script> <script type="text/javascript" src="' . _PS_JS_DIR_ . 'toggle.js"></script> <script type="text/javascript" src="' . _PS_JS_DIR_ . 'tools.js"></script> <script type="text/javascript" src="' . _PS_JS_DIR_ . 'ajax.js"></script> <link rel="shortcut icon" href="' . _PS_IMG_ . 'favicon.ico" /> ' . Module::hookExec('backOfficeHeader') . ' <!--[if IE]> <link type="text/css" rel="stylesheet" href="' . _PS_CSS_DIR_ . 'admin-ie.css" /> <![endif]--> <style type="text/css"> div#header_infos, div#header_infos a#header_shopname, div#header_infos a#header_logout, div#header_infos a#header_foaccess { color:' . (Tools::getBrightness(empty($employee->bo_color) ? '#FFFFFF' : $employee->bo_color) < 128 ? 'white' : '#383838') . ' } </style> </head> <body ' . (!empty($employee->bo_color) ? 'style="background:' . Tools::htmlentitiesUTF8($employee->bo_color) . '"' : '') . '> <div id="top_container"> <div id="container"> <div id="header_infos"><span> <a id="header_shopname" href="index.php"><span>' . Configuration::get('PS_SHOP_NAME') . '</span></a><br /> ' . Tools::substr($employee->firstname, 0, 1) . '. ' . htmlentities($employee->lastname, ENT_COMPAT, 'UTF-8') . ' [ <a href="index.php?logout" id="header_logout"><span>' . translate('logout') . '</span></a> ] - <a href="' . __PS_BASE_URI__ . '" id="header_foaccess" target="_blank" title="' . translate('View my shop') . '"><span>' . translate('View my shop') . '</span></a> - <a href="index.php?tab=AdminEmployees&id_employee=' . (int) $cookie->id_employee . '&updateemployee&token=' . Tools::getAdminTokenLite('AdminEmployees') . '" style="font-size: 10px;"><img src="../img/admin/employee.gif" alt="" /> ' . translate('My preferences') . '</a> </span></div> <div id="header_search"> <form method="post" action="index.php?tab=AdminSearch&token=' . Tools::getAdminTokenLite('AdminSearch') . '">
/** * Assign smarty variables for the header */ public function initHeader() { // Multishop $is_multishop = Shop::isFeatureActive(); // Quick access $quick_access = QuickAccess::getQuickAccesses($this->context->language->id); foreach ($quick_access as $index => $quick) { if ($quick['link'] == '../' && Shop::getContext() == Shop::CONTEXT_SHOP) { $url = $this->context->shop->getBaseURL(); if (!$url) { unset($quick_access[$index]); continue; } $quick_access[$index]['link'] = $url; } else { preg_match('/controller=(.+)(&.+)?$/', $quick['link'], $admin_tab); if (isset($admin_tab[1])) { if (strpos($admin_tab[1], '&')) { $admin_tab[1] = substr($admin_tab[1], 0, strpos($admin_tab[1], '&')); } $token = Tools::getAdminToken($admin_tab[1] . (int) Tab::getIdFromClassName($admin_tab[1]) . (int) $this->context->employee->id); $quick_access[$index]['link'] .= '&token=' . $token; } } } // Tab list $tabs = Tab::getTabs($this->context->language->id, 0); $current_id = Tab::getCurrentParentId(); foreach ($tabs as $index => $tab) { if (!checkTabRights($tab['id_tab']) || $tab['class_name'] == 'AdminStock' && Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') == 0 || $tab['class_name'] == 'AdminCarrierWizard') { unset($tabs[$index]); continue; } $img_cache_url = 'themes/' . $this->context->employee->bo_theme . '/img/t/' . $tab['class_name'] . '.png'; $img_exists_cache = Tools::file_exists_cache(_PS_ADMIN_DIR_ . $img_cache_url); // retrocompatibility : change png to gif if icon not exists if (!$img_exists_cache) { $img_exists_cache = Tools::file_exists_cache(_PS_ADMIN_DIR_ . str_replace('.png', '.gif', $img_cache_url)); } if ($img_exists_cache) { $path_img = $img = $img_exists_cache; } else { $path_img = _PS_IMG_DIR_ . 't/' . $tab['class_name'] . '.png'; // Relative link will always work, whatever the base uri set in the admin $img = '../img/t/' . $tab['class_name'] . '.png'; } if (trim($tab['module']) != '') { $path_img = _PS_MODULE_DIR_ . $tab['module'] . '/' . $tab['class_name'] . '.png'; // Relative link will always work, whatever the base uri set in the admin $img = '../modules/' . $tab['module'] . '/' . $tab['class_name'] . '.png'; } // retrocompatibility if (!file_exists($path_img)) { $img = str_replace('png', 'gif', $img); } // tab[class_name] does not contains the "Controller" suffix $tabs[$index]['current'] = $tab['class_name'] . 'Controller' == get_class($this) || $current_id == $tab['id_tab']; $tabs[$index]['img'] = $img; $tabs[$index]['href'] = $this->context->link->getAdminLink($tab['class_name']); $sub_tabs = Tab::getTabs($this->context->language->id, $tab['id_tab']); foreach ($sub_tabs as $index2 => $sub_tab) { // class_name is the name of the class controller if (Tab::checkTabRights($sub_tab['id_tab']) === true && (bool) $sub_tab['active'] && $sub_tab['class_name'] != 'AdminCarrierWizard') { $sub_tabs[$index2]['href'] = $this->context->link->getAdminLink($sub_tab['class_name']); $sub_tabs[$index2]['current'] = $sub_tab['class_name'] . 'Controller' == get_class($this); } else { unset($sub_tabs[$index2]); } } $tabs[$index]['sub_tabs'] = $sub_tabs; } if (Validate::isLoadedObject($this->context->employee)) { $accesses = Profile::getProfileAccesses($this->context->employee->id_profile, 'class_name'); /* Hooks are volontary out the initialize array (need those variables already assigned) */ $bo_color = empty($this->context->employee->bo_color) ? '#FFFFFF' : $this->context->employee->bo_color; $this->context->smarty->assign(array('autorefresh_notifications' => Configuration::get('PS_ADMINREFRESH_NOTIFICATION'), 'help_box' => Configuration::get('PS_HELPBOX'), 'round_mode' => Configuration::get('PS_PRICE_ROUND_MODE'), 'brightness' => Tools::getBrightness($bo_color) < 128 ? 'white' : '#383838', 'bo_width' => (int) $this->context->employee->bo_width, 'bo_color' => isset($this->context->employee->bo_color) ? Tools::htmlentitiesUTF8($this->context->employee->bo_color) : null, 'show_new_orders' => Configuration::get('PS_SHOW_NEW_ORDERS') && $accesses['AdminOrders']['view'], 'show_new_customers' => Configuration::get('PS_SHOW_NEW_CUSTOMERS') && $accesses['AdminCustomers']['view'], 'show_new_messages' => Configuration::get('PS_SHOW_NEW_MESSAGES') && $accesses['AdminCustomerThreads']['view'], 'first_name' => Tools::substr($this->context->employee->firstname, 0, 1), 'last_name' => Tools::safeOutput($this->context->employee->lastname), 'employee' => $this->context->employee, 'search_type' => Tools::getValue('bo_search_type'), 'bo_query' => Tools::safeOutput(Tools::stripslashes(Tools::getValue('bo_query'))), 'quick_access' => $quick_access, 'multi_shop' => Shop::isFeatureActive(), 'shop_list' => Helper::renderShopList(), 'shop' => $this->context->shop, 'shop_group' => new ShopGroup((int) Shop::getContextShopGroupID()), 'current_parent_id' => (int) Tab::getCurrentParentId(), 'tabs' => $tabs, 'is_multishop' => $is_multishop, 'multishop_context' => $this->multishop_context, 'default_tab_link' => $this->context->link->getAdminLink(Tab::getClassNameById((int) Context::getContext()->employee->default_tab)), 'employee_avatar' => ImageManager::thumbnail($this->context->employee->getImage(), 'employee' . '_' . (int) $this->context->employee->id . '.' . $this->imageType, 150, $this->imageType, true, true), 'collapse_menu' => isset($this->context->cookie->collapse_menu) ? (int) $this->context->cookie->collapse_menu : 0)); } else { $this->context->smarty->assign('default_tab_link', $this->context->link->getAdminLink('AdminDashboard')); } $this->context->smarty->assign(array('img_dir' => _PS_IMG_, 'iso' => $this->context->language->iso_code, 'class_name' => $this->className, 'iso_user' => $this->context->language->iso_code, 'country_iso_code' => $this->context->country->iso_code, 'version' => _PS_VERSION_, 'lang_iso' => $this->context->language->iso_code, 'link' => $this->context->link, 'shop_name' => Configuration::get('PS_SHOP_NAME'), 'base_url' => $this->context->shop->getBaseURL(), 'tab' => isset($tab) ? $tab : null, 'current_parent_id' => (int) Tab::getCurrentParentId(), 'tabs' => $tabs, 'install_dir_exists' => file_exists(_PS_ADMIN_DIR_ . '/../install'), 'pic_dir' => _THEME_PROD_PIC_DIR_, 'controller_name' => htmlentities(Tools::getValue('controller')), 'currentIndex' => self::$currentIndex, 'bootstrap' => $this->bootstrap, 'default_language' => (int) Configuration::get('PS_LANG_DEFAULT'))); }
public function renderView() { $order = new Order(Tools::getValue('id_order')); if (!Validate::isLoadedObject($order)) { $this->errors[] = Tools::displayError('The order cannot be found within your database.'); } $customer = new Customer($order->id_customer); $carrier = new Carrier($order->id_carrier); $products = $this->getProducts($order); $currency = new Currency((int) $order->id_currency); // Carrier module call $carrier_module_call = null; if ($carrier->is_module) { $module = Module::getInstanceByName($carrier->external_module_name); if (method_exists($module, 'displayInfoByCart')) { $carrier_module_call = call_user_func(array($module, 'displayInfoByCart'), $order->id_cart); } } // Retrieve addresses information $addressInvoice = new Address($order->id_address_invoice, $this->context->language->id); if (Validate::isLoadedObject($addressInvoice) && $addressInvoice->id_state) { $invoiceState = new State((int) $addressInvoice->id_state); } if ($order->id_address_invoice == $order->id_address_delivery) { $addressDelivery = $addressInvoice; if (isset($invoiceState)) { $deliveryState = $invoiceState; } } else { $addressDelivery = new Address($order->id_address_delivery, $this->context->language->id); if (Validate::isLoadedObject($addressDelivery) && $addressDelivery->id_state) { $deliveryState = new State((int) $addressDelivery->id_state); } } $this->toolbar_title = sprintf($this->l('Order #%1$d (%2$s) - %3$s %4$s'), $order->id, $order->reference, $customer->firstname, $customer->lastname); if (Shop::isFeatureActive()) { $shop = new Shop((int) $order->id_shop); $this->toolbar_title .= ' - ' . sprintf($this->l('Shop: %s'), $shop->name); } // gets warehouses to ship products, if and only if advanced stock management is activated $warehouse_list = null; $order_details = $order->getOrderDetailList(); foreach ($order_details as $order_detail) { $product = new Product($order_detail['product_id']); if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && $product->advanced_stock_management) { $warehouses = Warehouse::getWarehousesByProductId($order_detail['product_id'], $order_detail['product_attribute_id']); foreach ($warehouses as $warehouse) { if (!isset($warehouse_list[$warehouse['id_warehouse']])) { $warehouse_list[$warehouse['id_warehouse']] = $warehouse; } } } } $payment_methods = array(); foreach (PaymentModule::getInstalledPaymentModules() as $payment) { $module = Module::getInstanceByName($payment['name']); if (Validate::isLoadedObject($module) && $module->active) { $payment_methods[] = $module->displayName; } } // display warning if there are products out of stock $display_out_of_stock_warning = false; $current_order_state = $order->getCurrentOrderState(); if (Configuration::get('PS_STOCK_MANAGEMENT') && (!Validate::isLoadedObject($current_order_state) || $current_order_state->delivery != 1 && $current_order_state->shipped != 1)) { $display_out_of_stock_warning = true; } // products current stock (from stock_available) foreach ($products as &$product) { // Get total customized quantity for current product $customized_product_quantity = 0; if (is_array($product['customizedDatas'])) { foreach ($product['customizedDatas'] as $customizationPerAddress) { foreach ($customizationPerAddress as $customizationId => $customization) { $customized_product_quantity += (int) $customization['quantity']; } } } $product['customized_product_quantity'] = $customized_product_quantity; $product['current_stock'] = StockAvailable::getQuantityAvailableByProduct($product['product_id'], $product['product_attribute_id'], $product['id_shop']); $resume = OrderSlip::getProductSlipResume($product['id_order_detail']); $product['quantity_refundable'] = $product['product_quantity'] - $resume['product_quantity']; $product['amount_refundable'] = $product['total_price_tax_excl'] - $resume['amount_tax_excl']; $product['amount_refundable_tax_incl'] = $product['total_price_tax_incl'] - $resume['amount_tax_incl']; $product['amount_refund'] = Tools::displayPrice($resume['amount_tax_incl'], $currency); $product['refund_history'] = OrderSlip::getProductSlipDetail($product['id_order_detail']); $product['return_history'] = OrderReturn::getProductReturnDetail($product['id_order_detail']); // if the current stock requires a warning if ($product['current_stock'] == 0 && $display_out_of_stock_warning) { $this->displayWarning($this->l('This product is out of stock: ') . ' ' . $product['product_name']); } if ($product['id_warehouse'] != 0) { $warehouse = new Warehouse((int) $product['id_warehouse']); $product['warehouse_name'] = $warehouse->name; $warehouse_location = WarehouseProductLocation::getProductLocation($product['product_id'], $product['product_attribute_id'], $product['id_warehouse']); if (!empty($warehouse_location)) { $product['warehouse_location'] = $warehouse_location; } else { $product['warehouse_location'] = false; } } else { $product['warehouse_name'] = '--'; $product['warehouse_location'] = false; } } $gender = new Gender((int) $customer->id_gender, $this->context->language->id); $history = $order->getHistory($this->context->language->id); foreach ($history as &$order_state) { $order_state['text-color'] = Tools::getBrightness($order_state['color']) < 128 ? 'white' : 'black'; } //by webkul to get data to show hotel rooms order data on order detail page $cart_id = Cart::getCartIdByOrderId(Tools::getValue('id_order')); $cart_detail_data = array(); $cart_detail_data_obj = new HotelCartBookingData(); $cart_detail_data = $cart_detail_data_obj->getCartCurrentDataByCartId((int) $cart_id); if ($cart_detail_data) { foreach ($cart_detail_data as $key => $value) { $product_image_id = Product::getCover($value['id_product']); $link_rewrite = (new Product((int) $value['id_product'], Configuration::get('PS_LANG_DEFAULT')))->link_rewrite[Configuration::get('PS_LANG_DEFAULT')]; if ($product_image_id) { $cart_detail_data[$key]['image_link'] = $this->context->link->getImageLink($link_rewrite, $product_image_id['id_image'], 'small_default'); } else { $cart_detail_data[$key]['image_link'] = $this->context->link->getImageLink($link_rewrite, $this->context->language->iso_code . "-default", 'small_default'); } $cart_detail_data[$key]['room_type'] = (new Product((int) $value['id_product']))->name[Configuration::get('PS_LANG_DEFAULT')]; $cart_detail_data[$key]['room_num'] = (new HotelRoomInformation((int) $value['id_room']))->room_num; $cart_detail_data[$key]['date_from'] = (new DateTime($value['date_from']))->format('d-M Y'); $cart_detail_data[$key]['date_to'] = (new DateTime($value['date_to']))->format('d-M Y'); $cust_obj = new Customer($value['id_customer']); $cart_detail_data[$key]['alloted_cust_name'] = $cust_obj->firstname . ' ' . $cust_obj->lastname; $cart_detail_data[$key]['alloted_cust_email'] = $cust_obj->email; $cart_detail_data[$key]['avail_rooms_to_swap'] = (new HotelBookingDetail())->getAvailableRoomsForSwaping($value['date_from'], $value['date_to'], $value['id_product'], $value['id_hotel']); $obj_booking_dtl = new HotelBookingDetail(); $num_days = $obj_booking_dtl->getNumberOfDays($cart_detail_data[$key]['date_from'], $cart_detail_data[$key]['date_to']); //quantity of product $cart_detail_data[$key]['amt_with_qty'] = $value['amount'] * $num_days; } } //end //by webkul to send order status on order detail page $obj_bookin_detail = new HotelBookingDetail(); $htl_booking_data_order_id = $obj_bookin_detail->getBookingDataByOrderId(Tools::getValue('id_order')); if ($htl_booking_data_order_id) { foreach ($htl_booking_data_order_id as $key => $value) { $htl_booking_data_order_id[$key]['room_num'] = (new HotelRoomInformation())->getHotelRoomInfoById($value['id_room']); $htl_booking_data_order_id[$key]['order_status'] = $value['id_status']; $htl_booking_data_order_id[$key]['date_from'] = (new DateTime($value['date_from']))->format('d-M Y'); $htl_booking_data_order_id[$key]['date_to'] = (new DateTime($value['date_to']))->format('d-M Y'); } } $htl_order_status = HotelOrderStatus::getAllHotelOrderStatus(); //end // Smarty assign $this->tpl_view_vars = array('htl_booking_order_data' => $htl_booking_data_order_id, 'hotel_order_status' => $htl_order_status, 'cart_detail_data' => $cart_detail_data, 'order' => $order, 'cart' => new Cart($order->id_cart), 'customer' => $customer, 'gender' => $gender, 'customer_addresses' => $customer->getAddresses($this->context->language->id), 'addresses' => array('delivery' => $addressDelivery, 'deliveryState' => isset($deliveryState) ? $deliveryState : null, 'invoice' => $addressInvoice, 'invoiceState' => isset($invoiceState) ? $invoiceState : null), 'customerStats' => $customer->getStats(), 'products' => $products, 'discounts' => $order->getCartRules(), 'orders_total_paid_tax_incl' => $order->getOrdersTotalPaid(), 'total_paid' => $order->getTotalPaid(), 'returns' => OrderReturn::getOrdersReturn($order->id_customer, $order->id), 'customer_thread_message' => CustomerThread::getCustomerMessages($order->id_customer, null, $order->id), 'orderMessages' => OrderMessage::getOrderMessages($order->id_lang), 'messages' => Message::getMessagesByOrderId($order->id, true), 'carrier' => new Carrier($order->id_carrier), 'history' => $history, 'states' => OrderState::getOrderStates($this->context->language->id), 'warehouse_list' => $warehouse_list, 'sources' => ConnectionsSource::getOrderSources($order->id), 'currentState' => $order->getCurrentOrderState(), 'currency' => new Currency($order->id_currency), 'currencies' => Currency::getCurrenciesByIdShop($order->id_shop), 'previousOrder' => $order->getPreviousOrderId(), 'nextOrder' => $order->getNextOrderId(), 'current_index' => self::$currentIndex, 'carrierModuleCall' => $carrier_module_call, 'iso_code_lang' => $this->context->language->iso_code, 'id_lang' => $this->context->language->id, 'can_edit' => $this->tabAccess['edit'] == 1, 'current_id_lang' => $this->context->language->id, 'invoices_collection' => $order->getInvoicesCollection(), 'not_paid_invoices_collection' => $order->getNotPaidInvoicesCollection(), 'payment_methods' => $payment_methods, 'invoice_management_active' => Configuration::get('PS_INVOICE', null, null, $order->id_shop), 'display_warehouse' => (int) Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'), 'HOOK_CONTENT_ORDER' => Hook::exec('displayAdminOrderContentOrder', array('order' => $order, 'products' => $products, 'customer' => $customer)), 'HOOK_CONTENT_SHIP' => Hook::exec('displayAdminOrderContentShip', array('order' => $order, 'products' => $products, 'customer' => $customer)), 'HOOK_TAB_ORDER' => Hook::exec('displayAdminOrderTabOrder', array('order' => $order, 'products' => $products, 'customer' => $customer)), 'HOOK_TAB_SHIP' => Hook::exec('displayAdminOrderTabShip', array('order' => $order, 'products' => $products, 'customer' => $customer))); return parent::renderView(); }
<script type="text/javascript" src="' . _PS_JS_DIR_ . 'jquery/jquery-' . _PS_JQUERY_VERSION_ . '.min.js"></script> <script type="text/javascript" src="' . _PS_JS_DIR_ . 'jquery/plugins/jquery.hoverIntent.js"></script> <script type="text/javascript" src="' . _PS_JS_DIR_ . 'jquery/plugins/cluetip/jquery.cluetip.js"></script> <script type="text/javascript" src="' . _PS_JS_DIR_ . 'admin.js"></script> <script type="text/javascript" src="' . _PS_JS_DIR_ . 'toggle.js"></script> <script type="text/javascript" src="' . _PS_JS_DIR_ . 'tools.js"></script> <script type="text/javascript" src="' . _PS_JS_DIR_ . 'ajax.js"></script> <script type="text/javascript" src="' . _PS_JS_DIR_ . 'jquery/plugins/chosen/jquery.chosen.js"></script> <link rel="shortcut icon" href="' . _PS_IMG_ . 'favicon.ico" /> ' . Hook::exec('displayBackOfficeHeader') . ' <!--[if IE]> <link type="text/css" rel="stylesheet" href="' . _PS_CSS_DIR_ . 'admin-ie.css" /> <![endif]--> <style type="text/css"> div#header_infos, div#header_infos a#header_shopname, div#header_infos a#header_logout, div#header_infos a#header_foaccess { color:' . (Tools::getBrightness(empty(Context::getContext()->employee->bo_color) ? '#FFFFFF' : Context::getContext()->employee->bo_color) < 128 ? 'white' : '#383838') . ' } </style> <script type="text/javascript"> function getPush() { $.post("ajax.php",{"getNotifications" : "1"}, function(data) { if (data) { json = jQuery.parseJSON(data); // Add orders notifications to the list html = ""; nb_notifs = 0;
function content_53ac5497acd635_62562945($_smarty_tpl) { if (!is_callable('smarty_modifier_escape')) { include '/var/www/vipinsg/tools/smarty/plugins/modifier.escape.php'; } ?> <tbody> <?php if (count($_smarty_tpl->tpl_vars['list']->value)) { $_smarty_tpl->tpl_vars['tr'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['tr']->_loop = false; $_smarty_tpl->tpl_vars['index'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['tr']->key => $_smarty_tpl->tpl_vars['tr']->value) { $_smarty_tpl->tpl_vars['tr']->_loop = true; $_smarty_tpl->tpl_vars['index']->value = $_smarty_tpl->tpl_vars['tr']->key; ?> <tr <?php if ($_smarty_tpl->tpl_vars['position_identifier']->value) { ?> id="tr_<?php echo $_smarty_tpl->tpl_vars['id_category']->value; ?> _<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value]; ?> _<?php if (isset($_smarty_tpl->tpl_vars['tr']->value['position']['position'])) { echo $_smarty_tpl->tpl_vars['tr']->value['position']['position']; } else { ?> 0<?php } ?> "<?php } ?> class="<?php if (1 & $_smarty_tpl->tpl_vars['index']->value) { ?> alt_row<?php } ?> <?php if ($_smarty_tpl->tpl_vars['row_hover']->value) { ?> row_hover<?php } ?> " <?php if (isset($_smarty_tpl->tpl_vars['tr']->value['color']) && $_smarty_tpl->tpl_vars['color_on_bg']->value) { ?> style="background-color: <?php echo $_smarty_tpl->tpl_vars['tr']->value['color']; ?> "<?php } ?> > <td class="center"> <?php ob_start(); echo $_smarty_tpl->tpl_vars['has_bulk_actions']->value; $_tmp1 = ob_get_clean(); if ($_tmp1) { ?> <?php if (isset($_smarty_tpl->tpl_vars['list_skip_actions']->value['delete'])) { ?> <?php if (!in_array($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value], $_smarty_tpl->tpl_vars['list_skip_actions']->value['delete'])) { ?> <input type="checkbox" name="<?php echo $_smarty_tpl->tpl_vars['table']->value; ?> Box[]" value="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value]; ?> " class="noborder" /> <?php } ?> <?php } else { ?> <input type="checkbox" name="<?php echo $_smarty_tpl->tpl_vars['table']->value; ?> Box[]" value="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value]; ?> " class="noborder" /> <?php } ?> <?php } ?> </td> <?php $_smarty_tpl->tpl_vars['params'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['params']->_loop = false; $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['fields_display']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['params']->key => $_smarty_tpl->tpl_vars['params']->value) { $_smarty_tpl->tpl_vars['params']->_loop = true; $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['params']->key; ?> <td <?php if (isset($_smarty_tpl->tpl_vars['params']->value['position'])) { ?> id="td_<?php if (!empty($_smarty_tpl->tpl_vars['id_category']->value)) { echo $_smarty_tpl->tpl_vars['id_category']->value; } else { ?> 0<?php } ?> _<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value]; ?> " <?php } ?> class="<?php if (!$_smarty_tpl->tpl_vars['no_link']->value) { ?> pointer<?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['position']) && $_smarty_tpl->tpl_vars['order_by']->value == 'position' && $_smarty_tpl->tpl_vars['order_way']->value != 'DESC') { ?> dragHandle<?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['align'])) { ?> <?php echo $_smarty_tpl->tpl_vars['params']->value['align']; } ?> " <?php if (!isset($_smarty_tpl->tpl_vars['params']->value['position']) && !$_smarty_tpl->tpl_vars['no_link']->value && !isset($_smarty_tpl->tpl_vars['params']->value['remove_onclick'])) { ?> onclick="document.location = '<?php echo $_smarty_tpl->tpl_vars['current_index']->value; ?> &<?php echo $_smarty_tpl->tpl_vars['identifier']->value; ?> =<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value]; if ($_smarty_tpl->tpl_vars['view']->value) { ?> &view<?php } else { ?> &update<?php } echo $_smarty_tpl->tpl_vars['table']->value; ?> &token=<?php echo $_smarty_tpl->tpl_vars['token']->value; ?> '"> <?php } else { ?> > <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['prefix'])) { echo $_smarty_tpl->tpl_vars['params']->value['prefix']; } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['color']) && isset($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['params']->value['color']])) { ?> <span class="color_field" style="background-color:<?php echo $_smarty_tpl->tpl_vars['tr']->value['color']; ?> ;color:<?php if (Tools::getBrightness($_smarty_tpl->tpl_vars['tr']->value['color']) < 128) { ?> white<?php } else { ?> #383838<?php } ?> "> <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['active'])) { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['activeVisu'])) { ?> <img src="../img/admin/<?php if ($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]) { ?> enabled.gif<?php } else { ?> disabled.gif<?php } ?> " alt="<?php if ($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]) { echo smartyTranslate(array('s' => 'Enabled'), $_smarty_tpl); } else { echo smartyTranslate(array('s' => 'Disabled'), $_smarty_tpl); } ?> " title="<?php if ($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]) { echo smartyTranslate(array('s' => 'Enabled'), $_smarty_tpl); } else { echo smartyTranslate(array('s' => 'Disabled'), $_smarty_tpl); } ?> " /> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['position'])) { ?> <?php if ($_smarty_tpl->tpl_vars['order_by']->value == 'position' && $_smarty_tpl->tpl_vars['order_way']->value != 'DESC') { ?> <a href="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['position_url_down']; ?> " <?php if (!($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['position'] != $_smarty_tpl->tpl_vars['positions']->value[count($_smarty_tpl->tpl_vars['positions']->value) - 1])) { ?> style="display: none;"<?php } ?> > <img src="../img/admin/<?php if ($_smarty_tpl->tpl_vars['order_way']->value == 'ASC') { ?> down<?php } else { ?> up<?php } ?> .gif" alt="<?php echo smartyTranslate(array('s' => 'Down'), $_smarty_tpl); ?> " title="<?php echo smartyTranslate(array('s' => 'Down'), $_smarty_tpl); ?> " /> </a> <a href="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['position_url_up']; ?> " <?php if (!($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['position'] != $_smarty_tpl->tpl_vars['positions']->value[0])) { ?> style="display: none;"<?php } ?> > <img src="../img/admin/<?php if ($_smarty_tpl->tpl_vars['order_way']->value == 'ASC') { ?> up<?php } else { ?> down<?php } ?> .gif" alt="<?php echo smartyTranslate(array('s' => 'Up'), $_smarty_tpl); ?> " title="<?php echo smartyTranslate(array('s' => 'Up'), $_smarty_tpl); ?> " /> </a> <?php } else { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['position'] + 1; ?> <?php } ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['image'])) { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['icon'])) { ?> <img src="../img/admin/<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['src']; ?> " alt="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['alt']; ?> " title="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['alt']; ?> " /> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['price'])) { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['float'])) { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['type']) && $_smarty_tpl->tpl_vars['params']->value['type'] == 'date') { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['type']) && $_smarty_tpl->tpl_vars['params']->value['type'] == 'datetime') { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['type']) && $_smarty_tpl->tpl_vars['params']->value['type'] == 'decimal') { ?> <?php echo sprintf("%.2f", $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]); ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['type']) && $_smarty_tpl->tpl_vars['params']->value['type'] == 'percent') { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> <?php echo smartyTranslate(array('s' => '%'), $_smarty_tpl); ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['type']) && $_smarty_tpl->tpl_vars['params']->value['type'] == 'editable' && isset($_smarty_tpl->tpl_vars['tr']->value['id'])) { ?> <input type="text" name="<?php echo $_smarty_tpl->tpl_vars['key']->value; ?> _<?php echo $_smarty_tpl->tpl_vars['tr']->value['id']; ?> " value="<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value], 'htmlall', 'UTF-8'); ?> " class="<?php echo $_smarty_tpl->tpl_vars['key']->value; ?> " /> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['callback'])) { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]) && $_smarty_tpl->tpl_vars['key']->value == 'color') { ?> <div style="float: left; width: 18px; height: 12px; border: 1px solid #996633; background-color: <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> ; margin-right: 4px;"></div> <?php } elseif (isset($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value])) { ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['maxlength']) && Tools::strlen($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]) > $_smarty_tpl->tpl_vars['params']->value['maxlength']) { ?> <span title="<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value], 'htmlall', 'UTF-8'); ?> "><?php echo smarty_modifier_escape($_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['truncate'][0][0]->smarty_modifier_truncate($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value], $_smarty_tpl->tpl_vars['params']->value['maxlength'], '...'), 'htmlall', 'UTF-8'); ?> </span> <?php } else { ?> <?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value], 'htmlall', 'UTF-8'); ?> <?php } ?> <?php } else { ?> -- <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['suffix'])) { echo $_smarty_tpl->tpl_vars['params']->value['suffix']; } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['color']) && isset($_smarty_tpl->tpl_vars['tr']->value['color'])) { ?> </span> <?php } ?> </td> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['shop_link_type']->value) { ?> <td class="center" title="<?php echo $_smarty_tpl->tpl_vars['tr']->value['shop_name']; ?> "> <?php if (isset($_smarty_tpl->tpl_vars['tr']->value['shop_short_name'])) { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value['shop_short_name']; ?> <?php } else { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value['shop_name']; ?> <?php } ?> </td> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['has_actions']->value) { ?> <td class="center" style="white-space: nowrap;"> <?php $_smarty_tpl->tpl_vars['action'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['action']->_loop = false; $_from = $_smarty_tpl->tpl_vars['actions']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['action']->key => $_smarty_tpl->tpl_vars['action']->value) { $_smarty_tpl->tpl_vars['action']->_loop = true; ?> <?php if (isset($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['action']->value])) { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['action']->value]; ?> <?php } ?> <?php } ?> </td> <?php } ?> </tr> <?php } } else { ?> <tr><td class="center" colspan="<?php echo count($_smarty_tpl->tpl_vars['fields_display']->value) + 2; ?> "><?php echo smartyTranslate(array('s' => 'No items found'), $_smarty_tpl); ?> </td></tr> <?php } ?> </tbody> <?php }
public function renderView() { $neoExchange = new NeoExchanges(Tools::getValue('id_neo_exchange')); $order = new Order(Tools::getValue('id_neo_exchange')); if (!Validate::isLoadedObject($neoExchange)) { $this->errors[] = Tools::displayError('The order cannot be found within your database.'); } $customer = new Customer($neoExchange->id_customer); //$carrier = new Carrier($neoExchange->id_carrier); $currency = new Currency((int) $neoExchange->id_currency); $buys = new NeoItemsBuyCore(Tools::getValue('id_neo_exchange')); $sales = new NeoItemsSalesCore(Tools::getValue('id_neo_exchange')); $products = $this->getProducts($buys); $products2 = $this->getProducts($sales); //$products = $this->getProducts($neoExchange); // Carrier module call /*$carrier_module_call = null; if ($carrier->is_module) { $module = Module::getInstanceByName($carrier->external_module_name); if (method_exists($module, 'displayInfoByCart')) $carrier_module_call = call_user_func(array($module, 'displayInfoByCart'), $neoExchange->id_cart); } // Retrieve addresses information $addressInvoice = new Address($neoExchange->id_address_invoice, $this->context->language->id); if (Validate::isLoadedObject($addressInvoice) && $addressInvoice->id_state) $invoiceState = new State((int)$addressInvoice->id_state); if ($neoExchange->id_address_invoice == $neoExchange->id_address_delivery) { $addressDelivery = $addressInvoice; if (isset($invoiceState)) $deliveryState = $invoiceState; } else { $addressDelivery = new Address($neoExchange->id_address_delivery, $this->context->language->id); if (Validate::isLoadedObject($addressDelivery) && $addressDelivery->id_state) $deliveryState = new State((int)($addressDelivery->id_state)); }*/ $this->toolbar_title = sprintf($this->l('Intercambio #%1$d (%2$s) - %3$s %4$s'), $neoExchange->id, $neoExchange->reference, $customer->firstname, $customer->lastname); if (Shop::isFeatureActive()) { $shop = new Shop((int) $neoExchange->id_shop); $this->toolbar_title .= ' - ' . sprintf($this->l('Shop: %s'), $shop->name); } // gets warehouses to ship products, if and only if advanced stock management is activated $warehouse_list = null; $payment_methods = array(); foreach (PaymentModule::getInstalledPaymentModules() as $payment) { $module = Module::getInstanceByName($payment['name']); if (Validate::isLoadedObject($module) && $module->active) { $payment_methods[] = $module->displayName; } } // display warning if there are products out of stock $display_out_of_stock_warning = false; $current_order_state = $neoExchange->getCurrentOrderState(); if (Configuration::get('PS_STOCK_MANAGEMENT') && (!Validate::isLoadedObject($current_order_state) || $current_order_state->delivery != 1 && $current_order_state->shipped != 1)) { $display_out_of_stock_warning = true; } $total_buy = 0; $total_sale = 0; $products_buy = count($products); $products_sale = count($products2); // products current stock (from stock_available) foreach ($products as &$product) { $total_buy += $product['price']; } foreach ($products2 as &$product) { $total_sale += $product['price']; } $gender = new Gender((int) $customer->id_gender, $this->context->language->id); $history = $neoExchange->getHistory($this->context->language->id); foreach ($history as &$order_state) { $order_state['text-color'] = Tools::getBrightness($order_state['color']) < 128 ? 'white' : 'black'; } // Smarty assign $this->tpl_view_vars = array('order' => $neoExchange, 'customer' => $customer, 'gender' => $gender, 'customer_addresses' => $customer->getAddresses($this->context->language->id), 'customerStats' => $customer->getStats(), 'products' => $products, 'products2' => $products2, 'total_buy' => $total_buy, 'total_sale' => $total_sale, 'products_buy' => $products_buy, 'products_sale' => $products_sale, 'neo_order_shipping_price' => 0, 'orders_total_paid_tax_incl' => $neoExchange->getOrdersTotalPaid(), 'total_paid' => $neoExchange->getTotalPaid(), 'returns' => OrderReturn::getOrdersReturn($neoExchange->id_customer, $neoExchange->id), 'customer_thread_message' => CustomerThread::getCustomerMessages($neoExchange->id_customer), 'orderMessages' => OrderMessage::getOrderMessages($neoExchange->id_lang), 'messages' => Message::getMessagesByOrderId($neoExchange->id, true), 'history' => $history, 'neoStatus' => NeoStatusCore::getNeoStatus(), 'warehouse_list' => $warehouse_list, 'sources' => ConnectionsSource::getOrderSources($neoExchange->id), 'currentState' => $neoExchange->getCurrentOrderState(), 'currency' => new Currency($neoExchange->id_currency), 'currencies' => Currency::getCurrenciesByIdShop($neoExchange->id_shop), 'previousOrder' => $neoExchange->getPreviousOrderId(), 'nextOrder' => $neoExchange->getNextOrderId(), 'current_index' => self::$currentIndex, 'iso_code_lang' => $this->context->language->iso_code, 'id_lang' => $this->context->language->id, 'can_edit' => $this->tabAccess['edit'] == 1, 'current_id_lang' => $this->context->language->id, 'invoices_collection' => $neoExchange->getInvoicesCollection(), 'not_paid_invoices_collection' => $neoExchange->getNotPaidInvoicesCollection(), 'payment_methods' => $payment_methods, 'invoice_management_active' => Configuration::get('PS_INVOICE', null, null, $neoExchange->id_shop), 'display_warehouse' => (int) Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'), 'HOOK_CONTENT_ORDER' => Hook::exec('displayAdminOrderContentOrder', array('order' => $neoExchange, 'products' => $products, 'customer' => $customer)), 'HOOK_CONTENT_SHIP' => Hook::exec('displayAdminOrderContentShip', array('order' => $neoExchange, 'products' => $products, 'customer' => $customer)), 'HOOK_TAB_ORDER' => Hook::exec('displayAdminOrderTabOrder', array('order' => $neoExchange, 'products' => $products, 'customer' => $customer)), 'HOOK_TAB_SHIP' => Hook::exec('displayAdminOrderTabShip', array('order' => $neoExchange, 'products' => $products, 'customer' => $customer))); return parent::renderView(); }
public function renderView() { $order = new Order(Tools::getValue('id_order')); if (!Validate::isLoadedObject($order)) { $this->errors[] = $this->trans('The order cannot be found within your database.', array(), 'Admin.OrdersCustomers.Notification'); } $customer = new Customer($order->id_customer); $carrier = new Carrier($order->id_carrier); $products = $this->getProducts($order); $currency = new Currency((int) $order->id_currency); // Carrier module call $carrier_module_call = null; if ($carrier->is_module) { $module = Module::getInstanceByName($carrier->external_module_name); if (method_exists($module, 'displayInfoByCart')) { $carrier_module_call = call_user_func(array($module, 'displayInfoByCart'), $order->id_cart); } } // Retrieve addresses information $addressInvoice = new Address($order->id_address_invoice, $this->context->language->id); if (Validate::isLoadedObject($addressInvoice) && $addressInvoice->id_state) { $invoiceState = new State((int) $addressInvoice->id_state); } if ($order->id_address_invoice == $order->id_address_delivery) { $addressDelivery = $addressInvoice; if (isset($invoiceState)) { $deliveryState = $invoiceState; } } else { $addressDelivery = new Address($order->id_address_delivery, $this->context->language->id); if (Validate::isLoadedObject($addressDelivery) && $addressDelivery->id_state) { $deliveryState = new State((int) $addressDelivery->id_state); } } $this->toolbar_title = $this->trans('Order #%id% (%ref%) - %firstname% %lastname%', array('%id%' => $order->id, '%ref%' => $order->reference, '%firstname%' => $customer->firstname, '%lastname%' => $customer->lastname), 'Admin.OrdersCustomers.Feature'); if (Shop::isFeatureActive()) { $shop = new Shop((int) $order->id_shop); $this->toolbar_title .= ' - ' . sprintf($this->trans('Shop: %s', array(), 'Admin.OrdersCustomers.Feature'), $shop->name); } // gets warehouses to ship products, if and only if advanced stock management is activated $warehouse_list = null; $order_details = $order->getOrderDetailList(); foreach ($order_details as $order_detail) { $product = new Product($order_detail['product_id']); if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && $product->advanced_stock_management) { $warehouses = Warehouse::getWarehousesByProductId($order_detail['product_id'], $order_detail['product_attribute_id']); foreach ($warehouses as $warehouse) { if (!isset($warehouse_list[$warehouse['id_warehouse']])) { $warehouse_list[$warehouse['id_warehouse']] = $warehouse; } } } } $payment_methods = array(); foreach (PaymentModule::getInstalledPaymentModules() as $payment) { $module = Module::getInstanceByName($payment['name']); if (Validate::isLoadedObject($module) && $module->active) { $payment_methods[] = $module->displayName; } } // display warning if there are products out of stock $display_out_of_stock_warning = false; $current_order_state = $order->getCurrentOrderState(); if (Configuration::get('PS_STOCK_MANAGEMENT') && (!Validate::isLoadedObject($current_order_state) || $current_order_state->delivery != 1 && $current_order_state->shipped != 1)) { $display_out_of_stock_warning = true; } // products current stock (from stock_available) foreach ($products as &$product) { // Get total customized quantity for current product $customized_product_quantity = 0; if (is_array($product['customizedDatas'])) { foreach ($product['customizedDatas'] as $customizationPerAddress) { foreach ($customizationPerAddress as $customizationId => $customization) { $customized_product_quantity += (int) $customization['quantity']; } } } $product['customized_product_quantity'] = $customized_product_quantity; $product['current_stock'] = StockAvailable::getQuantityAvailableByProduct($product['product_id'], $product['product_attribute_id'], $product['id_shop']); $resume = OrderSlip::getProductSlipResume($product['id_order_detail']); $product['quantity_refundable'] = $product['product_quantity'] - $resume['product_quantity']; $product['amount_refundable'] = $product['total_price_tax_excl'] - $resume['amount_tax_excl']; $product['amount_refundable_tax_incl'] = $product['total_price_tax_incl'] - $resume['amount_tax_incl']; $product['amount_refund'] = Tools::displayPrice($resume['amount_tax_incl'], $currency); $product['refund_history'] = OrderSlip::getProductSlipDetail($product['id_order_detail']); $product['return_history'] = OrderReturn::getProductReturnDetail($product['id_order_detail']); // if the current stock requires a warning if ($product['current_stock'] <= 0 && $display_out_of_stock_warning) { $this->displayWarning($this->trans('This product is out of stock: ', array(), 'Admin.OrdersCustomers.Notification') . ' ' . $product['product_name']); } if ($product['id_warehouse'] != 0) { $warehouse = new Warehouse((int) $product['id_warehouse']); $product['warehouse_name'] = $warehouse->name; $warehouse_location = WarehouseProductLocation::getProductLocation($product['product_id'], $product['product_attribute_id'], $product['id_warehouse']); if (!empty($warehouse_location)) { $product['warehouse_location'] = $warehouse_location; } else { $product['warehouse_location'] = false; } } else { $product['warehouse_name'] = '--'; $product['warehouse_location'] = false; } } // Package management for order foreach ($products as &$product) { $pack_items = $product['cache_is_pack'] ? Pack::getItemTable($product['id_product'], $this->context->language->id, true) : array(); foreach ($pack_items as &$pack_item) { $pack_item['current_stock'] = StockAvailable::getQuantityAvailableByProduct($pack_item['id_product'], $pack_item['id_product_attribute'], $pack_item['id_shop']); // if the current stock requires a warning if ($product['current_stock'] <= 0 && $display_out_of_stock_warning) { $this->displayWarning($this->trans('This product, included in package (' . $product['product_name'] . ') is out of stock: ', array(), 'Admin.OrdersCustomers.Notification') . ' ' . $pack_item['product_name']); } $this->setProductImageInformations($pack_item); if ($pack_item['image'] != null) { $name = 'product_mini_' . (int) $pack_item['id_product'] . (isset($pack_item['id_product_attribute']) ? '_' . (int) $pack_item['id_product_attribute'] : '') . '.jpg'; // generate image cache, only for back office $pack_item['image_tag'] = ImageManager::thumbnail(_PS_IMG_DIR_ . 'p/' . $pack_item['image']->getExistingImgPath() . '.jpg', $name, 45, 'jpg'); if (file_exists(_PS_TMP_IMG_DIR_ . $name)) { $pack_item['image_size'] = getimagesize(_PS_TMP_IMG_DIR_ . $name); } else { $pack_item['image_size'] = false; } } } $product['pack_items'] = $pack_items; } $gender = new Gender((int) $customer->id_gender, $this->context->language->id); $history = $order->getHistory($this->context->language->id); foreach ($history as &$order_state) { $order_state['text-color'] = Tools::getBrightness($order_state['color']) < 128 ? 'white' : 'black'; } // Smarty assign $this->tpl_view_vars = array('order' => $order, 'cart' => new Cart($order->id_cart), 'customer' => $customer, 'gender' => $gender, 'customer_addresses' => $customer->getAddresses($this->context->language->id), 'addresses' => array('delivery' => $addressDelivery, 'deliveryState' => isset($deliveryState) ? $deliveryState : null, 'invoice' => $addressInvoice, 'invoiceState' => isset($invoiceState) ? $invoiceState : null), 'customerStats' => $customer->getStats(), 'products' => $products, 'discounts' => $order->getCartRules(), 'orders_total_paid_tax_incl' => $order->getOrdersTotalPaid(), 'total_paid' => $order->getTotalPaid(), 'returns' => OrderReturn::getOrdersReturn($order->id_customer, $order->id), 'customer_thread_message' => CustomerThread::getCustomerMessages($order->id_customer, null, $order->id), 'orderMessages' => OrderMessage::getOrderMessages($order->id_lang), 'messages' => Message::getMessagesByOrderId($order->id, true), 'carrier' => new Carrier($order->id_carrier), 'history' => $history, 'states' => OrderState::getOrderStates($this->context->language->id), 'warehouse_list' => $warehouse_list, 'sources' => ConnectionsSource::getOrderSources($order->id), 'currentState' => $order->getCurrentOrderState(), 'currency' => new Currency($order->id_currency), 'currencies' => Currency::getCurrenciesByIdShop($order->id_shop), 'previousOrder' => $order->getPreviousOrderId(), 'nextOrder' => $order->getNextOrderId(), 'current_index' => self::$currentIndex, 'carrierModuleCall' => $carrier_module_call, 'iso_code_lang' => $this->context->language->iso_code, 'id_lang' => $this->context->language->id, 'can_edit' => $this->access('edit'), 'current_id_lang' => $this->context->language->id, 'invoices_collection' => $order->getInvoicesCollection(), 'not_paid_invoices_collection' => $order->getNotPaidInvoicesCollection(), 'payment_methods' => $payment_methods, 'invoice_management_active' => Configuration::get('PS_INVOICE', null, null, $order->id_shop), 'display_warehouse' => (int) Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT'), 'carrier_list' => $this->getCarrierList($order), 'recalculate_shipping_cost' => (int) Configuration::get('PS_ORDER_RECALCULATE_SHIPPING'), 'HOOK_CONTENT_ORDER' => Hook::exec('displayAdminOrderContentOrder', array('order' => $order, 'products' => $products, 'customer' => $customer)), 'HOOK_CONTENT_SHIP' => Hook::exec('displayAdminOrderContentShip', array('order' => $order, 'products' => $products, 'customer' => $customer)), 'HOOK_TAB_ORDER' => Hook::exec('displayAdminOrderTabOrder', array('order' => $order, 'products' => $products, 'customer' => $customer)), 'HOOK_TAB_SHIP' => Hook::exec('displayAdminOrderTabShip', array('order' => $order, 'products' => $products, 'customer' => $customer))); return parent::renderView(); }
/** * Return list of employees * * @return array|false Employees or false */ public static function getEmployeesByShop($id_shop) { $sql = 'SELECT e.*, CONCAT(e.firstName, \' \', e.lastName) as fullName ' . 'FROM `' . _DB_PREFIX_ . 'employee` e ' . ' JOIN `' . _DB_PREFIX_ . 'employee_shop` es ON (es.`id_employee` = e.`id_employee`)' . ' WHERE es.`id_shop`=' . $id_shop . ' AND e.id_profile IN (' . Configuration::get('APH_PROFILE_STORE_OWNER') . ', ' . Configuration::get('APH_PROFILE_STORE_EMPLOYEE') . ')' . ' ORDER BY `lastname` ASC'; $e = Db::getInstance()->executeS($sql); $employees = array(); foreach ($e as &$employee) { $employees[$employee['id_employee']] = $employee; $employees[$employee['id_employee']]['text_color'] = ''; $employees[$employee['id_employee']]['bg_color'] = ''; $employees[$employee['id_employee']]['badge_style'] = ''; if (!empty($employee['bo_color'])) { $employees[$employee['id_employee']]['text_color'] = Tools::getBrightness($employee['bo_color']) < 128 ? 'white' : '#383838'; $employees[$employee['id_employee']]['bg_color'] = $employee['bo_color']; $employees[$employee['id_employee']]['badge_style'] = '.badge.employee_' . $employee['id_employee'] . '.active { background-color: ' . $employees[$employee['id_employee']]['bg_color'] . '; border-color: ' . $employees[$employee['id_employee']]['bg_color'] . '; color: ' . $employees[$employee['id_employee']]['text_color'] . '; } .badge.employee_' . $employee['id_employee'] . '.notactive { background-color: #fff; border-color: ' . $employees[$employee['id_employee']]['bg_color'] . '; color: ' . $employees[$employee['id_employee']]['bg_color'] . '; }'; } } return $employees; }
public function renderView() { $order = new Order(Tools::getValue('id_order')); if (!Validate::isLoadedObject($order)) { $this->errors[] = Tools::displayError('The order cannot be found within your database.'); } $customer = new Customer($order->id_customer); $carrier = new Carrier($order->id_carrier); $products = $this->getProducts($order); $currency = new Currency((int) $order->id_currency); // Carrier module call $carrier_module_call = null; if ($carrier->is_module) { $module = Module::getInstanceByName($carrier->external_module_name); if (method_exists($module, 'displayInfoByCart')) { $carrier_module_call = call_user_func(array($module, 'displayInfoByCart'), $order->id_cart); } } // Retrieve addresses information $addressInvoice = new Address($order->id_address_invoice, $this->context->language->id); if (Validate::isLoadedObject($addressInvoice) && $addressInvoice->id_state) { $invoiceState = new State((int) $addressInvoice->id_state); } if ($order->id_address_invoice == $order->id_address_delivery) { $addressDelivery = $addressInvoice; if (isset($invoiceState)) { $deliveryState = $invoiceState; } } else { $addressDelivery = new Address($order->id_address_delivery, $this->context->language->id); if (Validate::isLoadedObject($addressDelivery) && $addressDelivery->id_state) { $deliveryState = new State((int) $addressDelivery->id_state); } } $this->toolbar_title = sprintf($this->l('Order #%1$d (%2$s) - %3$s %4$s'), $order->id, $order->reference, $customer->firstname, $customer->lastname); if (Shop::isFeatureActive()) { $shop = new Shop((int) $order->id_shop); $this->toolbar_title .= ' - ' . sprintf($this->l('Shop: %s'), $shop->name); } // gets warehouses to ship products, if and only if advanced stock management is activated $warehouse_list = null; $order_details = $order->getOrderDetailList(); foreach ($order_details as $order_detail) { $product = new Product($order_detail['product_id']); if (Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT') && $product->advanced_stock_management) { $warehouses = Warehouse::getWarehousesByProductId($order_detail['product_id'], $order_detail['product_attribute_id']); foreach ($warehouses as $warehouse) { if (!isset($warehouse_list[$warehouse['id_warehouse']])) { $warehouse_list[$warehouse['id_warehouse']] = $warehouse; } } } } $payment_methods = array(); foreach (PaymentModule::getInstalledPaymentModules() as $payment) { $module = Module::getInstanceByName($payment['name']); if (Validate::isLoadedObject($module) && $module->active) { $payment_methods[] = $module->displayName; } } // display warning if there are products out of stock $display_out_of_stock_warning = false; $current_order_state = $order->getCurrentOrderState(); if (Configuration::get('PS_STOCK_MANAGEMENT') && (!Validate::isLoadedObject($current_order_state) || $current_order_state->delivery != 1 && $current_order_state->shipped != 1)) { $display_out_of_stock_warning = true; } // products current stock (from stock_available) foreach ($products as &$product) { $product['current_stock'] = StockAvailable::getQuantityAvailableByProduct($product['product_id'], $product['product_attribute_id'], $product['id_shop']); $resume = OrderSlip::getProductSlipResume($product['id_order_detail']); $product['quantity_refundable'] = $product['product_quantity'] - $resume['product_quantity']; $product['amount_refundable'] = $product['total_price_tax_incl'] - $resume['amount_tax_incl']; $product['amount_refund'] = Tools::displayPrice($resume['amount_tax_incl'], $currency); $product['refund_history'] = OrderSlip::getProductSlipDetail($product['id_order_detail']); $product['return_history'] = OrderReturn::getProductReturnDetail($product['id_order_detail']); // if the current stock requires a warning if ($product['current_stock'] == 0 && $display_out_of_stock_warning) { $this->displayWarning($this->l('This product is out of stock: ') . ' ' . $product['product_name']); } if ($product['id_warehouse'] != 0) { $warehouse = new Warehouse((int) $product['id_warehouse']); $product['warehouse_name'] = $warehouse->name; } else { $product['warehouse_name'] = '--'; } } $gender = new Gender((int) $customer->id_gender, $this->context->language->id); $history = $order->getHistory($this->context->language->id); foreach ($history as &$order_state) { $order_state['text-color'] = Tools::getBrightness($order_state['color']) < 128 ? 'white' : 'black'; } // Smarty assign $this->tpl_view_vars = array('order' => $order, 'cart' => new Cart($order->id_cart), 'customer' => $customer, 'gender' => $gender, 'customer_addresses' => $customer->getAddresses($this->context->language->id), 'addresses' => array('delivery' => $addressDelivery, 'deliveryState' => isset($deliveryState) ? $deliveryState : null, 'invoice' => $addressInvoice, 'invoiceState' => isset($invoiceState) ? $invoiceState : null), 'customerStats' => $customer->getStats(), 'products' => $products, 'discounts' => $order->getCartRules(), 'orders_total_paid_tax_incl' => $order->getOrdersTotalPaid(), 'total_paid' => $order->getTotalPaid(), 'returns' => OrderReturn::getOrdersReturn($order->id_customer, $order->id), 'customer_thread_message' => CustomerThread::getCustomerMessages($order->id_customer), 'orderMessages' => OrderMessage::getOrderMessages($order->id_lang), 'messages' => Message::getMessagesByOrderId($order->id, true), 'carrier' => new Carrier($order->id_carrier), 'history' => $history, 'states' => OrderState::getOrderStates($this->context->language->id), 'warehouse_list' => $warehouse_list, 'sources' => ConnectionsSource::getOrderSources($order->id), 'currentState' => $order->getCurrentOrderState(), 'currency' => new Currency($order->id_currency), 'currencies' => Currency::getCurrenciesByIdShop($order->id_shop), 'previousOrder' => $order->getPreviousOrderId(), 'nextOrder' => $order->getNextOrderId(), 'current_index' => self::$currentIndex, 'carrierModuleCall' => $carrier_module_call, 'iso_code_lang' => $this->context->language->iso_code, 'id_lang' => $this->context->language->id, 'can_edit' => $this->tabAccess['edit'] == 1, 'current_id_lang' => $this->context->language->id, 'invoices_collection' => $order->getInvoicesCollection(), 'not_paid_invoices_collection' => $order->getNotPaidInvoicesCollection(), 'payment_methods' => $payment_methods, 'invoice_management_active' => Configuration::get('PS_INVOICE', null, null, $order->id_shop), 'display_warehouse' => (int) Configuration::get('PS_ADVANCED_STOCK_MANAGEMENT')); return parent::renderView(); }
function content_530ff8fdefa9d7_53361021($_smarty_tpl) { if (!is_callable('smarty_modifier_escape')) { include '/Applications/MAMP/htdocs/prestashop/tools/smarty/plugins/modifier.escape.php'; } if (!is_callable('smarty_modifier_regex_replace')) { include '/Applications/MAMP/htdocs/prestashop/tools/smarty/plugins/modifier.regex_replace.php'; } ?> <tbody> <?php if (count($_smarty_tpl->tpl_vars['list']->value)) { $_smarty_tpl->tpl_vars['tr'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['tr']->_loop = false; $_smarty_tpl->tpl_vars['index'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['tr']->iteration = 0; foreach ($_from as $_smarty_tpl->tpl_vars['tr']->key => $_smarty_tpl->tpl_vars['tr']->value) { $_smarty_tpl->tpl_vars['tr']->_loop = true; $_smarty_tpl->tpl_vars['index']->value = $_smarty_tpl->tpl_vars['tr']->key; $_smarty_tpl->tpl_vars['tr']->iteration++; ?> <tr <?php if ($_smarty_tpl->tpl_vars['position_identifier']->value) { ?> id="tr_<?php echo $_smarty_tpl->tpl_vars['position_group_identifier']->value; ?> _<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value]; ?> _<?php if (isset($_smarty_tpl->tpl_vars['tr']->value['position']['position'])) { echo $_smarty_tpl->tpl_vars['tr']->value['position']['position']; } else { ?> 0<?php } ?> "<?php } ?> class="<?php if (isset($_smarty_tpl->tpl_vars['tr']->value['class'])) { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value['class']; } ?> <?php if (1 & $_smarty_tpl->tpl_vars['tr']->iteration / 1) { ?> odd<?php } ?> " <?php if (isset($_smarty_tpl->tpl_vars['tr']->value['color']) && $_smarty_tpl->tpl_vars['color_on_bg']->value) { ?> style="background-color: <?php echo $_smarty_tpl->tpl_vars['tr']->value['color']; ?> "<?php } ?> > <td class="text-center"> <?php if ($_smarty_tpl->tpl_vars['bulk_actions']->value && $_smarty_tpl->tpl_vars['has_bulk_actions']->value) { ?> <?php if (isset($_smarty_tpl->tpl_vars['list_skip_actions']->value['delete'])) { ?> <?php if (!in_array($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value], $_smarty_tpl->tpl_vars['list_skip_actions']->value['delete'])) { ?> <input type="checkbox" name="<?php echo $_smarty_tpl->tpl_vars['table']->value; ?> Box[]" value="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value]; ?> " class="noborder" /> <?php } ?> <?php } else { ?> <input type="checkbox" name="<?php echo $_smarty_tpl->tpl_vars['table']->value; ?> Box[]" value="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value]; ?> " class="noborder" /> <?php } ?> <?php } ?> </td> <?php $_smarty_tpl->tpl_vars['params'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['params']->_loop = false; $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['fields_display']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['params']->key => $_smarty_tpl->tpl_vars['params']->value) { $_smarty_tpl->tpl_vars['params']->_loop = true; $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['params']->key; ?> <td <?php if (isset($_smarty_tpl->tpl_vars['params']->value['position'])) { ?> id="td_<?php if (!empty($_smarty_tpl->tpl_vars['position_group_identifier']->value)) { echo $_smarty_tpl->tpl_vars['position_group_identifier']->value; } else { ?> 0<?php } ?> _<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value]; ?> " <?php } ?> class="<?php if (!$_smarty_tpl->tpl_vars['no_link']->value) { ?> pointer<?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['position']) && $_smarty_tpl->tpl_vars['order_by']->value == 'position' && $_smarty_tpl->tpl_vars['order_way']->value != 'DESC') { ?> dragHandle<?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['class'])) { ?> <?php echo $_smarty_tpl->tpl_vars['params']->value['class']; } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['align'])) { ?> <?php echo $_smarty_tpl->tpl_vars['params']->value['align']; } ?> " <?php if (!isset($_smarty_tpl->tpl_vars['params']->value['position']) && !$_smarty_tpl->tpl_vars['no_link']->value && !isset($_smarty_tpl->tpl_vars['params']->value['remove_onclick'])) { ?> onclick="document.location = '<?php echo $_smarty_tpl->tpl_vars['current_index']->value; ?> &<?php echo $_smarty_tpl->tpl_vars['identifier']->value; ?> =<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value]; if ($_smarty_tpl->tpl_vars['view']->value) { ?> &view<?php } else { ?> &update<?php } echo $_smarty_tpl->tpl_vars['table']->value; ?> &token=<?php echo $_smarty_tpl->tpl_vars['token']->value; ?> '"> <?php } else { ?> > <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['prefix'])) { echo $_smarty_tpl->tpl_vars['params']->value['prefix']; } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['color']) && isset($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['params']->value['color']])) { ?> <span class="label color_field" style="background-color:<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['params']->value['color']]; ?> ;color:<?php if (Tools::getBrightness($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['params']->value['color']]) < 128) { ?> white<?php } else { ?> #383838<?php } ?> "> <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value])) { ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['active'])) { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['activeVisu'])) { ?> <?php if ($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]) { ?> <i class="icon-check-ok"></i> <?php echo smartyTranslate(array('s' => 'Enabled'), $_smarty_tpl); ?> <?php } else { ?> <i class="icon-remove"></i> <?php echo smartyTranslate(array('s' => 'Disabled'), $_smarty_tpl); ?> <?php } ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['position'])) { ?> <?php if ($_smarty_tpl->tpl_vars['order_by']->value == 'position' && $_smarty_tpl->tpl_vars['order_way']->value != 'DESC') { ?> <a href="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['position_url_down']; ?> " <?php if (!($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['position'] != $_smarty_tpl->tpl_vars['positions']->value[count($_smarty_tpl->tpl_vars['positions']->value) - 1])) { ?> style="display: none;"<?php } ?> > <img src="../img/admin/<?php if ($_smarty_tpl->tpl_vars['order_way']->value == 'ASC') { ?> down<?php } else { ?> up<?php } ?> .gif" alt="<?php echo smartyTranslate(array('s' => 'Down'), $_smarty_tpl); ?> " title="<?php echo smartyTranslate(array('s' => 'Down'), $_smarty_tpl); ?> " /> </a> <a href="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['position_url_up']; ?> " <?php if (!($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['position'] != $_smarty_tpl->tpl_vars['positions']->value[0])) { ?> style="display: none;"<?php } ?> > <img src="../img/admin/<?php if ($_smarty_tpl->tpl_vars['order_way']->value == 'ASC') { ?> up<?php } else { ?> down<?php } ?> .gif" alt="<?php echo smartyTranslate(array('s' => 'Up'), $_smarty_tpl); ?> " title="<?php echo smartyTranslate(array('s' => 'Up'), $_smarty_tpl); ?> " /> </a> <?php } else { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['position'] + 1; ?> <?php } ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['image'])) { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['icon'])) { ?> <?php if (is_array($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value])) { ?> <?php if (isset($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['class'])) { ?> <i class="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['class']; ?> "></i> <?php } else { ?> <img src="../img/admin/<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['src']; ?> " alt="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['alt']; ?> " title="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['alt']; ?> " /> <?php } ?> <?php } else { ?> <i class="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> "></i> <?php } ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['type']) && $_smarty_tpl->tpl_vars['params']->value['type'] == 'price') { ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['displayPrice'][0][0]->displayPriceSmarty(array('price' => $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]), $_smarty_tpl); ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['float'])) { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['type']) && $_smarty_tpl->tpl_vars['params']->value['type'] == 'date') { ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['dateFormat'][0][0]->dateFormat(array('date' => $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value], 'full' => 0), $_smarty_tpl); ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['type']) && $_smarty_tpl->tpl_vars['params']->value['type'] == 'datetime') { ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['dateFormat'][0][0]->dateFormat(array('date' => $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value], 'full' => 1), $_smarty_tpl); ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['type']) && $_smarty_tpl->tpl_vars['params']->value['type'] == 'decimal') { ?> <?php echo sprintf("%.2f", $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]); ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['type']) && $_smarty_tpl->tpl_vars['params']->value['type'] == 'percent') { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> <?php echo smartyTranslate(array('s' => '%'), $_smarty_tpl); ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['type']) && $_smarty_tpl->tpl_vars['params']->value['type'] == 'editable' && isset($_smarty_tpl->tpl_vars['tr']->value['id'])) { ?> <input type="text" name="<?php echo $_smarty_tpl->tpl_vars['key']->value; ?> _<?php echo $_smarty_tpl->tpl_vars['tr']->value['id']; ?> " value="<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value], 'html', 'UTF-8'); ?> " class="<?php echo $_smarty_tpl->tpl_vars['key']->value; ?> " /> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['callback'])) { ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['maxlength']) && Tools::strlen($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]) > $_smarty_tpl->tpl_vars['params']->value['maxlength']) { ?> <span title="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> "><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['truncate'][0][0]->smarty_modifier_truncate($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value], $_smarty_tpl->tpl_vars['params']->value['maxlength'], '...'); ?> </span> <?php } else { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> <?php } ?> <?php } elseif ($_smarty_tpl->tpl_vars['key']->value == 'color') { ?> <?php if (!is_array($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value])) { ?> <div style="background-color: <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> ;" class="attributes-color-container"></div> <?php } else { ?> <img src="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['texture']; ?> " alt="<?php echo $_smarty_tpl->tpl_vars['tr']->value['name']; ?> " class="attributes-color-container" /> <?php } ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['maxlength']) && Tools::strlen($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]) > $_smarty_tpl->tpl_vars['params']->value['maxlength']) { ?> <span title="<?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value], 'html', 'UTF-8'); ?> "><?php echo smarty_modifier_escape($_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['truncate'][0][0]->smarty_modifier_truncate($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value], $_smarty_tpl->tpl_vars['params']->value['maxlength'], '...'), 'html', 'UTF-8'); ?> </span> <?php } else { ?> <?php echo smarty_modifier_escape($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value], 'html', 'UTF-8'); ?> <?php } ?> <?php } else { ?> -- <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['suffix'])) { echo $_smarty_tpl->tpl_vars['params']->value['suffix']; } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['color']) && isset($_smarty_tpl->tpl_vars['tr']->value['color'])) { ?> </span> <?php } ?> </td> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['shop_link_type']->value) { ?> <td title="<?php echo $_smarty_tpl->tpl_vars['tr']->value['shop_name']; ?> "> <?php if (isset($_smarty_tpl->tpl_vars['tr']->value['shop_short_name'])) { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value['shop_short_name']; ?> <?php } else { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value['shop_name']; ?> <?php } ?> </td> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['has_actions']->value) { ?> <td class="text-right"> <?php $_smarty_tpl->tpl_vars['compiled_actions'] = new Smarty_variable(array(), null, 0); ?> <?php $_smarty_tpl->tpl_vars['action'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['action']->_loop = false; $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['actions']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['action']->key => $_smarty_tpl->tpl_vars['action']->value) { $_smarty_tpl->tpl_vars['action']->_loop = true; $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['action']->key; ?> <?php if (isset($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['action']->value])) { ?> <?php if ($_smarty_tpl->tpl_vars['key']->value == 0) { ?> <?php $_smarty_tpl->tpl_vars['action'] = new Smarty_variable($_smarty_tpl->tpl_vars['action']->value, null, 0); ?> <?php } ?> <?php $_smarty_tpl->createLocalArrayVariable('compiled_actions', null, 0); $_smarty_tpl->tpl_vars['compiled_actions']->value[] = $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['action']->value]; ?> <?php } ?> <?php } ?> <?php if (count($_smarty_tpl->tpl_vars['compiled_actions']->value) > 0) { ?> <?php if (count($_smarty_tpl->tpl_vars['compiled_actions']->value) > 1) { ?> <div class="btn-group-action"><?php } ?> <div class="btn-group pull-right"> <?php echo smarty_modifier_regex_replace($_smarty_tpl->tpl_vars['compiled_actions']->value[0], '/class\\s*=\\s*"(\\w*)"/', 'class="$1 btn btn-default"'); ?> <?php if (count($_smarty_tpl->tpl_vars['compiled_actions']->value) > 1) { ?> <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <span class="caret"></span> </button> <ul class="dropdown-menu"> <?php $_smarty_tpl->tpl_vars['action'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['action']->_loop = false; $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['compiled_actions']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['action']->key => $_smarty_tpl->tpl_vars['action']->value) { $_smarty_tpl->tpl_vars['action']->_loop = true; $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['action']->key; ?> <?php if ($_smarty_tpl->tpl_vars['key']->value != 0) { ?> <li> <?php echo $_smarty_tpl->tpl_vars['action']->value; ?> </li> <?php } ?> <?php } ?> </ul> <?php } ?> </div> <?php if (count($_smarty_tpl->tpl_vars['compiled_actions']->value) > 1) { ?> </div><?php } ?> <?php } ?> </td> <?php } ?> </tr> <?php } } else { ?> <tr><td class="text-center text-muted" colspan="<?php echo count($_smarty_tpl->tpl_vars['fields_display']->value) + 2; ?> "><i class="icon-warning-sign"></i> <?php echo smartyTranslate(array('s' => 'No records found'), $_smarty_tpl); ?> </td></tr> <?php } ?> </tbody> <?php }
function content_561d15eaa35b10_16334302($_smarty_tpl) { if (!is_callable('smarty_function_counter')) { include 'E:\\wwwroot\\projects\\web\\Arnaud_Lachaume\\Prestashop\\Source\\prestashop\\tools\\smarty\\plugins\\function.counter.php'; } $_smarty_tpl->_capture_stack[0][] = array('tr_count', null, null); ob_start(); echo smarty_function_counter(array('name' => 'tr_count'), $_smarty_tpl); list($_capture_buffer, $_capture_assign, $_capture_append) = array_pop($_smarty_tpl->_capture_stack[0]); if (!empty($_capture_buffer)) { if (isset($_capture_assign)) { $_smarty_tpl->assign($_capture_assign, ob_get_contents()); } if (isset($_capture_append)) { $_smarty_tpl->append($_capture_append, ob_get_contents()); } Smarty::$_smarty_vars['capture'][$_capture_buffer] = ob_get_clean(); } else { $_smarty_tpl->capture_error(); } ?> <tbody> <?php if (count($_smarty_tpl->tpl_vars['list']->value)) { $_smarty_tpl->tpl_vars['tr'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['tr']->_loop = false; $_smarty_tpl->tpl_vars['index'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } $_smarty_tpl->tpl_vars['tr']->iteration = 0; foreach ($_from as $_smarty_tpl->tpl_vars['tr']->key => $_smarty_tpl->tpl_vars['tr']->value) { $_smarty_tpl->tpl_vars['tr']->_loop = true; $_smarty_tpl->tpl_vars['index']->value = $_smarty_tpl->tpl_vars['tr']->key; $_smarty_tpl->tpl_vars['tr']->iteration++; ?> <tr<?php if ($_smarty_tpl->tpl_vars['position_identifier']->value) { ?> id="tr_<?php echo $_smarty_tpl->tpl_vars['position_group_identifier']->value; ?> _<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value]; ?> _<?php if (isset($_smarty_tpl->tpl_vars['tr']->value['position']['position'])) { echo $_smarty_tpl->tpl_vars['tr']->value['position']['position']; } else { ?> 0<?php } ?> "<?php } ?> class="<?php if (isset($_smarty_tpl->tpl_vars['tr']->value['class'])) { echo $_smarty_tpl->tpl_vars['tr']->value['class']; } ?> <?php if (1 & $_smarty_tpl->tpl_vars['tr']->iteration / 1) { ?> odd<?php } ?> "<?php if (isset($_smarty_tpl->tpl_vars['tr']->value['color']) && $_smarty_tpl->tpl_vars['color_on_bg']->value) { ?> style="background-color: <?php echo $_smarty_tpl->tpl_vars['tr']->value['color']; ?> "<?php } ?> > <?php if ($_smarty_tpl->tpl_vars['bulk_actions']->value && $_smarty_tpl->tpl_vars['has_bulk_actions']->value) { ?> <td class="row-selector text-center"> <?php if (isset($_smarty_tpl->tpl_vars['list_skip_actions']->value['delete'])) { ?> <?php if (!in_array($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value], $_smarty_tpl->tpl_vars['list_skip_actions']->value['delete'])) { ?> <input type="checkbox" name="<?php echo $_smarty_tpl->tpl_vars['list_id']->value; ?> Box[]" value="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value]; ?> "<?php ob_start(); echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value]; $_tmp1 = ob_get_clean(); if (isset($_smarty_tpl->tpl_vars['checked_boxes']->value) && is_array($_smarty_tpl->tpl_vars['checked_boxes']->value) && in_array($_tmp1, $_smarty_tpl->tpl_vars['checked_boxes']->value)) { ?> checked="checked"<?php } ?> class="noborder" /> <?php } ?> <?php } else { ?> <input type="checkbox" name="<?php echo $_smarty_tpl->tpl_vars['list_id']->value; ?> Box[]" value="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value]; ?> "<?php ob_start(); echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value]; $_tmp2 = ob_get_clean(); if (isset($_smarty_tpl->tpl_vars['checked_boxes']->value) && is_array($_smarty_tpl->tpl_vars['checked_boxes']->value) && in_array($_tmp2, $_smarty_tpl->tpl_vars['checked_boxes']->value)) { ?> checked="checked"<?php } ?> class="noborder" /> <?php } ?> </td> <?php } ?> <?php $_smarty_tpl->tpl_vars['params'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['params']->_loop = false; $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['fields_display']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['params']->key => $_smarty_tpl->tpl_vars['params']->value) { $_smarty_tpl->tpl_vars['params']->_loop = true; $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['params']->key; ?> <td <?php if (isset($_smarty_tpl->tpl_vars['params']->value['position'])) { ?> id="td_<?php if (!empty($_smarty_tpl->tpl_vars['position_group_identifier']->value)) { echo $_smarty_tpl->tpl_vars['position_group_identifier']->value; } else { ?> 0<?php } ?> _<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value]; if (Smarty::$_smarty_vars['capture']['tr_count'] > 1) { ?> _<?php echo intval(Smarty::$_smarty_vars['capture']['tr_count'] - 1); } ?> " <?php } ?> class="<?php if (!$_smarty_tpl->tpl_vars['no_link']->value) { ?> pointer<?php } if (isset($_smarty_tpl->tpl_vars['params']->value['position']) && $_smarty_tpl->tpl_vars['order_by']->value == 'position' && $_smarty_tpl->tpl_vars['order_way']->value != 'DESC') { ?> dragHandle<?php } if (isset($_smarty_tpl->tpl_vars['params']->value['class'])) { ?> <?php echo $_smarty_tpl->tpl_vars['params']->value['class']; } if (isset($_smarty_tpl->tpl_vars['params']->value['align'])) { ?> <?php echo $_smarty_tpl->tpl_vars['params']->value['align']; } ?> " <?php if (!isset($_smarty_tpl->tpl_vars['params']->value['position']) && !$_smarty_tpl->tpl_vars['no_link']->value && !isset($_smarty_tpl->tpl_vars['params']->value['remove_onclick'])) { ?> onclick="document.location = '<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['current_index']->value, ENT_QUOTES, 'UTF-8', true); ?> &<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['identifier']->value, ENT_QUOTES, 'UTF-8', true); ?> =<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['identifier']->value], ENT_QUOTES, 'UTF-8', true); if ($_smarty_tpl->tpl_vars['view']->value) { ?> &view<?php } else { ?> &update<?php } echo htmlspecialchars($_smarty_tpl->tpl_vars['table']->value, ENT_QUOTES, 'UTF-8', true); if ($_smarty_tpl->tpl_vars['page']->value > 1) { ?> &page=<?php echo intval($_smarty_tpl->tpl_vars['page']->value); } ?> &token=<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['token']->value, ENT_QUOTES, 'UTF-8', true); ?> '"> <?php } else { ?> > <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['prefix'])) { echo $_smarty_tpl->tpl_vars['params']->value['prefix']; } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['badge_success']) && $_smarty_tpl->tpl_vars['params']->value['badge_success'] && isset($_smarty_tpl->tpl_vars['tr']->value['badge_success']) && $_smarty_tpl->tpl_vars['tr']->value['badge_success'] == $_smarty_tpl->tpl_vars['params']->value['badge_success']) { ?> <span class="badge badge-success"><?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['badge_warning']) && $_smarty_tpl->tpl_vars['params']->value['badge_warning'] && isset($_smarty_tpl->tpl_vars['tr']->value['badge_warning']) && $_smarty_tpl->tpl_vars['tr']->value['badge_warning'] == $_smarty_tpl->tpl_vars['params']->value['badge_warning']) { ?> <span class="badge badge-warning"><?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['badge_danger']) && $_smarty_tpl->tpl_vars['params']->value['badge_danger'] && isset($_smarty_tpl->tpl_vars['tr']->value['badge_danger']) && $_smarty_tpl->tpl_vars['tr']->value['badge_danger'] == $_smarty_tpl->tpl_vars['params']->value['badge_danger']) { ?> <span class="badge badge-danger"><?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['color']) && isset($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['params']->value['color']])) { ?> <span class="label color_field" style="background-color:<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['params']->value['color']]; ?> ;color:<?php if (Tools::getBrightness($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['params']->value['color']]) < 128) { ?> white<?php } else { ?> #383838<?php } ?> "> <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value])) { ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['active'])) { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['activeVisu'])) { ?> <?php if ($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]) { ?> <i class="icon-check-ok"></i> <?php echo smartyTranslate(array('s' => 'Enabled'), $_smarty_tpl); ?> <?php } else { ?> <i class="icon-remove"></i> <?php echo smartyTranslate(array('s' => 'Disabled'), $_smarty_tpl); ?> <?php } ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['position'])) { ?> <?php if (!$_smarty_tpl->tpl_vars['filters_has_value']->value && $_smarty_tpl->tpl_vars['order_by']->value == 'position' && $_smarty_tpl->tpl_vars['order_way']->value != 'DESC') { ?> <div class="dragGroup"> <div class="positions"> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['position'] + 1; ?> </div> </div> <?php } else { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['position'] + 1; ?> <?php } ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['image'])) { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['icon'])) { ?> <?php if (is_array($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value])) { ?> <?php if (isset($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['class'])) { ?> <i class="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['class']; ?> "></i> <?php } else { ?> <img src="../img/admin/<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['src']; ?> " alt="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['alt']; ?> " title="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['alt']; ?> " /> <?php } ?> <?php } ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['type']) && $_smarty_tpl->tpl_vars['params']->value['type'] == 'price') { ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['displayPrice'][0][0]->displayPriceSmarty(array('price' => $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]), $_smarty_tpl); ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['float'])) { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['type']) && $_smarty_tpl->tpl_vars['params']->value['type'] == 'date') { ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['dateFormat'][0][0]->dateFormat(array('date' => $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value], 'full' => 0), $_smarty_tpl); ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['type']) && $_smarty_tpl->tpl_vars['params']->value['type'] == 'datetime') { ?> <?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['dateFormat'][0][0]->dateFormat(array('date' => $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value], 'full' => 1), $_smarty_tpl); ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['type']) && $_smarty_tpl->tpl_vars['params']->value['type'] == 'decimal') { ?> <?php echo sprintf("%.2f", $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]); ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['type']) && $_smarty_tpl->tpl_vars['params']->value['type'] == 'percent') { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> <?php echo smartyTranslate(array('s' => '%'), $_smarty_tpl); ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['type']) && $_smarty_tpl->tpl_vars['params']->value['type'] == 'editable' && isset($_smarty_tpl->tpl_vars['tr']->value['id'])) { ?> <input type="text" name="<?php echo $_smarty_tpl->tpl_vars['key']->value; ?> _<?php echo $_smarty_tpl->tpl_vars['tr']->value['id']; ?> " value="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value], ENT_QUOTES, 'UTF-8', true); ?> " class="<?php echo $_smarty_tpl->tpl_vars['key']->value; ?> " /> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['callback'])) { ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['maxlength']) && Tools::strlen($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]) > $_smarty_tpl->tpl_vars['params']->value['maxlength']) { ?> <span title="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> "><?php echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['truncate'][0][0]->smarty_modifier_truncate($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value], $_smarty_tpl->tpl_vars['params']->value['maxlength'], '...'); ?> </span> <?php } else { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> <?php } ?> <?php } elseif ($_smarty_tpl->tpl_vars['key']->value == 'color') { ?> <?php if (!is_array($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value])) { ?> <div style="background-color: <?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]; ?> ;" class="attributes-color-container"></div> <?php } else { ?> <img src="<?php echo $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]['texture']; ?> " alt="<?php echo $_smarty_tpl->tpl_vars['tr']->value['name']; ?> " class="attributes-color-container" /> <?php } ?> <?php } elseif (isset($_smarty_tpl->tpl_vars['params']->value['maxlength']) && Tools::strlen($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value]) > $_smarty_tpl->tpl_vars['params']->value['maxlength']) { ?> <span title="<?php echo htmlspecialchars($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value], ENT_QUOTES, 'UTF-8', true); ?> "><?php echo htmlspecialchars($_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_MODIFIER]['truncate'][0][0]->smarty_modifier_truncate($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value], $_smarty_tpl->tpl_vars['params']->value['maxlength'], '...'), ENT_QUOTES, 'UTF-8', true); ?> </span> <?php } else { ?> <?php echo htmlspecialchars($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['key']->value], ENT_QUOTES, 'UTF-8', true); ?> <?php } ?> <?php } else { ?> -- <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['suffix'])) { echo $_smarty_tpl->tpl_vars['params']->value['suffix']; } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['color']) && isset($_smarty_tpl->tpl_vars['tr']->value['color'])) { ?> </span> <?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['badge_danger']) && $_smarty_tpl->tpl_vars['params']->value['badge_danger'] && isset($_smarty_tpl->tpl_vars['tr']->value['badge_danger']) && $_smarty_tpl->tpl_vars['tr']->value['badge_danger'] == $_smarty_tpl->tpl_vars['params']->value['badge_danger']) { ?> </span><?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['badge_warning']) && $_smarty_tpl->tpl_vars['params']->value['badge_warning'] && isset($_smarty_tpl->tpl_vars['tr']->value['badge_warning']) && $_smarty_tpl->tpl_vars['tr']->value['badge_warning'] == $_smarty_tpl->tpl_vars['params']->value['badge_warning']) { ?> </span><?php } ?> <?php if (isset($_smarty_tpl->tpl_vars['params']->value['badge_success']) && $_smarty_tpl->tpl_vars['params']->value['badge_success'] && isset($_smarty_tpl->tpl_vars['tr']->value['badge_success']) && $_smarty_tpl->tpl_vars['tr']->value['badge_success'] == $_smarty_tpl->tpl_vars['params']->value['badge_success']) { ?> </span><?php } ?> </td> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['shop_link_type']->value) { ?> <td title="<?php echo $_smarty_tpl->tpl_vars['tr']->value['shop_name']; ?> "> <?php if (isset($_smarty_tpl->tpl_vars['tr']->value['shop_short_name'])) { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value['shop_short_name']; ?> <?php } else { ?> <?php echo $_smarty_tpl->tpl_vars['tr']->value['shop_name']; ?> <?php } ?> </td> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['has_actions']->value) { ?> <td class="text-right"> <?php $_smarty_tpl->tpl_vars['compiled_actions'] = new Smarty_variable(array(), null, 0); ?> <?php $_smarty_tpl->tpl_vars['action'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['action']->_loop = false; $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['actions']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['action']->key => $_smarty_tpl->tpl_vars['action']->value) { $_smarty_tpl->tpl_vars['action']->_loop = true; $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['action']->key; ?> <?php if (isset($_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['action']->value])) { ?> <?php if ($_smarty_tpl->tpl_vars['key']->value == 0) { ?> <?php $_smarty_tpl->tpl_vars['action'] = new Smarty_variable($_smarty_tpl->tpl_vars['action']->value, null, 0); ?> <?php } ?> <?php if ($_smarty_tpl->tpl_vars['action']->value == 'delete' && count($_smarty_tpl->tpl_vars['actions']->value) > 2) { ?> <?php $_smarty_tpl->createLocalArrayVariable('compiled_actions', null, 0); $_smarty_tpl->tpl_vars['compiled_actions']->value[] = 'divider'; ?> <?php } ?> <?php $_smarty_tpl->createLocalArrayVariable('compiled_actions', null, 0); $_smarty_tpl->tpl_vars['compiled_actions']->value[] = $_smarty_tpl->tpl_vars['tr']->value[$_smarty_tpl->tpl_vars['action']->value]; ?> <?php } ?> <?php } ?> <?php if (count($_smarty_tpl->tpl_vars['compiled_actions']->value) > 0) { ?> <?php if (count($_smarty_tpl->tpl_vars['compiled_actions']->value) > 1) { ?> <div class="btn-group-action"><?php } ?> <div class="btn-group pull-right"> <?php echo $_smarty_tpl->tpl_vars['compiled_actions']->value[0]; ?> <?php if (count($_smarty_tpl->tpl_vars['compiled_actions']->value) > 1) { ?> <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"> <i class="icon-caret-down"></i> </button> <ul class="dropdown-menu"> <?php $_smarty_tpl->tpl_vars['action'] = new Smarty_Variable(); $_smarty_tpl->tpl_vars['action']->_loop = false; $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable(); $_from = $_smarty_tpl->tpl_vars['compiled_actions']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); } foreach ($_from as $_smarty_tpl->tpl_vars['action']->key => $_smarty_tpl->tpl_vars['action']->value) { $_smarty_tpl->tpl_vars['action']->_loop = true; $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['action']->key; ?> <?php if ($_smarty_tpl->tpl_vars['key']->value != 0) { ?> <li <?php if ($_smarty_tpl->tpl_vars['action']->value == 'divider') { ?> class="divider"<?php } ?> > <?php if ($_smarty_tpl->tpl_vars['action']->value != 'divider') { echo $_smarty_tpl->tpl_vars['action']->value; } ?> </li> <?php } ?> <?php } ?> </ul> <?php } ?> </div> <?php if (count($_smarty_tpl->tpl_vars['compiled_actions']->value) > 1) { ?> </div><?php } ?> <?php } ?> </td> <?php } ?> </tr> <?php } } else { ?> <tr> <td class="list-empty" colspan="<?php echo count($_smarty_tpl->tpl_vars['fields_display']->value) + 1; ?> "> <div class="list-empty-msg"> <i class="icon-warning-sign list-empty-icon"></i> <?php echo smartyTranslate(array('s' => 'No records found'), $_smarty_tpl); ?> </div> </td> </tr> <?php } ?> </tbody> <?php }
/** * Assign smarty variables for the header */ public function initHeader() { header('Cache-Control: no-store, no-cache'); // Multishop $is_multishop = Shop::isFeatureActive(); // Quick access if ((int) $this->context->employee->id) { $quick_access = QuickAccess::getQuickAccesses($this->context->language->id); foreach ($quick_access as $index => $quick) { if ($quick['link'] == '../' && Shop::getContext() == Shop::CONTEXT_SHOP) { $url = $this->context->shop->getBaseURL(); if (!$url) { unset($quick_access[$index]); continue; } $quick_access[$index]['link'] = $url; } else { preg_match('/controller=(.+)(&.+)?$/', $quick['link'], $admin_tab); if (isset($admin_tab[1])) { if (strpos($admin_tab[1], '&')) { $admin_tab[1] = substr($admin_tab[1], 0, strpos($admin_tab[1], '&')); } $token = Tools::getAdminToken($admin_tab[1] . (int) Tab::getIdFromClassName($admin_tab[1]) . (int) $this->context->employee->id); $quick_access[$index]['target'] = $admin_tab[1]; $quick_access[$index]['link'] .= '&token=' . $token; } } } } $tabs = $this->getTabs(); $currentTabLevel = 0; foreach ($tabs as &$tab) { $currentTabLevel = isset($tab['current_level']) ? $tab['current_level'] : $currentTabLevel; } if (Validate::isLoadedObject($this->context->employee)) { $accesses = Profile::getProfileAccesses($this->context->employee->id_profile, 'class_name'); $helperShop = new HelperShop(); /* Hooks are voluntary out the initialize array (need those variables already assigned) */ $bo_color = empty($this->context->employee->bo_color) ? '#FFFFFF' : $this->context->employee->bo_color; $this->context->smarty->assign(array('help_box' => Configuration::get('PS_HELPBOX'), 'round_mode' => Configuration::get('PS_PRICE_ROUND_MODE'), 'brightness' => Tools::getBrightness($bo_color) < 128 ? 'white' : '#383838', 'bo_width' => (int) $this->context->employee->bo_width, 'bo_color' => isset($this->context->employee->bo_color) ? Tools::htmlentitiesUTF8($this->context->employee->bo_color) : null, 'show_new_orders' => Configuration::get('PS_SHOW_NEW_ORDERS') && isset($accesses['AdminOrders']) && $accesses['AdminOrders']['view'], 'show_new_customers' => Configuration::get('PS_SHOW_NEW_CUSTOMERS') && isset($accesses['AdminCustomers']) && $accesses['AdminCustomers']['view'], 'show_new_messages' => Configuration::get('PS_SHOW_NEW_MESSAGES') && isset($accesses['AdminCustomerThreads']) && $accesses['AdminCustomerThreads']['view'], 'employee' => $this->context->employee, 'search_type' => Tools::getValue('bo_search_type'), 'bo_query' => Tools::safeOutput(Tools::stripslashes(Tools::getValue('bo_query'))), 'quick_access' => $quick_access, 'multi_shop' => Shop::isFeatureActive(), 'shop_list' => $helperShop->getRenderedShopList(), 'current_shop_name' => $helperShop->getCurrentShopName(), 'shop' => $this->context->shop, 'shop_group' => new ShopGroup((int) Shop::getContextShopGroupID()), 'is_multishop' => $is_multishop, 'multishop_context' => $this->multishop_context, 'default_tab_link' => $this->context->link->getAdminLink(Tab::getClassNameById((int) Context::getContext()->employee->default_tab)), 'login_link' => $this->context->link->getAdminLink('AdminLogin'), 'collapse_menu' => isset($this->context->cookie->collapse_menu) ? (int) $this->context->cookie->collapse_menu : 0)); } else { $this->context->smarty->assign('default_tab_link', $this->context->link->getAdminLink('AdminDashboard')); } // Shop::initialize() in config.php may empty $this->context->shop->virtual_uri so using a new shop instance for getBaseUrl() $this->context->shop = new Shop((int) $this->context->shop->id); $cldrRepository = new Cldr\Repository($this->context->language->language_code); $this->context->smarty->assign(array('img_dir' => _PS_IMG_, 'iso' => $this->context->language->iso_code, 'class_name' => $this->className, 'iso_user' => $this->context->language->iso_code, 'country_iso_code' => $this->context->country->iso_code, 'version' => _PS_VERSION_, 'lang_iso' => $this->context->language->iso_code, 'full_language_code' => $this->context->language->language_code, 'full_cldr_language_code' => $cldrRepository->getCulture(), 'link' => $this->context->link, 'shop_name' => Configuration::get('PS_SHOP_NAME'), 'base_url' => $this->context->shop->getBaseURL(), 'current_parent_id' => (int) Tab::getCurrentParentId(), 'tabs' => $tabs, 'current_tab_level' => $currentTabLevel, 'install_dir_exists' => file_exists(_PS_ADMIN_DIR_ . '/../install'), 'pic_dir' => _THEME_PROD_PIC_DIR_, 'controller_name' => htmlentities(Tools::getValue('controller')), 'currentIndex' => self::$currentIndex, 'bootstrap' => $this->bootstrap, 'default_language' => (int) Configuration::get('PS_LANG_DEFAULT'), 'display_addons_connection' => Tab::checkTabRights(Tab::getIdFromClassName('AdminModulesController')))); }