public function displayContent()
 {
     $id_order = (int) Tools::getValue('id_order');
     $order = new Order($id_order);
     $paypal_order = PayPalOrder::getOrderById($id_order);
     if (defined("PAYPAL_FORCE_CURRENCY")) {
         $currency = new Currency((int) $this->context->currency->id);
         $paycurrency = new Currency(PAYPAL_FORCE_CURRENCY);
         $currency_decimals = $paycurrency->decimals;
         $paypal_order['total_paid'] = $paypal_order['total_paid'] / $currency->conversion_rate * $paycurrency->conversion_rate;
     }
     $price = Tools::displayPrice($paypal_order['total_paid'], $this->context->currency);
     $order_state = new OrderState($id_order);
     if ($order_state) {
         $order_state_message = $order_state->template[$this->context->language->id];
     }
     if (!$order || !$order_state || isset($order_state_message) && $order_state_message == 'payment_error') {
         $this->context->smarty->assign(array('logs' => array($this->paypal->l('An error occurred while processing payment.')), 'order' => $paypal_order, 'price' => $price));
         if (isset($order_state_message) && $order_state_message) {
             $this->context->smarty->assign('message', $order_state_message);
         }
         $template = 'error.tpl';
     } else {
         $this->context->smarty->assign(array('order' => $paypal_order, 'price' => $price));
         if (version_compare(_PS_VERSION_, '1.5', '>')) {
             $this->context->smarty->assign(array('reference_order' => Order::getUniqReferenceOf($paypal_order['id_order'])));
         }
         $template = 'order-confirmation.tpl';
     }
     $this->context->smarty->assign('use_mobile', (bool) $this->paypal->useMobile());
     echo $this->paypal->fetchTemplate($template);
 }
Example #2
0
 public function initContent()
 {
     parent::initContent();
     $this->paypal = new PayPal();
     $this->context = Context::getContext();
     $this->id_module = (int) Tools::getValue('id_module');
     $this->id_order = (int) Tools::getValue('id_order');
     $order = new Order($this->id_order);
     $order_state = new OrderState($order->current_state);
     $paypal_order = PayPalOrder::getOrderById($this->id_order);
     if ($order_state->template[$this->context->language->id] == 'payment_error') {
         $this->context->smarty->assign(array('message' => $order_state->name[$this->context->language->id], 'logs' => array($this->paypal->l('An error occurred while processing payment.')), 'order' => $paypal_order, 'price' => Tools::displayPrice($paypal_order['total_paid'], $this->context->currency)));
         return $this->setTemplate('error.tpl');
     }
     $order_currency = new Currency((int) $order->id_currency);
     $display_currency = new Currency((int) $this->context->currency->id);
     $price = Tools::convertPriceFull($paypal_order['total_paid'], $order_currency, $display_currency);
     $this->context->smarty->assign(array('is_guest' => $this->context->customer->is_guest || $this->context->customer->id == false, 'order' => $paypal_order, 'price' => Tools::displayPrice($price, $this->context->currency->id), 'HOOK_ORDER_CONFIRMATION' => $this->displayOrderConfirmation(), 'HOOK_PAYMENT_RETURN' => $this->displayPaymentReturn()));
     if (version_compare(_PS_VERSION_, '1.5', '>')) {
         $this->context->smarty->assign(array('reference_order' => Order::getUniqReferenceOf($paypal_order['id_order'])));
     }
     if ($this->context->customer->is_guest || $this->context->customer->id == false) {
         $this->context->smarty->assign(array('id_order' => (int) $this->id_order, 'id_order_formatted' => sprintf('#%06d', (int) $this->id_order), 'order_reference' => $order->reference));
         /* If guest we clear the cookie for security reason */
         $this->context->customer->mylogout();
     }
     if ($this->context->getMobileDevice() == true) {
         $this->setTemplate('order-confirmation-mobile.tpl');
     } else {
         $this->setTemplate('order-confirmation.tpl');
     }
 }
Example #3
0
 public function displayContent()
 {
     $id_order = (int) Tools::getValue('id_order');
     $order = PayPalOrder::getOrderById($id_order);
     $price = Tools::displayPrice($order['total_paid'], $this->context->currency);
     $this->context->smarty->assign(array('order' => $order, 'price' => $price));
     if (version_compare(_PS_VERSION_, '1.5', '>')) {
         $this->context->smarty->assign(array('reference_order' => Order::getUniqReferenceOf($id_order)));
     }
     echo $this->context->smarty->fetch(_PS_MODULE_DIR_ . '/paypal/views/templates/front/order-confirmation.tpl');
 }
 public function displayContent()
 {
     $id_order = (int) Tools::getValue('id_order');
     $order = PayPalOrder::getOrderById($id_order);
     if (defined("PAYPAL_FORCE_CURRENCY")) {
         $currency = new Currency((int) $this->context->currency->id);
         $paycurrency = new Currency(PAYPAL_FORCE_CURRENCY);
         $currency_decimals = $paycurrency->decimals;
         $order['total_paid'] = $order['total_paid'] / $currency->conversion_rate * $paycurrency->conversion_rate;
     }
     $price = Tools::displayPrice($order['total_paid'], $this->context->currency);
     $this->context->smarty->assign(array('order' => $order, 'price' => $price));
     if (version_compare(_PS_VERSION_, '1.5', '>')) {
         $this->context->smarty->assign(array('reference_order' => Order::getUniqReferenceOf($id_order)));
     }
     echo $this->context->smarty->fetch(_PS_MODULE_DIR_ . '/paypal/views/templates/front/order-confirmation.tpl');
 }
    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">&nbsp;</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">&nbsp;</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 
    }
    function content_560ec47a259684_22515537($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_escape')) {
            include '/Applications/XAMPP/xamppfiles/htdocs/prestashop/tools/smarty/plugins/modifier.escape.php';
        }
        ?>

<?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><?php 
        echo smartyTranslate(array('s' => 'Order history'), $_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();
        }
        echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['tpl_dir']->value . "./breadcrumb.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>

<?php 
        echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['tpl_dir']->value . "./errors.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
        ?>


<h1><?php 
        echo smartyTranslate(array('s' => 'Order history'), $_smarty_tpl);
        ?>
</h1>
<p><?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="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="std">
		<thead>
			<tr>
				<th class="first_item"><?php 
            echo smartyTranslate(array('s' => 'Order reference'), $_smarty_tpl);
            ?>
</th>
				<th class="item"><?php 
            echo smartyTranslate(array('s' => 'Date'), $_smarty_tpl);
            ?>
</th>
				<th class="item"><?php 
            echo smartyTranslate(array('s' => 'Total price'), $_smarty_tpl);
            ?>
</th>
				<th class="item"><?php 
            echo smartyTranslate(array('s' => 'Payment: '), $_smarty_tpl);
            ?>
</th>
				<th class="item"><?php 
            echo smartyTranslate(array('s' => 'Status'), $_smarty_tpl);
            ?>
</th>
				<th class="item"><?php 
            echo smartyTranslate(array('s' => 'Invoice'), $_smarty_tpl);
            ?>
</th>
				<th class="last_item" style="width:65px">&nbsp;</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 src="<?php 
                    echo $_smarty_tpl->tpl_vars['img_dir']->value;
                    ?>
icon/download_product.gif" class="icon" 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 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('order-detail', true), ENT_QUOTES, 'UTF-8', true);
                ?>
');"><?php 
                echo Order::getUniqReferenceOf($_smarty_tpl->tpl_vars['order']->value['id_order']);
                ?>
</a>
				</td>
				<td 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"><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 smarty_modifier_escape($_smarty_tpl->tpl_vars['order']->value['payment'], 'htmlall', 'UTF-8');
                ?>
</td>
				<td class="history_state"><?php 
                if (isset($_smarty_tpl->tpl_vars['order']->value['order_state'])) {
                    echo smarty_modifier_escape($_smarty_tpl->tpl_vars['order']->value['order_state'], 'htmlall', 'UTF-8');
                }
                ?>
</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 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);
                    ?>
" class="_blank"><img src="<?php 
                    echo $_smarty_tpl->tpl_vars['img_dir']->value;
                    ?>
icon/pdf.gif" alt="<?php 
                    echo smartyTranslate(array('s' => 'Invoice'), $_smarty_tpl);
                    ?>
" class="icon" /></a>
					<a 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);
                    ?>
" class="_blank"><?php 
                    echo smartyTranslate(array('s' => 'PDF'), $_smarty_tpl);
                    ?>
</a>
				<?php 
                } else {
                    ?>
-<?php 
                }
                ?>
				</td>
				<td class="history_detail">
					<a class="color-myaccount" href="javascript:showOrder(1, <?php 
                echo intval($_smarty_tpl->tpl_vars['order']->value['id_order']);
                ?>
, '<?php 
                echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('order-detail', true), ENT_QUOTES, 'UTF-8', true);
                ?>
');"><?php 
                echo smartyTranslate(array('s' => 'details'), $_smarty_tpl);
                ?>
</a>
					<?php 
                if (isset($_smarty_tpl->tpl_vars['opc']->value) && $_smarty_tpl->tpl_vars['opc']->value) {
                    ?>
					<a href="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('order-opc', true, null, "submitReorder&id_order=" . (string) $_smarty_tpl->tpl_vars['order']->value['id_order']), ENT_QUOTES, 'UTF-8', true);
                    ?>
" title="<?php 
                    echo smartyTranslate(array('s' => 'Reorder'), $_smarty_tpl);
                    ?>
">
					<?php 
                } else {
                    ?>
					<a href="<?php 
                    echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('order', true, null, "submitReorder&id_order=" . (string) $_smarty_tpl->tpl_vars['order']->value['id_order']), ENT_QUOTES, 'UTF-8', true);
                    ?>
" title="<?php 
                    echo smartyTranslate(array('s' => 'Reorder'), $_smarty_tpl);
                    ?>
">
					<?php 
                }
                ?>
						<img src="<?php 
                echo $_smarty_tpl->tpl_vars['img_dir']->value;
                ?>
arrow_rotate_anticlockwise.png" alt="<?php 
                echo smartyTranslate(array('s' => 'Reorder'), $_smarty_tpl);
                ?>
" title="<?php 
                echo smartyTranslate(array('s' => 'Reorder'), $_smarty_tpl);
                ?>
" class="icon" />
					</a>
				</td>
			</tr>
		<?php 
            }
            ?>
		</tbody>
	</table>
	<div id="block-order-detail" class="hidden">&nbsp;</div>
	<?php 
        } else {
            ?>
		<p class="warning"><?php 
            echo smartyTranslate(array('s' => 'You have not placed any orders.'), $_smarty_tpl);
            ?>
</p>
	<?php 
        }
        ?>
</div>

<ul class="footer_links clearfix">
	<li><a href="<?php 
        echo htmlspecialchars($_smarty_tpl->tpl_vars['link']->value->getPageLink('my-account', true), ENT_QUOTES, 'UTF-8', true);
        ?>
"><img src="<?php 
        echo $_smarty_tpl->tpl_vars['img_dir']->value;
        ?>
icon/my-account.gif" alt="" class="icon" /> <?php 
        echo smartyTranslate(array('s' => 'Back to Your Account'), $_smarty_tpl);
        ?>
</a></li>
	<li class="f_right"><a href="<?php 
        echo $_smarty_tpl->tpl_vars['base_dir']->value;
        ?>
"><img src="<?php 
        echo $_smarty_tpl->tpl_vars['img_dir']->value;
        ?>
icon/home.gif" alt="" class="icon" /> <?php 
        echo smartyTranslate(array('s' => 'Home'), $_smarty_tpl);
        ?>
</a></li>
</ul>
<?php 
    }
Example #7
0
    public static function getOrdersReturn($customer_id, $order_id = false, $no_denied = false, Context $context = null)
    {
        if (!$context) {
            $context = Context::getContext();
        }
        $data = Db::getInstance()->executeS('
		SELECT *
		FROM `' . _DB_PREFIX_ . 'order_return`
		WHERE `id_customer` = ' . (int) $customer_id . ($order_id ? ' AND `id_order` = ' . (int) $order_id : '') . ($no_denied ? ' AND `state` != 4' : '') . '
		ORDER BY `date_add` DESC');
        foreach ($data as $k => $or) {
            $state = new OrderReturnState($or['state']);
            $data[$k]['state_name'] = $state->name[$context->language->id];
            $data[$k]['type'] = 'Return';
            $data[$k]['tracking_number'] = $or['id_order_return'];
            $data[$k]['can_edit'] = false;
            $data[$k]['reference'] = Order::getUniqReferenceOf($or['id_order']);
        }
        return $data;
    }
    function content_566719ab5152a4_13849677($_smarty_tpl)
    {
        if (!is_callable('smarty_modifier_escape')) {
            include '/srv/www/helveti/helveti.cz/tools/smarty/plugins/modifier.escape.php';
        }
        if (!is_callable('smarty_modifier_regex_replace')) {
            include '/srv/www/helveti/helveti.cz/tools/smarty/plugins/modifier.regex_replace.php';
        }
        ?>

<?php 
        if (!$_smarty_tpl->tpl_vars['ps_16']->value) {
            $_smarty_tpl->_capture_stack[0][] = array('path', null, null);
            ob_start();
            ?>
<a href="<?php 
            echo $_smarty_tpl->tpl_vars['link']->value->getPageLink('my-account', true);
            ?>
"><?php 
            echo smartyTranslate(array('s' => 'My account'), $_smarty_tpl);
            ?>
</a><span class="navigation-pipe"><?php 
            echo $_smarty_tpl->tpl_vars['navigationPipe']->value;
            ?>
</span><?php 
            echo smartyTranslate(array('s' => 'Order history'), $_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();
            }
            echo $_smarty_tpl->getSubTemplate((string) $_smarty_tpl->tpl_vars['tpl_dir']->value . "./errors.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, null, null, array(), 0);
            ?>


<h1><?php 
            echo smartyTranslate(array('s' => 'Order history'), $_smarty_tpl);
            ?>
</h1>
<p><?php 
            echo smartyTranslate(array('s' => 'Here are the orders you have placed since the creation of your account'), $_smarty_tpl);
            ?>
.</p>

<?php 
            if ($_smarty_tpl->tpl_vars['slowValidation']->value) {
                ?>
<p class="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="std">
		<thead>
			<tr>
				<th class="first_item"><?php 
                echo smartyTranslate(array('s' => 'Order Reference'), $_smarty_tpl);
                ?>
</th>
				<th class="item"><?php 
                echo smartyTranslate(array('s' => 'Date'), $_smarty_tpl);
                ?>
</th>
				<th class="item"><?php 
                echo smartyTranslate(array('s' => 'Total price'), $_smarty_tpl);
                ?>
</th>
				<th class="item"><?php 
                echo smartyTranslate(array('s' => 'Payment'), $_smarty_tpl);
                ?>
</th>
				<th class="item"><?php 
                echo smartyTranslate(array('s' => 'Status'), $_smarty_tpl);
                ?>
</th>
				<th class="item"><?php 
                echo smartyTranslate(array('s' => 'Invoice'), $_smarty_tpl);
                ?>
</th>
				<th class="last_item" style="width:65px">&nbsp;</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 src="<?php 
                        echo $_smarty_tpl->tpl_vars['img_dir']->value;
                        ?>
icon/download_product.gif" class="icon" 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 
                    echo $_smarty_tpl->tpl_vars['link']->value->getPageLink('order-detail', true);
                    ?>
');"><?php 
                    echo Order::getUniqReferenceOf($_smarty_tpl->tpl_vars['order']->value['id_order']);
                    ?>
</a>
				</td>
				<td 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"><span class="price"><?php 
                    echo $_smarty_tpl->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION]['displayPrice'][0][0]->displayPriceSmarty(array('price' => round($_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 smarty_modifier_escape($_smarty_tpl->tpl_vars['order']->value['payment'], 'htmlall', 'UTF-8');
                    ?>
</td>
				<td class="history_state">
                	<?php 
                    if (isset($_smarty_tpl->tpl_vars['order']->value['order_state'])) {
                        echo smarty_modifier_escape($_smarty_tpl->tpl_vars['order']->value['order_state'], 'htmlall', 'UTF-8');
                    }
                    ?>
					<?php 
                    if ($_smarty_tpl->tpl_vars['order']->value['module'] == $_smarty_tpl->tpl_vars['name_gopay']->value && ($_smarty_tpl->tpl_vars['order']->value['current_state'] == $_smarty_tpl->tpl_vars['ADD_GOPAY_STATUS_']->value || $_smarty_tpl->tpl_vars['order']->value['current_state'] == $_smarty_tpl->tpl_vars['ADD_GOPAY_STATUS_CHOSEN_']->value || $_smarty_tpl->tpl_vars['order']->value['current_state'] == $_smarty_tpl->tpl_vars['ADD_GOPAY_STATUS_TIMEOUT_']->value || $_smarty_tpl->tpl_vars['order']->value['current_state'] == $_smarty_tpl->tpl_vars['_PS_OS_ERROR_']->value || $_smarty_tpl->tpl_vars['order']->value['current_state'] == $_smarty_tpl->tpl_vars['ADD_GOPAY_STATUS_CANCELED_']->value)) {
                        ?>
						<p style="margin-top:10px;">
							<a  href="<?php 
                        ob_start();
                        echo $_smarty_tpl->tpl_vars['order']->value['id_order'];
                        $_tmp1 = ob_get_clean();
                        echo $_smarty_tpl->tpl_vars['link']->value->getModuleLink('add_gopay_new', 'repeatPayment', array('orderId' => $_tmp1, 'paymentChannel' => 'ACCOUNT'), true);
                        ?>
"
								title="<?php 
                        echo smartyTranslate(array('s' => 'Pay with Gopay', 'mod' => 'add_gopay_new'), $_smarty_tpl);
                        ?>
"
								class="button"
								id="butmk_<?php 
                        echo $_smarty_tpl->tpl_vars['order']->value['id_order'];
                        ?>
"
								<?php 
                        if ($_smarty_tpl->tpl_vars['INLINE_MODE']->value) {
                            ?>
onClick="inlineFunction(this.href);"<?php 
                        }
                        ?>
							>
							<?php 
                        echo smartyTranslate(array('s' => 'Again, pay with Gopay', 'mod' => 'add_gopay_new'), $_smarty_tpl);
                        ?>

						</a></p>

					<?php 
                    }
                    ?>
					<?php 
                    $_smarty_tpl->tpl_vars['id_session'] = new Smarty_variable($_smarty_tpl->tpl_vars['RECURRENT']->value->getReccurenceStarted(intval($_smarty_tpl->tpl_vars['order']->value['id_order'])), null, 0);
                    ?>
					<?php 
                    if ($_smarty_tpl->tpl_vars['id_session']->value) {
                        ?>
						<div class="conf" id="conf_<?php 
                        echo $_smarty_tpl->tpl_vars['order']->value['id_order'];
                        ?>
" style="display:none"><?php 
                        echo smartyTranslate(array('s' => 'Recurring payments were terminated', 'mod' => 'add_gopay_new'), $_smarty_tpl);
                        ?>
</div>
						<div class="error" id="error_<?php 
                        echo $_smarty_tpl->tpl_vars['order']->value['id_order'];
                        ?>
" style="display:none"></div>
						<p style="margin-top:10px;">
							<a  href="#"
								title="<?php 
                        echo smartyTranslate(array('s' => 'Cancel recurrent', 'mod' => 'add_gopay_new'), $_smarty_tpl);
                        ?>
"
								class="btn btn-default button button-small"
								id="cancel_recurr_<?php 
                        echo $_smarty_tpl->tpl_vars['order']->value['id_order'];
                        ?>
"
								onclick="if (confirm('<?php 
                        echo smartyTranslate(array('s' => 'Update selected items?', 'mod' => 'add_gopay_new'), $_smarty_tpl);
                        ?>
'))cancelRecurrent(<?php 
                        echo intval($_smarty_tpl->tpl_vars['order']->value['id_order']);
                        ?>
, <?php 
                        echo $_smarty_tpl->tpl_vars['id_session']->value;
                        ?>
); return false;"
								
							>
								<span><?php 
                        echo smartyTranslate(array('s' => 'Cancel recurrent', 'mod' => 'add_gopay_new'), $_smarty_tpl);
                        ?>
</span>
							</a>
						</p>
					<?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 href="<?php 
                        echo $_smarty_tpl->tpl_vars['link']->value->getPageLink('pdf-invoice', true, null, "id_order=" . (string) $_smarty_tpl->tpl_vars['order']->value['id_order']);
                        ?>
" title="<?php 
                        echo smartyTranslate(array('s' => 'Invoice'), $_smarty_tpl);
                        ?>
" target="_blank"><img src="<?php 
                        echo $_smarty_tpl->tpl_vars['img_dir']->value;
                        ?>
icon/pdf.gif" alt="<?php 
                        echo smartyTranslate(array('s' => 'Invoice'), $_smarty_tpl);
                        ?>
" class="icon" /></a>
					<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['link']->value->getPageLink('pdf-invoice', true, null, "id_order=" . (string) $_smarty_tpl->tpl_vars['order']->value['id_order']);
                        ?>
" title="<?php 
                        echo smartyTranslate(array('s' => 'Invoice'), $_smarty_tpl);
                        ?>
" target="_blank"><?php 
                        echo smartyTranslate(array('s' => 'PDF'), $_smarty_tpl);
                        ?>
</a>
				<?php 
                    } else {
                        ?>
-<?php 
                    }
                    ?>
				</td>
				<td class="history_detail">
					<a class="color-myaccount" href="javascript:showOrder(1, <?php 
                    echo intval($_smarty_tpl->tpl_vars['order']->value['id_order']);
                    ?>
, '<?php 
                    echo $_smarty_tpl->tpl_vars['link']->value->getPageLink('order-detail', true);
                    ?>
');"><?php 
                    echo smartyTranslate(array('s' => 'details'), $_smarty_tpl);
                    ?>
</a>
					<?php 
                    if (isset($_smarty_tpl->tpl_vars['opc']->value) && $_smarty_tpl->tpl_vars['opc']->value) {
                        ?>
					<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['link']->value->getPageLink('order-opc', true, null, "submitReorder&id_order=" . (string) $_smarty_tpl->tpl_vars['order']->value['id_order']);
                        ?>
" title="<?php 
                        echo smartyTranslate(array('s' => 'Reorder'), $_smarty_tpl);
                        ?>
">
					<?php 
                    } else {
                        ?>
					<a href="<?php 
                        echo $_smarty_tpl->tpl_vars['link']->value->getPageLink('order', true, null, "submitReorder&id_order=" . (string) $_smarty_tpl->tpl_vars['order']->value['id_order']);
                        ?>
" title="<?php 
                        echo smartyTranslate(array('s' => 'Reorder'), $_smarty_tpl);
                        ?>
">
					<?php 
                    }
                    ?>
						<img src="<?php 
                    echo $_smarty_tpl->tpl_vars['img_dir']->value;
                    ?>
arrow_rotate_anticlockwise.png" alt="<?php 
                    echo smartyTranslate(array('s' => 'Reorder'), $_smarty_tpl);
                    ?>
" title="<?php 
                    echo smartyTranslate(array('s' => 'Reorder'), $_smarty_tpl);
                    ?>
" class="icon" />
					</a>
				</td>
			</tr>
		<?php 
                }
                ?>
		</tbody>
	</table>
	<div id="block-order-detail" class="hidden">&nbsp;</div>
	<?php 
            } else {
                ?>
		<p class="warning"><?php 
                echo smartyTranslate(array('s' => 'You have not placed any orders.'), $_smarty_tpl);
                ?>
</p>
	<?php 
            }
            ?>
</div>

<ul class="footer_links clearfix">
	<li><a href="<?php 
            echo $_smarty_tpl->tpl_vars['link']->value->getPageLink('my-account', true);
            ?>
"><img src="<?php 
            echo $_smarty_tpl->tpl_vars['img_dir']->value;
            ?>
icon/my-account.gif" alt="" class="icon" /> <?php 
            echo smartyTranslate(array('s' => 'Back to Your Account'), $_smarty_tpl);
            ?>
</a></li>
	<li class="f_right"><a href="<?php 
            echo $_smarty_tpl->tpl_vars['base_dir']->value;
            ?>
"><img src="<?php 
            echo $_smarty_tpl->tpl_vars['img_dir']->value;
            ?>
icon/home.gif" alt="" class="icon" /> <?php 
            echo smartyTranslate(array('s' => 'Home'), $_smarty_tpl);
            ?>
</a></li>
</ul>

<?php 
        } else {
            ?>
	


<?php 
            $_smarty_tpl->_capture_stack[0][] = array('path', null, null);
            ob_start();
            ?>
	<a href="<?php 
            echo smarty_modifier_escape($_smarty_tpl->tpl_vars['link']->value->getPageLink('my-account', true), 'html', 'UTF-8');
            ?>
">
		<?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, null, 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">&nbsp;</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 
                    echo smarty_modifier_escape($_smarty_tpl->tpl_vars['link']->value->getPageLink('order-detail', true), 'html', 'UTF-8');
                    ?>
');">
								<?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 smarty_modifier_escape($_smarty_tpl->tpl_vars['order']->value['payment'], 'html', 'UTF-8');
                    ?>
</td>
						<td data-value="<?php 
                    echo $_smarty_tpl->tpl_vars['order']->value['id_order_state'];
                    ?>
" class="history_state">
							<?php 
                    if (isset($_smarty_tpl->tpl_vars['order']->value['order_state'])) {
                        ?>
								<span class="label<?php 
                        if ($_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 1 || $_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 10 || $_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 11) {
                            ?>
 label-info<?php 
                        } elseif ($_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 5 || $_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 2 || $_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 12) {
                            ?>
 label-success<?php 
                        } elseif ($_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 6 || $_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 7 || $_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 8) {
                            ?>
 label-danger<?php 
                        } elseif ($_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 3 || $_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 9 || $_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 4) {
                            ?>
 label-warning<?php 
                        }
                        ?>
" <?php 
                        if ($_smarty_tpl->tpl_vars['order']->value['id_order_state'] > 12) {
                            ?>
style="background-color:<?php 
                            echo $_smarty_tpl->tpl_vars['order']->value['order_state_color'];
                            ?>
;"<?php 
                        }
                        ?>
>
									<?php 
                        echo smarty_modifier_escape($_smarty_tpl->tpl_vars['order']->value['order_state'], 'html', 'UTF-8');
                        ?>

								</span>
					<?php 
                        if ($_smarty_tpl->tpl_vars['order']->value['module'] == $_smarty_tpl->tpl_vars['name_gopay']->value && ($_smarty_tpl->tpl_vars['order']->value['current_state'] == $_smarty_tpl->tpl_vars['ADD_GOPAY_STATUS_']->value || $_smarty_tpl->tpl_vars['order']->value['current_state'] == $_smarty_tpl->tpl_vars['ADD_GOPAY_STATUS_CHOSEN_']->value || $_smarty_tpl->tpl_vars['order']->value['current_state'] == $_smarty_tpl->tpl_vars['ADD_GOPAY_STATUS_TIMEOUT_']->value || $_smarty_tpl->tpl_vars['order']->value['current_state'] == $_smarty_tpl->tpl_vars['_PS_OS_ERROR_']->value || $_smarty_tpl->tpl_vars['order']->value['current_state'] == $_smarty_tpl->tpl_vars['ADD_GOPAY_STATUS_CANCELED_']->value)) {
                            ?>
						<p style="margin-top:10px;">
							<a  href="<?php 
                            ob_start();
                            echo $_smarty_tpl->tpl_vars['order']->value['id_order'];
                            $_tmp2 = ob_get_clean();
                            echo $_smarty_tpl->tpl_vars['link']->value->getModuleLink('add_gopay_new', 'repeatPayment', array('orderId' => $_tmp2, 'paymentChannel' => 'ACCOUNT'), true);
                            ?>
"
								title="<?php 
                            echo smartyTranslate(array('s' => 'Pay with Gopay', 'mod' => 'add_gopay_new'), $_smarty_tpl);
                            ?>
"
								class="button"
								id="butmk_<?php 
                            echo $_smarty_tpl->tpl_vars['order']->value['id_order'];
                            ?>
"
								<?php 
                            if ($_smarty_tpl->tpl_vars['INLINE_MODE']->value) {
                                ?>
onClick="inlineFunction(this.href);"<?php 
                            }
                            ?>
							>
							<?php 
                            echo smartyTranslate(array('s' => 'Again, pay with Gopay', 'mod' => 'add_gopay_new'), $_smarty_tpl);
                            ?>

						</a></p>

					<?php 
                        }
                        ?>
					<?php 
                        $_smarty_tpl->tpl_vars['id_session'] = new Smarty_variable($_smarty_tpl->tpl_vars['RECURRENT']->value->getReccurenceStarted(intval($_smarty_tpl->tpl_vars['order']->value['id_order'])), null, 0);
                        ?>
					<?php 
                        if ($_smarty_tpl->tpl_vars['id_session']->value) {
                            ?>
						<div class="conf" id="conf_<?php 
                            echo $_smarty_tpl->tpl_vars['order']->value['id_order'];
                            ?>
" style="display:none"><?php 
                            echo smartyTranslate(array('s' => 'Recurring payments were terminated', 'mod' => 'add_gopay_new'), $_smarty_tpl);
                            ?>
</div>
						<div class="error" id="error_<?php 
                            echo $_smarty_tpl->tpl_vars['order']->value['id_order'];
                            ?>
" style="display:none"></div>
						<p style="margin-top:10px;">
							<a  href="#"
								title="<?php 
                            echo smartyTranslate(array('s' => 'Cancel recurrent', 'mod' => 'add_gopay_new'), $_smarty_tpl);
                            ?>
"
								class="btn btn-default button button-small"
								id="cancel_recurr_<?php 
                            echo $_smarty_tpl->tpl_vars['order']->value['id_order'];
                            ?>
"
								onclick="if (confirm('<?php 
                            echo smartyTranslate(array('s' => 'Update selected items?', 'mod' => 'add_gopay_new'), $_smarty_tpl);
                            ?>
'))cancelRecurrent(<?php 
                            echo intval($_smarty_tpl->tpl_vars['order']->value['id_order']);
                            ?>
, <?php 
                            echo $_smarty_tpl->tpl_vars['id_session']->value;
                            ?>
); return false;"
								
							>
								<span><?php 
                            echo smartyTranslate(array('s' => 'Cancel recurrent', 'mod' => 'add_gopay_new'), $_smarty_tpl);
                            ?>
</span>
							</a>
						</p>
					<?php 
                        }
                        ?>
							<?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 smarty_modifier_escape($_smarty_tpl->tpl_vars['link']->value->getPageLink('pdf-invoice', true, null, "id_order=" . (string) $_smarty_tpl->tpl_vars['order']->value['id_order']), 'html', 'UTF-8');
                        ?>
" 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 
                    echo smarty_modifier_escape($_smarty_tpl->tpl_vars['link']->value->getPageLink('order-detail', true), 'html', 'UTF-8');
                    ?>
');">
								<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 
                        echo smarty_modifier_escape($_smarty_tpl->tpl_vars['link']->value->getPageLink('order-opc', true, null, "submitReorder&id_order=" . (string) $_smarty_tpl->tpl_vars['order']->value['id_order']), 'html', 'UTF-8');
                        ?>
" title="<?php 
                        echo smartyTranslate(array('s' => 'Reorder'), $_smarty_tpl);
                        ?>
">
							<?php 
                    } else {
                        ?>
								<a class="link-button" href="<?php 
                        echo smarty_modifier_escape($_smarty_tpl->tpl_vars['link']->value->getPageLink('order', true, null, "submitReorder&id_order=" . (string) $_smarty_tpl->tpl_vars['order']->value['id_order']), 'html', 'UTF-8');
                        ?>
" title="<?php 
                        echo smartyTranslate(array('s' => 'Reorder'), $_smarty_tpl);
                        ?>
">
							<?php 
                    }
                    ?>
		                        <i class="icon-refresh"></i><?php 
                    echo smartyTranslate(array('s' => 'Reorder'), $_smarty_tpl);
                    ?>

							</a>
						</td>
					</tr>
				<?php 
                }
                ?>
			</tbody>
		</table>
		<div id="block-order-detail" class="unvisible">&nbsp;</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 smarty_modifier_escape($_smarty_tpl->tpl_vars['link']->value->getPageLink('my-account', true), 'html', 'UTF-8');
            ?>
">
			<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 
        }
        ?>

<?php 
        if ($_smarty_tpl->tpl_vars['INLINE_MODE']->value) {
            ?>
<script src="https://gate.gopay.cz/gp-gw/js/embed.js"></script>
<?php 
        }
    }
Example #9
0
                break;
            }
            $id_order = Db::getInstance()->getValue('SELECT o.id_order
						FROM ' . _DB_PREFIX_ . 'orders o
						LEFT JOIN ' . _DB_PREFIX_ . 'syspay_payment sp ON o.id_cart=sp.id_cart
						WHERE sp.id_syspay_payment=' . (int) $event->getPayment()->getId());
            $order = new Order($id_order);
            if (!$order) {
                break;
            }
            if (!Validate::isLoadedObject($order)) {
                return false;
            }
            $res = Db::getInstance()->execute('INSERT INTO ' . _DB_PREFIX_ . 'syspay_refund VALUES(' . (int) $event->getId() . ', ' . (int) $id_order . ')');
            if (version_compare(_PS_VERSION_, '1.5', '>=')) {
                $order_reference = Order::getUniqReferenceOf($id_order);
                $order_values = Db::getInstance()->getRow('SELECT op.*
							FROM ' . _DB_PREFIX_ . 'order_payment op
							WHERE op.order_reference LIKE "' . $order_reference . '" ORDER BY id_order_payment ASC');
                $order_has_invoice = $order->hasInvoice();
                if ($order_has_invoice) {
                    $id_order_invoice = Db::getInstance()->getValue('SELECT id_order_invoice 
								FROM ' . _DB_PREFIX_ . 'order_invoice WHERE id_order=' . (int) $id_order . ' ORDER BY date_add ASC');
                    $order_invoice = new OrderInvoice($id_order_invoice);
                } else {
                    $order_invoice = null;
                }
                if (!$order->addOrderPayment($event->getAmount() / 100 * -1, $order_values['payment_method'], $order_values['transaction_id'], null, null, $order_invoice)) {
                    return false;
                }
            }
Example #10
0
 /**
  * @see FrontController::initContent()
  */
 public function initContent()
 {
     parent::initContent();
     $data = array();
     /**
      * Set ref is indicative of a payment that is tied to an order instead of a cart, which
      * we still support for transitional reasons.
      */
     if (isset($_GET['ref'])) {
         $order_id = (int) $_GET['id'];
         // Check if user is allowed to be on the return page
         $data['auth'] = Order::getUniqReferenceOf($order_id) === $_GET['ref'];
         if ($data['auth']) {
             $data['mollie_info'] = $this->module->getPaymentBy('order_id', (int) $order_id);
         }
     } elseif (isset($_GET['cart_id'])) {
         $cart_id = (int) $_GET['cart_id'];
         // Check if user that's seeing this is the cart-owner
         $cart = new Cart($cart_id);
         $data['auth'] = (int) $cart->id_customer === $this->context->customer->id;
         if ($data['auth']) {
             $data['mollie_info'] = $this->module->getPaymentBy('cart_id', (int) $cart_id);
         }
     }
     if (isset($data['auth']) && $data['auth']) {
         // any paid payments for this cart?
         if ($data['mollie_info'] === FALSE) {
             $data['mollie_info'] = array();
             $data['msg_details'] = $this->module->lang('The order with this id does not exist.');
         } else {
             switch ($data['mollie_info']['bank_status']) {
                 case Mollie_API_Object_Payment::STATUS_OPEN:
                     $data['msg_details'] = $this->module->lang('We have not received a definite payment status. You will be notified as soon as we receive a confirmation of the bank/merchant.');
                     break;
                 case Mollie_API_Object_Payment::STATUS_CANCELLED:
                     Tools::redirect('order&step=3');
                     break;
                 case Mollie_API_Object_Payment::STATUS_EXPIRED:
                     $data['msg_details'] = $this->module->lang('Unfortunately your order was expired.');
                     break;
                 case Mollie_API_Object_Payment::STATUS_PAID:
                     if (isset($cart_id)) {
                         Tools::redirectLink(__PS_BASE_URI__ . 'index.php?controller=order-confirmation&id_cart=' . $cart_id . '&id_module=' . $this->module->id . '&id_order=' . Order::getOrderByCartId(intval($cart_id)) . '&key=' . $this->context->customer->secure_key);
                     }
                     $data['msg_details'] = $this->module->lang('Thank you. Your order has been received.');
                     break;
                 default:
                     $data['msg_details'] = $this->module->lang('The transaction has an unexpected status.');
                     if (Configuration::get('MOLLIE_DEBUG_LOG') == Mollie::DEBUG_LOG_ERRORS) {
                         Logger::addLog(__METHOD__ . 'said: The transaction has an unexpected status (' . $data['mollie_info']['bank_status'] . ')', Mollie::WARNING);
                     }
             }
         }
     } else {
         $data['mollie_info'] = array();
         $data['msg_details'] = $this->module->lang('You are not authorised to see this page.');
         Tools::redirect(_PS_BASE_URL_ . __PS_BASE_URI__);
     }
     $data['msg_continue'] = '<a href="' . _PS_BASE_URL_ . __PS_BASE_URI__ . '">' . $this->module->lang('Continue shopping') . '</a>';
     $data['msg_welcome'] = $this->module->lang('Welcome back');
     $this->context->smarty->assign($data);
     $this->setTemplate('mollie_return.tpl');
 }
Example #11
0
 /**
  * Trusted Shops Buyer Protection is integrated at the end of the checkout
  * as a form on the order confirmation page.
  * At the moment the customer clicks the registration button,
  * the order data is processed to Trusted Shops.
  * The customer confirms the Buyer Protection on the Trusted Shops site.
  * The guarantee is then booked and the customer receives an email by Trusted Shops.
  *
  * @param array $params
  * @param string $lang
  * @return string tpl content
  */
 private function orderConfirmationClassic($params, $lang)
 {
     $payment_type = 'OTHER';
     // Payment type for native module list
     /*
     DIRECT_DEBIT                               Lastschrift / Bankeinzug
     CREDIT_CARD                                Kreditkarte
     INVOICE                                    Rechnung
     CASH_ON_DELIVERY                           Nachnahme
     PREPAYMENT                                 Vorauskasse / Überweisung
     CHEQUE                                     Verrechnungsscheck
     PAYBOX                                     Paybox Integrationshandbuch Shopbetreiber
     PAYPAL                                     PayPal
     AMAZON_PAYMENTS                            Amazon Payments
     CASH_ON_PICKUP                             Zahlung bei Abholung
     FINANCING                                 Finanzierung
     LEASING                                   Leasing
     T_PAY                                     T-Pay
     CLICKANDBUY                               Click&Buy
     GIROPAY                                   Giropay
     GOOGLE_CHECKOUT                           Checkout
     SHOP_CARD                                 Zahlungskarte des Online Shops
     DIRECT_E_BANKING                          SOFORT Überweisung
     MONEYBOOKERS                              moneybookers.com
     DOTPAY                                    Dotpay
     PLATNOSCI                                 Płatności
     PRZELEWY24                                Przelewy24
     OTHER                                     Andere Zahlungsart
     */
     $payment_type_list = array('bankwire' => 'PREPAYMENT', 'authorizeaim' => 'CREDIT_CARD', 'buyster' => 'CREDIT_CARD', 'cashondelivery' => 'CASH_ON_DELIVERY', 'dibs' => 'CREDIT_CARD', 'cheque' => 'CHEQUE', 'gcheckout' => 'GOOGLE_CHECKOUT', 'hipay' => 'CREDIT_CARD', 'moneybookers' => 'MONEYBOOKERS', 'kwixo' => 'CREDIT_CARD', 'paypal' => 'CREDIT_CARD', 'paysafecard' => 'CREDIT_CARD', 'wexpay' => 'CREDIT_CARD', 'banktransfert' => 'DIRECT DEBIT');
     if (array_key_exists($params['objOrder']->module, $payment_type_list)) {
         $payment_type = $payment_type_list[$params['objOrder']->module];
     }
     $customer = new Customer($params['objOrder']->id_customer);
     $currency = new Currency((int) $params['objOrder']->id_currency);
     $arr_params = array('amount' => $params['total_to_pay'], 'buyer_email' => $customer->email, 'charset' => 'UTF-8', 'currency' => $currency->iso_code, 'customer_id' => $customer->id, 'order_id' => $params['objOrder']->id, 'order_reference' => Order::getUniqReferenceOf($params['objOrder']->id), 'payment_type' => $payment_type, 'shop_id' => TSCommon::$certificates[$lang]['tsID']);
     TSCommon::$smarty->assign(array('tax_label' => 'TTC', 'buyer_protection' => $arr_params));
     return $this->display(TSCommon::$module_name, '/views/templates/front/' . self::getTemplateByVersion('order-confirmation-tsbp-classic'));
 }
    function content_530ff8eb9e0790_67346110($_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';
        }
        ?>

<?php 
        $_smarty_tpl->_capture_stack[0][] = array('path', null, null);
        ob_start();
        ?>
	<a href="<?php 
        echo smarty_modifier_escape($_smarty_tpl->tpl_vars['link']->value->getPageLink('my-account', true), 'html', 'UTF-8');
        ?>
">
		<?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, null, 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">&nbsp;</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 
                echo smarty_modifier_escape($_smarty_tpl->tpl_vars['link']->value->getPageLink('order-detail', true), 'html', 'UTF-8');
                ?>
');">
								<?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 smarty_modifier_escape($_smarty_tpl->tpl_vars['order']->value['payment'], 'html', 'UTF-8');
                ?>
</td>
						<td data-value="<?php 
                echo $_smarty_tpl->tpl_vars['order']->value['id_order_state'];
                ?>
" class="history_state">
							<?php 
                if (isset($_smarty_tpl->tpl_vars['order']->value['order_state'])) {
                    ?>
								<span class="label<?php 
                    if ($_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 1 || $_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 10 || $_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 11) {
                        ?>
 label-info<?php 
                    } elseif ($_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 5 || $_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 2 || $_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 12) {
                        ?>
 label-success<?php 
                    } elseif ($_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 6 || $_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 7 || $_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 8) {
                        ?>
 label-danger<?php 
                    } elseif ($_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 3 || $_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 9 || $_smarty_tpl->tpl_vars['order']->value['id_order_state'] == 4) {
                        ?>
 label-warning<?php 
                    }
                    ?>
" <?php 
                    if ($_smarty_tpl->tpl_vars['order']->value['id_order_state'] > 12) {
                        ?>
style="background-color:<?php 
                        echo $_smarty_tpl->tpl_vars['order']->value['order_state_color'];
                        ?>
;"<?php 
                    }
                    ?>
>
									<?php 
                    echo smarty_modifier_escape($_smarty_tpl->tpl_vars['order']->value['order_state'], 'html', 'UTF-8');
                    ?>

								</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 smarty_modifier_escape($_smarty_tpl->tpl_vars['link']->value->getPageLink('pdf-invoice', true, null, "id_order=" . (string) $_smarty_tpl->tpl_vars['order']->value['id_order']), 'html', 'UTF-8');
                    ?>
" 
								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 
                echo smarty_modifier_escape($_smarty_tpl->tpl_vars['link']->value->getPageLink('order-detail', true), 'html', 'UTF-8');
                ?>
');">
								<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 
                    echo smarty_modifier_escape($_smarty_tpl->tpl_vars['link']->value->getPageLink('order-opc', true, null, "submitReorder&id_order=" . (string) $_smarty_tpl->tpl_vars['order']->value['id_order']), 'html', 'UTF-8');
                    ?>
" 
								title="<?php 
                    echo smartyTranslate(array('s' => 'Reorder'), $_smarty_tpl);
                    ?>
">
							<?php 
                } else {
                    ?>
								<a 
								class="link-button" 
								href="<?php 
                    echo smarty_modifier_escape($_smarty_tpl->tpl_vars['link']->value->getPageLink('order', true, null, "submitReorder&id_order=" . (string) $_smarty_tpl->tpl_vars['order']->value['id_order']), 'html', 'UTF-8');
                    ?>
" 
								title="<?php 
                    echo smartyTranslate(array('s' => 'Reorder'), $_smarty_tpl);
                    ?>
">
							<?php 
                }
                ?>
		                        <i class="icon-refresh"></i><?php 
                echo smartyTranslate(array('s' => 'Reorder'), $_smarty_tpl);
                ?>

							</a>
						</td>
					</tr>
				<?php 
            }
            ?>
			</tbody>
		</table>
	    <script type="text/javascript">
			$(function () {
	            $('.sort-column').click(function (e) {
	                e.preventDefault();

	                //get the footable sort object
	                var footableSort = $('table').data('footable-sort');

	                //get the index we are wanting to sort by
	                var index = $(this).data('index');

	                footableSort.doSort(index, 'toggle');
	            });
	        });
		</script>
		<div id="block-order-detail" class="unvisible">&nbsp;</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 smarty_modifier_escape($_smarty_tpl->tpl_vars['link']->value->getPageLink('my-account', true), 'html', 'UTF-8');
        ?>
">
			<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 
    }