Tabbed Login/Register form

4 years 5 months ago
Posts: 32
More
Topic Author
Tabbed Login/Register form #1183
If you wants tabbed login/register feature in the user account maintanance should do this:
go to
[YOUR_THEME_NAME]/html/com_virtuemart/themes/default/user/edit_start.php
1. make copy/backup about this file
2. at line 52. insert this
<!-- This is the tabbed navigation containing the toggling elements -->
<ul class="uk-tab" data-uk-tab="{connect:'#vm-login-register-switcher', animation: 'fade'}">
    <li><a href="#"><?php echo JText::_('COM_VIRTUEMART_ORDER_CONNECT_FORM'); ?></a></li>
    <li class="uk-disabled"><a href="#"><?php echo JText::_('VMUIKIT_LOGIN_OR_REGISTER'); ?></a></li>
    <li><a href="#"><?php echo JText::_('COM_VIRTUEMART_YOUR_ACCOUNT_REG'); ?></a></li>
</ul>

3. after this insert this
<!-- This is the container of the content items -->
<ul id="my-id" class="uk-switcher">
    <li></li>
<li></li>
<li></li>
</ul>

4. search for this
<?php // Output Login Form
echo shopFunctionsF::getLoginForm(false); ?>
and cut this code in the first <li>

5. search for the form with id adminForm and cut the form in the third <li>

Now, your file should look like this:
<?php // no direct access
defined('_JEXEC') or die;

/**
 * Theme: VirtueMart Theme
 *
 * @package 	    FrontEnd / Template
 * @author 		    MoWebSo.com / Eugen Stranz
 * @copyright       (C) 2009 - 2013 ENYtheme e.K.
 * @license		    GNU/GPLv2 http://www.gnu.org/licenses/gpl-2.0.html
 */


// Include The MoWebSo Library
jimport('mowebso.joomla.thirdparty.virtuemart');
$mowebso = MoWebSoVirtuemart::getInstance();


// Load Template CSS
// $mowebso->loadTemplateCSS('checkout/emptycart');

JHTML::_('behavior.formvalidation');
JHTML::stylesheet('vmpanels.css', JURI::root().'components/com_virtuemart/assets/css/'); // VM_THEMEURL
?>

<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 (document.formvalidator.isValid(f)) {
            f.submit();
            return true;
        } else {
            var msg = '<?php echo addslashes( JText::_('COM_VIRTUEMART_USER_FORM_MISSING_REQUIRED_JS') ); ?>';
            alert (msg);
        }
        return false;
    }
</script>

<!-- This is the tabbed navigation containing the toggling elements -->
<ul class="uk-tab" data-uk-tab="{connect:'#vm-login-register-switcher', animation: 'fade'}">
    <li><a href="#"><?php echo JText::_('COM_VIRTUEMART_ORDER_CONNECT_FORM'); ?></a></li>
    <li class="uk-disabled"><a href="#"><?php echo JText::_('VMUIKIT_LOGIN_OR_REGISTER'); ?></a></li>
    <li><a href="#"><?php echo JText::_('COM_VIRTUEMART_YOUR_ACCOUNT_REG'); ?></a></li>
</ul>

<!-- This is the container of the content items -->
<ul id="vm-login-register-switcher" class="uk-switcher uk-margin">
    <li><?php // Output Login Form
        echo shopFunctionsF::getLoginForm(false); ?>
    </li>
    <li></li>
    <li>
        <form method="post" id="adminForm" name="userForm" action="<?php echo JRoute::_('index.php?view=user',$this->useXHTML,$this->useSSL) ?>" class="form-validate uk-form uk-margin-top">
            <?php // Output Section Start
            $mowebso->buildSectionStart(true); ?>

            <h3 class="uk-h3"><?php echo $this->page_title ?></h3>


            <?php if($this->userDetails->virtuemart_user_id==0) {
//	echo JText::_('COM_VIRTUEMART_YOUR_ACCOUNT_REG');
            }?>



            <?php if($this->userDetails->user_is_vendor){ ?>

            <?php } ?>

            <?php // Loading Templates in Tabs
            if($this->userDetails->virtuemart_user_id!=0) { ?>

                <?php
                if(!empty($this->add_product_link)) {
                    // echo $this->add_product_link;
                }
                ?>

                <?php if(!$this->userDetails->user_is_vendor){ ?>
                    <div class="button-area uk-width-1-1">
                        <div class="spacer">
                            <button class="uk-button uk-button-success" type="submit" onclick="javascript:return myValidator(userForm, 'saveuser');" ><?php echo $this->button_lbl ?></button>
                            <button class="uk-button" type="submit" onclick="javascript:return myValidator(userForm, 'cancel');" ><?php echo JText::_('COM_VIRTUEMART_CANCEL'); ?></button>
                        </div>
                    </div>
                <?php } ?>

                <?php // Load Template: Login Form
                if( $this->userDetails->virtuemart_user_id!=0)  {
                    echo $this->loadTemplate('vmshoppper');
                }

                // Load Template: Userfields
                echo $this->loadTemplate('address_userfields');

                ?>
                <?php
                $mowebso->buildSectionEnd();

                echo '<div class="uk-margin-top">';
                $mowebso->buildSectionStart();

                ?>
                <h3 class="uk-h3"><?php echo JText::_('COM_VIRTUEMART_USER_FORM_SHIPTO_LBL') ?></h3>

                <div class="add-ship-to">
                    <div class="spacer">
                        <?php echo $this->lists['shipTo']; ?>
                    </div>
                </div>
                <?php
                $mowebso->buildSectionEnd();

                echo '<div class="uk-margin-top">';
                $mowebso->buildSectionStart();

                ?>

                <?php
                // Load Template: Login Form
                if($this->userDetails->user_is_vendor){
                    echo $this->loadTemplate('vendor');
                }
                ?>

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

                <input type="hidden" value="saveUser" name="task">
                <input type="hidden" value="BT" name="address_type">

<?php
// 	    if (($_ordcnt = count($this->orderlist)) > 0) {
// 		    $tabarray['orderlist'] = 'COM_VIRTUEMART_YOUR_ORDERS';
// 	    }

            } else { ?>


                <?php

                // Load Template: Login Form
                if( $this->userDetails->virtuemart_user_id!=0)  {
                    echo $this->loadTemplate('vmshoppper');
                }

                // Load Template: Userfields
                echo $this->loadTemplate('address_userfields');
                ?>
                <?php
                $mowebso->buildSectionEnd();
                ?>
                <div class="button-area uk-margin-top">
                    <div class="spacer">
                        <button class="uk-button uk-button-success" type="submit" onclick="javascript:return myValidator(userForm, 'saveUser');" ><?php echo $this->button_lbl ?></button>
                        <button class="uk-button" type="reset" onclick="window.location.href='<?php echo JRoute::_('index.php?option=com_virtuemart&view=user', FALSE); ?>'" ><?php echo JText::_('COM_VIRTUEMART_CANCEL'); ?></button>
                    </div>
                </div>

                <?php
                echo '<div class="uk-margin-top">';
                $mowebso->buildSectionStart();

                ?>
                <h3 class="uk-h3"><?php echo JText::_('COM_VIRTUEMART_USER_FORM_SHIPTO_LBL') ?></h3>

                <div class="add-ship-to">
                    <div class="spacer">
                        <?php echo $this->lists['shipTo']; ?>
                    </div>
                </div>




                <?php // Output A Hidden Field
                if(!empty($this->virtuemart_userinfo_id)){
                    echo '<input type="hidden" name="virtuemart_userinfo_id" value="'.(int)$this->virtuemart_userinfo_id.'" />';
                } ?>
                <input type="hidden" name="task" value="<?php echo $this->fTask; // I remember, we removed that, but why?   ?>" />
                <input type="hidden" name="address_type" value="BT" />

            <?php } ?>

            <input type="hidden" name="option" value="com_virtuemart" />
            <input type="hidden" name="controller" value="user" />
            <?php echo JHTML::_( 'form.token' );
            echo "</div>";
            $mowebso->buildSectionEnd();

            ?>
        </form>

    </li>
</ul>

The following user(s) said Thank You cnorin

Please Log in or Create an account to join the conversation.

Time to create page: 0.058 seconds
Powered by Kunena Forum

Latest News from JoomlaPro.com

VMuikit 5 is finally out!

Our next version of our popular VMuikit package is out. This time we have some quite nice new features.

Electroneum Joomla/VirtueMart plugins

JoomlaPro.com are not only web & Joomla enthusiast, we cannot stay away from checking other tech trends as well. The last few years its been hard to miss the crypto/blockchain ...

New plugin: Secure Joomla Login

We have released a new plugin that adds a extra PIN code and a reCaptcha v2 check on Joomlas login. Security is very important on all fronts of a website. One often missed one is ...

We accept PayPal, 2Checkout & Electroneum payments:

We accept PayPal payments    We accept 2checkout payments  electroneum payment


For news and updates please like :