<?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;

$template = plgSystemVPFrameworkHelper::getTemplate();
?>
<?php if(!empty($this->userDetails->virtuemart_user_id)) : ?>
	<?php echo $this->loadTemplate('vmshopper'); ?>
<?php endif; ?>

<?php echo $this->loadTemplate('address_userfields'); ?>

<?php if($this->userDetails->JUser->get('id')) : ?>
	<?php echo $this->loadTemplate('address_addshipto'); ?>
<?php endif; ?>

<?php if(!$this->userDetails->user_is_vendor) : ?>
	<?php if(VmConfig::get('reg_captcha')) : ?>
		<div class="form-group">
			<div class="col-sm-offset-3 col-sm-9">
				<?php echo $template->getCaptchaField() ?>
			</div>
		</div>
	<?php endif; ?>
	<div class="vm-user-form-buttons-cont">
		<div class="form-group">
			<div class="col-sm-offset-3 col-sm-9">
				<button class="btn btn-base btn-lg" type="submit" onclick="javascript:return myValidator(userForm, true);"><?php echo $this->button_lbl ?></button>
				&nbsp;
				<button class="btn btn-default btn-lg" type="reset" onclick="window.location.href='<?php echo JRoute::_('index.php?option=com_virtuemart&view=user&task=cancel', false); ?>'"><?php echo vmText::_('COM_VIRTUEMART_CANCEL'); ?></button>
			</div>
		</div>
	</div>
<?php endif; ?>

<?php if(!empty($this->virtuemart_userinfo_id)) : ?>
	<input type="hidden" name="virtuemart_userinfo_id" value="<?php echo (int)$this->virtuemart_userinfo_id ?>"/>
<?php endif; ?>

<input type="hidden" name="task" value="saveUser" />
<input type="hidden" name="address_type" value="<?php echo $this->address_type; ?>"/>