<?php
/**
 *---------------------------------------------------------------------------------------
 * @package       VP Smart Template
 *---------------------------------------------------------------------------------------
 * @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('Restricted access');
?>
<div class="cart-select-payment">
	<?php if(VmConfig::get('oncheckout_show_steps', 1)) : ?>
		<div class="checkoutStep" id="checkoutStep3"><?php echo vmText::_('COM_VIRTUEMART_USER_FORM_CART_STEP3') ?></div>
	<?php endif; ?>
	
	<?php if($this->layoutName == 'default') : ?>
	
		<h4 class="cart-method-title"><?php echo vmText::_('COM_VIRTUEMART_CART_SELECT_PAYMENT') ?></h4>
		
		<?php if($this->found_payment_method) : ?>
				<?php foreach ($this->paymentplugins_payments as $paymentplugin_payments) 
				{
					if(is_array($paymentplugin_payments))
					{
						foreach($paymentplugin_payments as $paymentplugin_payment) : ?>
							<div class="paymentplugin-payment clearfix"><?php echo $paymentplugin_payment ?></div>
						<?php endforeach;
					}
				} ?>
			<div class="cart-method-submission-cont clearfix">
				 <button name="updatecart" class="btn btn-default" type="submit" title="<?php echo vmText::_('COM_VIRTUEMART_SAVE'); ?>"><i class="fa fa-check"></i> <?php echo vmText::_('COM_VIRTUEMART_SAVE'); ?></button>
			</div>
		<?php else : ?>
			<p class="bg-box bg-danger"><?php echo $this->payment_not_found_text ?></p>
		<?php endif; ?>
		
	<?php else : ?>
	
		<form method="post" name="choosePaymentRate" action="<?php echo JRoute::_('index.php'); ?>" class="form-validate">
			
			<h2 class="cart-method-title"><?php echo vmText::_('COM_VIRTUEMART_CART_SELECT_PAYMENT') ?></h2>
			
			<?php if($this->found_payment_method) : ?>
				<?php foreach ($this->paymentplugins_payments as $paymentplugin_payments) 
				{
					if(is_array($paymentplugin_payments))
					{
						foreach($paymentplugin_payments as $paymentplugin_payment) : ?>
							<div class="paymentplugin-payment clearfix"><?php echo $paymentplugin_payment ?></div>
						<?php endforeach;
					}
				} ?>
				<div class="cart-method-submission-cont clearfix">
					 <button name="updatecart" class="btn btn-base btn-lg" type="submit" title="<?php echo vmText::_('COM_VIRTUEMART_SAVE'); ?>"><?php echo vmText::_('COM_VIRTUEMART_SAVE'); ?></button>
					 <button class="btn btn-default btn-lg" type="reset" onClick="window.location.href='<?php echo JRoute::_('index.php?option=com_virtuemart&view=cart&task=cancel'); ?>'" ><?php echo vmText::_('COM_VIRTUEMART_CANCEL'); ?></button>
				</div>
			<?php else : ?>
				<p class="bg-box bg-danger"><?php echo $this->payment_not_found_text ?></p>
			<?php endif; ?>
		
			<input type="hidden" name="option" value="com_virtuemart"/>
			<input type="hidden" name="view" value="cart"/>
			<input type="hidden" name="task" value="updatecart"/>
			<input type="hidden" name="controller" value="cart"/>
		</form>
	
	<?php endif; ?>	
</div>