<?php
/**
 *---------------------------------------------------------------------------------------
 * @package      VP Conversion Tracking - Joomla! System Plugin
 * @subpackage   For VirtueMart 3+
 *---------------------------------------------------------------------------------------
 * @copyright    Copyright (C) 2012-2021 VirtuePlanet Services LLP. All rights reserved.
 * @license      GNU General Public License version 2 or later; see LICENSE.txt
 * @authors      Abhishek Das
 * @email        info@virtueplanet.com
 * @link         https://www.virtueplanet.com
 *---------------------------------------------------------------------------------------
*/
defined('_JEXEC') or die;

JHtml::_('jquery.framework');
JHtml::_('stylesheet', 'plg_vpconversiontracking/bootstrap-iso.css', array(), true);
JHtml::_('stylesheet', 'plg_vpconversiontracking/style.css', array(), true);
JHtml::_('script', 'plg_vpconversiontracking/style.js', false, true);
?>
<div class="vp-thankyou-container bootstrap-iso">
	<div class="vp-thankyou-inner">
		<h1 class="vp-thankyou-pageheader text-success"><i class="glyphicon glyphicon-thumbs-up"></i> <?php echo JText::_('COM_VIRTUEMART_CART_ORDERDONE_THANK_YOU') ?></h1>
		<p class="vp-thankyou-subheader text-success"><?php echo JText::_('COM_VIRTUEMART_ORDER_PROCESSED') ?></p>
		<div class="row">
			<div class="col-sm-8">
				<!--Show order information-->
				<div class="vp-thankyou-details">
					<dl class="vp-thankyou-dl">
						<dt><?php echo JText::_('COM_VIRTUEMART_ORDER_NUMBER') ?></dt>
						<dd><?php echo $this->order->order_number ?></dd>
						<dt><?php echo JText::_('COM_VIRTUEMART_DATE') ?></dt>
						<dd><?php echo JHtml::_('date', $this->order->modified_on, JText::_('DATE_FORMAT_LC3')) ?></dd>
						<?php if($this->user->guest && !empty($this->order->order_pass)) : ?>
							<dt><?php echo JText::_('COM_VIRTUEMART_PASSWORD') ?></dt>
							<dd><?php echo $this->order->order_pass ?></dd>
						<?php endif ?>
						<dt><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_PO_STATUS') ?></dt>
						<dd><?php echo $this->order->order_status_name ?></dd>
						<dt><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_PAYMENT_LBL') ?></dt>
						<dd><?php echo $this->order->payment_method ?></dd>
						<?php if(!empty($this->order->invoice_number)) : ?>
							<dt><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_INV_NUMBER') ?></dt>
							<dd><?php echo $this->order->invoice_number ?></dd>
						<?php endif ?>
						<dt><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_TOTAL') ?></dt>
						<dd><?php echo $this->order->currency->priceDisplay($this->order->order_total, $this->order->user_currency_id) ?></dd>
						<?php if(!empty($this->order->customer_note)) : ?>
							<dt><?php echo JText::_('COM_VIRTUEMART_ORDER_PRINT_CUSTOMER_NOTE') ?></dt>
							<dd><?php echo $this->order->customer_note ?></dd>
						<?php endif ?>
					</dl>
				</div>
			</div>
			<div class="col-sm-4">
				<!--Show order details page link and pdf invoice link if exists-->
				<?php if(!empty($this->order->order_link)) : ?>
					<div class="vp-thankyou-links">
						<a href="<?php echo $this->order->order_link ?>" class="btn btn-lg btn-success"><?php echo JText::_('COM_VIRTUEMART_ORDER_VIEW_ORDER') ?></a>
					</div>
				<?php endif ?>
			</div>
		</div>
	</div>
	<?php if(!empty($this->related_products)) : ?>
		<!--Show related products-->
		<div class="vpct-products-container">
			<h3><?php echo JText::_('COM_VIRTUEMART_RELATED_PRODUCTS_HEADING') ?></h3>
			<?php
			$this->products = $this->related_products;
			echo $this->loadTemplate('products');
			?>
		</div>
	<?php endif ?>
	<?php if(!empty($this->suggested_products)) : ?>
		<!--Show suggested products-->
		<div class="vpct-products-container">
			<?php if(count($this->order->items) > 1) : ?>
				<h3><?php echo JText::_('PLG_SYSTEM_VPCONVERSIONTRACKING_SUGGESTED_PRODUCTS') ?></h3>
			<?php else : ?>
				<h3><?php echo JText::_('PLG_SYSTEM_VPCONVERSIONTRACKING_SUGGESTED_PRODUCTS_1') ?></h3>
			<?php endif ?>
			<?php
			$this->products = $this->suggested_products;
			echo $this->loadTemplate('products');
			?>
		</div>
	<?php endif ?>
</div>
<?php echo $this->trackingCodes; // Prints in-page tracking codes if needed ?>