User Registration TOS link + Layout (Register link @ bottom page end of form)

Started by lipes, March 02, 2012, 03:57:42 AM

Previous topic - Next topic

lipes

in this area we could see  http://virtuemart.cloudaccess.net/my-account

my suggestion is to put in the bottom the Register and Cancel buttons:

Please, in some next release add this fix in user registration area

\components\com_virtuemart\views\user\tmpl\edit.php
http://www.2shared.com/file/wfCFN-TP/edit.html
and in \components\com_virtuemart\views\user\tmpl\edit_shopper.php
http://www.2shared.com/file/CxpaBlM2/edit_shopper.html

I dont know how to add a Link at side of the check box to users could read and accept "I agree to the Terms of Service"... (like in VM1) in some countries this is required by law law.. i've been searching and found this code:
<span class="terms-of-service" rel="facebox"><span class="vmicon vm2-termsofservice-icon"></span><?php echo JText::_('COM_VIRTUEMART_CART_TOS_READ_AND_ACCEPTED'); ?><span class="vm2-modallink"></span></span>
<div id="full-tos">
<h2><?php echo JText::_('COM_VIRTUEMART_CART_TOS'); ?></h2>
<?php echo $this->cart->vendor->vendor_terms_of_service;?>

</div>

but i dont know how to apply this ... If someone could help me we could do some quick fixes, this time in this user registration area ... and contribute to VM2 too!
Unfortunately while delaying this correction we have to add these changes every time there is a new VM update :(:(:( :'(
Best Regards..
VM V. online: J2.5.14 | VM 2.0.20a | SQL 5.1.70 | PHP 5.3.25

lipes



Someone can help me in this post finding a way to apply the Terms of service in the User Registration Form? Please ..
The popup open and works!! But there is no Text!!  ::)   and users cant read .. they can only see white color  ;D

localhost/components/com_virtuemart/views/user/tmpl/ edit_shopper.php (file)

<?php
/**
 *
 * Modify user form view, User info
 *
 * @package VirtueMart
 * @subpackage User
 * @author Oscar van Eijk
 * @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_shopper.php 5401 2012-02-09 08:48:52Z alatak $
 */

// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');
JHTML::script('facebox.js''components/com_virtuemart/assets/js/'false);
JHTML::stylesheet('facebox.css''components/com_virtuemart/assets/css/'false);

JHtml::_('behavior.formvalidation');
$document JFactory::getDocument();
$document->addScriptDeclaration("
jQuery(document).ready(function($) {
$('div#full-tos').hide();
$('span.terms-of-service').click( function(){
//$.facebox({ span: '#full-tos' });
$.facebox( { div: '#full-tos' }, 'my-groovy-style');
});
});
"
);
$document->addStyleDeclaration('#facebox .content {display: block !important; height: 480px !important; overflow: auto; width: 560px !important; }');
 
vmdebug('cart cartData',$this->cart->cartData);
?>


<?php if( $this->userDetails->virtuemart_user_id!=0)  {
    echo 
$this->loadTemplate('vmshopper');
    } 
?>

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



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

<div class="terms-of-service">
<span class="terms-of-service" rel="facebox"><span class="vmicon vm2-termsofservice-icon"></span><?php echo JText::_('COM_VIRTUEMART_CART_TOS_READ_AND_ACCEPTED'); ?><span class="vm2-modallink"></span></span>
<div id="full-tos">
<h2><?php echo JText::_('COM_VIRTUEMART_CART_TOS'); ?></h2>
<?php echo $this->cart->vendor->vendor_terms_of_service;?>

</div>
</div>
<?php if(!$this->userDetails->user_is_vendor){ ?>
<div class="buttonBar-right">
<button class="button" type="submit" onclick="javascript:return myValidator(userForm, 'saveuser');" ><?php echo $this->button_lbl ?></button>
</div>
<?php ?>


<input type="hidden" name="virtuemart_userinfo_id" value="<?php echo $this->virtuemart_userinfo_id?>" />
<input type="hidden" name="address_type" value="BT" />


This is to aply with index.php?option=com_virtuemart&view=user

PS: I remove the "cancel" because I think that No One needs a "cancel" button in registration area... Users if dont want to register they leave the page or the website...
They dont hit "cancel" to leave or restart filling the fields (all fields wrong?)..  .They'll edit a field if anything was wrong...
2 steps to do 1 thing...  xD
VM V. online: J2.5.14 | VM 2.0.20a | SQL 5.1.70 | PHP 5.3.25

lipes

Please some help here to finish!!  POPUP LINK WORKS... BUT NO Terms of Service TEXT!
I want to change the default cart call of text TOS popup
here: echo VmHtml::checkbox('tosAccepted',$this->cart->tosAccepted,1,0,'class="terms-of-service"');
and: <?php echo $this->cart->vendor->vendor_terms_of_service; ?>


To be possible call the TOS text popup in User Registration Area (index.php?option=com_virtuemart&view=user&layout=edit)
<?php echo $this->user->vendor->vendor_terms_of_service; ?>  ? ? ? ??? But doesnt work..
i tryed to do some experience changes but nothing works :/   what i need to do to solve this problem?

I have this code in my file com_virtuemart/user/edit.php:
<?php
// Check to ensure this file is included in Joomla!
defined('_JEXEC') or die('Restricted access');

//AdminMenuHelper::startAdminArea();
// vmdebug('User edit',$this);
// Implement Joomla's form validation
JHTML::_('behavior.formvalidation');
$document JFactory::getDocument();
$document->addScriptDeclaration("
jQuery(document).ready(function($) {
$('div#full-tos').hide();
$('span.terms-of-service').click( function(){
//$.facebox({ span: '#full-tos' });
$.facebox( { div: '#full-tos' }, 'my-groovy-style');
});
});
"
);
$document->addStyleDeclaration('#facebox .content {display: block !important; height: 480px !important; overflow: auto; width: 560px !important; }');
JHTML::stylesheet('vmpanels.css'JURI::root().'components/com_virtuemart/assets/css/'); // VM_THEMEURL
JHTML::stylesheet('facebox.css''components/com_virtuemart/assets/css/'false);
JHTML::script('facebox.js''components/com_virtuemart/assets/js/'false);
?>

<style type="text/css">
.invalid {
border-color: #f00;
background-color: #ffd;
color: #000;
}
label.invalid {
background-color: #fff;
color: #f00;
}
</style>
<script language="javascript">
function myValidator(f, t)
{
f.task.value=t;

if (f.task.value=='cancel') {
//f.submit();
return true;
}
if (document.formvalidator.isValid(f)) {
f.submit();
return true;
} else {
var msg = '<?php echo addslashesJText::_('COM_VIRTUEMART_USER_FORM_MISSING_REQUIRED_JS') ); ?>';
alert (msg);
}
return false;
}
</script>
<h2><?php if($this->userDetails->virtuemart_user_id==0) {
echo JText::_('COM_VIRTUEMART_YOUR_ACCOUNT_REG');
}
?>
</h2>

<form method="post" id="adminForm" name="userForm" action="<?php echo JRoute::_('index.php?view=user',$this->useXHTML,$this->useSSL?>" class="form-validate">
<?php // Loading Templates in Tabs
if($this->userDetails->virtuemart_user_id!=0) {
    
$tabarray = array();
    if(
$this->userDetails->user_is_vendor){
    $tabarray['vendor'] = 'COM_VIRTUEMART_VENDOR';
    }
    
$tabarray['shopper'] = 'COM_VIRTUEMART_SHOPPER_FORM_LBL';
    
//$tabarray['user'] = 'COM_VIRTUEMART_USER_FORM_TAB_GENERALINFO';
    
if (!empty($this->shipto)) {
    $tabarray['shipto'] = 'COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL';
    }
    if ((
$_ordcnt count($this->orderlist)) > 0) {
    $tabarray['orderlist'] = 'COM_VIRTUEMART_YOUR_ORDERS';
    }


    
shopFunctionsF::buildTabs ($tabarray);

 } else {
    echo 
$this->loadTemplate 'shopper' );
 }

/*
 * TODO this Stuff should be converted in a payment module. But the idea to show already saved payment information to the user is a good one
 * So maybe we should place here a method (joomla plugin hook) which loads all published plugins, which already used by the user and display
 * them.
 */
// echo $this->pane->startPanel( JText::_('COM_VIRTUEMART_SHOPPER_PAYMENT_FORM_LBL'), 'edit_payment' );
// echo $this->loadTemplate('payment');
// echo $this->pane->endPanel();

// echo $this->pane->startPanel( JText::_('COM_VIRTUEMART_SHOPPER_SHIPMENT_FORM_LBL'), 'edit_shipto' );
// echo $this->loadTemplate('shipto');
// echo $this->pane->endPanel();
// if ($this->shipto !== 0) {
// // Note:
// // Of the order of the tabs change here, change the startOffset value for
// // JPane::getInstance() as well in view.html.php!
// echo $this->pane->startPanel( JText::_('COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL'), 'edit_shipto' );
// echo $this->loadTemplate('shipto');
// echo $this->pane->endPanel();
// }

//  if (($_ordcnt = count($this->orderlist)) > 0) {
//  echo $this->pane->startPanel( JText::_('COM_VIRTUEMART_ORDER_LIST_LBL') . ' (' . $_ordcnt . ')', 'edit_orderlist' );
//  echo $this->loadTemplate('orderlist');
//  echo $this->pane->endPanel();
//  }

//  if (!empty($this->userDetails->user_is_vendor)) {
//  echo $this->pane->startPanel( JText::_('COM_VIRTUEMART_VENDOR_MOD'), 'edit_vendor' );
//  echo $this->loadTemplate('vendor');
//  echo $this->pane->endPanel();
//  }

//  echo $this->pane->endPane();
?>

<input type="hidden" name="option" value="com_virtuemart" />
<input type="hidden" name="controller" value="user" />
<input type="hidden" name="task" value="" />
<?php if($this->userDetails->user_is_vendor){ ?>
    <div class="buttonBar-right">
<button class="button" type="submit" onclick="javascript:return myValidator(userForm, 'saveuser');" ><?php echo $this->button_lbl ?></button>
    <?php ?>
<?php echo JHTML::_'form.token' ); ?>

</form>
</div>


<?php // Terms Of Service Checkbox
if (!class_exists('VirtueMartModelUserfields')){
require(JPATH_VM_ADMINISTRATOR DS 'models' DS 'userfields.php');
}
$userFieldsModel VmModel::getModel('userfields');
if($userFieldsModel->getIfRequired('agreed')){
    ?>

    <label for ="tosAccepted">
<?php
                    
if(!class_exists('VmHtml'))require(JPATH_VM_ADMINISTRATOR.DS.'helpers'.DS.'html.php');
                    echo 
VmHtml::checkbox('tosAccepted',$this->cart->tosAccepted,1,0,'class="terms-of-service"');
                    if(
VmConfig::get('oncheckout_show_legal_info',1)){
                    
?>

                    <div class="terms-of-service">
                    <span class="terms-of-service" rel="facebox">
                        <span class="vmicon vm2-termsofservice-icon"></span>
                        <?php echo JText::_('COM_VIRTUEMART_CART_TOS_READ_AND_ACCEPTED'); ?>
                        <span class="vm2-modallink"></span>
                    </span>
                        <div id="full-tos">
                        <?php echo $this->user->vendor->vendor_terms_of_service?>
                        </div>
          </label>
          <?php }} ?>
VM V. online: J2.5.14 | VM 2.0.20a | SQL 5.1.70 | PHP 5.3.25