How to reposition "Create account" for optional registration

If you are runnig Joomla 3.x and Virtuemart 3.x please post to this forum your questions or support tickets about One Page Checkout

How to reposition "Create account" for optional registration

Postby loppan » Thu Jun 10, 2021 11:48 pm

Hi Stan, hope all is well!

I'd like to move the "Create account" checkbox with its password fields to the bottom of the "ship-to" section.

I've set opc to "Optional registration" and If I'm not mistaken, I had the checkbox further down before, but it's possible I screwed it up when changing settings / re-ordering shopper fields, etc, who knows :). And I can't remember what config decides where this checkbox is displayed (if there even is a config for it).

Please see the attached screenshot - for my purposes, it would make more sense to put "Create account" on the bottom of that page (under the Phone-field) - and if customer decides to click it, the last thing customer will have to do is to enter their password.

I had a sneak peak at overrides/list_user_fields.tpl.php, but changing stuff in there seems too risky (at least without guidance), as my php skills as quite limited :).

Truly grateful for your advice as always!

Thanks

Best wishes

Peter
Attachments
ca.png
ca.png (22.61 KiB) Viewed 117 times
loppan
 
Posts: 23
Joined: Thu Oct 27, 2016 7:26 am

Re: How to reposition "Create account" for optional registration

Postby admin » Fri Jun 11, 2021 10:45 am

hello, the create account is part of the registration area which can be adjusted not to include "name" or "username" or "email"

to move whole registration area (usually address name (can be hidden) + username + email (optionally can be as part of BT) + password + password2 (can be disalbed for special purpose) you might want to adjust:

onepage.unlogged.tpl.php

and move

<?php
if (!empty($registration_html))
{
?>
<h4><?php echo OPCLang::_('COM_VIRTUEMART_YOUR_ACCOUNT_REG') ?> </h4>
<?php
echo $registration_html;
}

?>

anywhere within the onepage.unlogged.tpl.php

how the list_user_fields.tpl.php works:
- these are wrappers for BT/ST/registration/RD or other field renderers and wrappers

to further adjust:
list_user_fields.tpl.php (is fallback of some of the below files are not found in the template)
list_user_fields_shipping.tpl.php (renders editable ST fields )
list_user_fields_registration.tpl.php (renders opc registration override page )

the file list_user_fields.tpl.php is called 3x in a normal non-logged checkout:
1. registration are with the above username+password fields
2. BT address rendering
3. ST address rendering

so if you want to move the registration from 1st to 3rd you might need to use some global variables to store the output and send it to the third one. (but i would suggest to do this in onepage.unlogged.tpl.php wrapper if possible ) since editable ST is very tricky in OPC as it might not show as editble for logged in user while it does show when you clic "edit" at FE.

best regards, stan
admin
Site Admin
 
Posts: 2648
Joined: Wed Jan 06, 2010 11:43 pm


Return to One Page Checkout for Virtuemart 3 on Joomla 3.x

cron