How to move recaptcha to the bottom of the form

Rate this topic: Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.Evaluations: 0, 0.00 on the average.
GK User
Fri Aug 11, 2017 7:44 pm
Reply with quote
Report this post
Hi,
How can I move the recaptcha to the bottom of edit address form?

Thank you.
User avatar
Senior Boarder

teitbite
Fri Aug 18, 2017 9:30 am
Reply with quote
Report this post
Hi

Please look at this thread, maybe it will help:

https://www.gavick.com/forums/storefron ... ha#p271629
User avatar
Moderator

GK User
Mon Aug 28, 2017 4:20 pm
Reply with quote
Report this post
Thank you for your answer.
However, I wasn't able to solve my issue. The post you mentioned suggests a code that includes "contact form" references that I don't know how to replace in order to make it work in the edit address form.
User avatar
Senior Boarder

teitbite
Wed Aug 30, 2017 3:00 pm
Reply with quote
Report this post
Hi

Ok, so looks like I will need some extra explanation, because now I do not know which form You have in mind. Best would be to guide me to I will be able to see it on a life site directly so I know what needs to be done.
User avatar
Moderator

GK User
Wed Aug 30, 2017 6:34 pm
Reply with quote
Report this post
Sent PM.

Thank you.
User avatar
Senior Boarder

teitbite
Wed Sep 06, 2017 6:36 am
Reply with quote
Report this post
Hi

Just found Your message about this issue, but I'm afraid link shows Error 404 page, so I've tried to look for address edit form by myself. I found it, but there was no recaptcha there at all. Can You please lead me step by step and tell me what to do to be able to see this form You have problem with?
User avatar
Moderator

GK User
Fri Sep 08, 2017 5:03 pm
Reply with quote
Report this post
Hi,
Sorry, I was testing a few things and you probably tried in one of those periods.
After a trying a lot of different options, I was finally able to make the changes that I needed:
move captcha do the bottom of the form and remove "register" and "cancel" buttons from the top (maintaining only the ones on the bottom).

I don't know if it fits the best practices in coding, but at least it works:

Code: Select all
<?php
/**
 *
 * Enter address data for the cart, when anonymous users checkout
 *
 * @package    VirtueMart
 * @subpackage User
 * @author Oscar van Eijk, Max Milbers
 * @link http://www.virtuemart.net
 * @copyright Copyright (c) 2004 - 2010 VirtueMart Team. All rights reserved.
 * @license http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
 * VirtueMart is free software. This version may have been modified pursuant
 * to the GNU General Public License, and as distributed it includes or
 * is derivative of works licensed under the GNU General Public License or
 * other free or open source software licenses.
 * @version $Id: edit_address.php 8565 2014-11-12 18:26:14Z Milbo $
 */
// Check to ensure this file is included in Joomla!
defined ('_JEXEC') or die('Restricted access');

// Implement Joomla's form validation
JHtml::_ ('behavior.formvalidation');
JHtml::stylesheet ('vmpanels.css', JURI::root () . 'components/com_virtuemart/assets/css/');

?>
<?php
if (!class_exists('VirtueMartCart')) require(VMPATH_SITE . DS . 'helpers' . DS . 'cart.php');
$this->cart = VirtueMartCart::getCart();
$url = 0;
if ($this->cart->_fromCart or $this->cart->getInCheckOut()) {
   $rview = 'cart';
}
else {
   $rview = 'user';
}

function renderControlButtons($view,$rview){
   ?>
<div class="control-buttons">
   <?php


   if ($view->cart->getInCheckOut() || $view->address_type == 'ST') {
      $buttonclass = 'default';
   }
   else {
      $buttonclass = 'button vm-button-correct';
   }


   if (VmConfig::get ('oncheckout_show_register', 1) && $view->userDetails->JUser->id == 0 && !VmConfig::get ('oncheckout_only_registered', 0) && $view->address_type == 'BT' and $rview == 'cart') {
      echo '<div id="reg_text">'.vmText::sprintf ('COM_VIRTUEMART_ONCHECKOUT_DEFAULT_TEXT_REGISTER', vmText::_ ('COM_VIRTUEMART_REGISTER_AND_CHECKOUT'), vmText::_ ('COM_VIRTUEMART_CHECKOUT_AS_GUEST')).'</div>';         }
   else {
      //echo vmText::_('COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_LBL');
   }
   if (VmConfig::get ('oncheckout_show_register', 1) && $view->userDetails->JUser->id == 0 && $view->address_type == 'BT' and $rview == 'cart') {
      ?>
      <button name="register" class="<?php echo $buttonclass ?>" type="submit" onclick="javascript:return myValidator(userForm,true);"
            title="<?php echo vmText::_ ('COM_VIRTUEMART_REGISTER_AND_CHECKOUT'); ?>"><?php echo vmText::_ ('COM_VIRTUEMART_REGISTER_AND_CHECKOUT'); ?></button>
      <?php if (!VmConfig::get ('oncheckout_only_registered', 0)) { ?>
         <button name="save" class="<?php echo $buttonclass ?>" title="<?php echo vmText::_ ('COM_VIRTUEMART_CHECKOUT_AS_GUEST'); ?>" type="submit"
               onclick="javascript:return myValidator(userForm, false);"><?php echo vmText::_ ('COM_VIRTUEMART_CHECKOUT_AS_GUEST'); ?></button>
      <?php } ?>
      <button class="default" type="reset"
            onclick="window.location.href='<?php echo JRoute::_ ('index.php?option=com_virtuemart&view=' . $rview.'&task=cancel'); ?>'"><?php echo vmText::_ ('COM_VIRTUEMART_CANCEL'); ?></button>
   <?php
   }
   else {
      ?>
      <button class="<?php echo $buttonclass ?>" type="submit"
            onclick="javascript:return myValidator(userForm,true);"><?php echo vmText::_ ('COM_VIRTUEMART_SAVE'); ?></button>
      <button class="default" type="reset"
            onclick="window.location.href='<?php echo JRoute::_ ('index.php?option=com_virtuemart&view=' . $rview.'&task=cancel'); ?>'"><?php echo vmText::_ ('COM_VIRTUEMART_CANCEL'); ?></button>
   <?php } ?>
</div>
<?php
}

?>
<h1><?php echo $this->page_title ?></h1>
<?php

$task = '';
if ($this->cart->getInCheckOut()){
   //$task = '&task=checkout';
}
$url = JRoute::_ ('index.php?option=com_virtuemart&view='.$rview.$task, $this->useXHTML, $this->useSSL);

echo shopFunctionsF::getLoginForm (TRUE, FALSE, $url);

?>

<form method="post" id="userForm" name="userForm" class="form-validate" action="<?php echo JRoute::_('index.php?option=com_virtuemart&view=user',$this->useXHTML,$this->useSSL) ?>" >
<fieldset>
   <h2 style="color:#b40909;"><?php echo vmText::_ ('COM_VIRTUEMART_REGISTER_ACCOUNT'); ?>
   </h2>
   <p><?php echo vmText::_('COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_LBL');?></p>

   <!--<form method="post" id="userForm" name="userForm" action="<?php echo JRoute::_ ('index.php'); ?>" class="form-validate">-->
   
   
<?php // captcha addition
      
   // end of captcha addition

   if (!class_exists ('VirtueMartCart')) {
      require(VMPATH_SITE . DS . 'helpers' . DS . 'cart.php');
   }

   if (count ($this->userFields['functions']) > 0) {
      echo '<script language="javascript">' . "\n";
      echo join ("\n", $this->userFields['functions']);
      echo '</script>' . "\n";
   }

   echo $this->loadTemplate ('userfields');
   
   if(VmConfig::get ('reg_captcha') && JFactory::getUser()->guest == 1){
      $captcha_visible = vRequest::getVar('captcha');
      $hide_captcha = (VmConfig::get ('oncheckout_only_registered') or $captcha_visible) ? '' : 'style="display: none;"';
      ?>
      <fieldset id="recaptcha_wrapper" <?php echo $hide_captcha ?>>
         <?php if(!VmConfig::get ('oncheckout_only_registered')) { ?>
            <span class="userfields_info"><?php echo vmText::_ ('COM_VIRTUEMART_USER_FORM_CAPTCHA'); ?></span>
         <?php } ?>
         <?php
         echo $this->captcha; ?>
      </fieldset>
<?php }
   
   renderControlButtons($this,$rview);

   if ($this->userDetails->JUser->get ('id')) {
      echo $this->loadTemplate ('addshipto');
   } ?>
   <input type="hidden" name="option" value="com_virtuemart"/>
   <input type="hidden" name="view" value="user"/>
   <input type="hidden" name="controller" value="user"/>
   <input type="hidden" name="task" value="saveUser"/>
   <input type="hidden" name="layout" value="<?php echo $this->getLayout (); ?>"/>
   <input type="hidden" name="address_type" value="<?php echo $this->address_type; ?>"/>
   <?php if (!empty($this->virtuemart_userinfo_id)) {
      echo '<input type="hidden" name="shipto_virtuemart_userinfo_id" value="' . (int)$this->virtuemart_userinfo_id . '" />';
   }
   echo JHtml::_ ('form.token');
   ?>
</fieldset>
</form>
User avatar
Senior Boarder

teitbite
Mon Sep 11, 2017 5:24 pm
Reply with quote
Report this post
Hi

Looks good, can't even tell what was changed :) I'm happy You were able to figure it out. Closing this thread than.
User avatar
Moderator


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.