VirtueMart Forum

VirtueMart 2 + 3 + 4 => Plugins: Payment, Shipment and others => Topic started by: Robert V. on July 19, 2012, 00:38:13 AM

Title: Billing / Shipping addres save and cancel buttons to bottom
Post by: Robert V. on July 19, 2012, 00:38:13 AM
the vm-button-correct and the cancel (button.default) button (both control-buttons class) are on the top of the editaddresscartBT/ editaddresscartST pages, which often means that people have to scroll UP after filling in the user form.
This is confusing for most people. They tend to scroll down, not up.

Is there a way to get these buttons at the BOTTOM of these pages?

Please help

Hope to hear.


Title: Re: Billing / Shipping addres save and cancel buttons to bottom
Post by: Robert V. on July 19, 2012, 16:53:53 PM
found it:

It's in the components/com_virtuemart/views/user/templ/edit_address.php

Move the control-button class (bold div) to the end of the fieldset and the buttons are at the bottom of the billing and shipping address pages

Quote<fieldset>
    <h2><?php
if ($this->address_type == 'BT') {
    echo JText::_('COM_VIRTUEMART_USER_FORM_EDIT_BILLTO_LBL');
} else {
    echo JText::_('COM_VIRTUEMART_USER_FORM_ADD_SHIPTO_LBL');
}
?>
    </h2>


    <form method="post" id="adminForm" name="userForm" class="form-validate">
    <!--<form method="post" id="userForm" name="userForm" action="<?php echo JRoute::_('index.php'); ?>" class="form-validate">-->
   
       <?php
       if (!class_exists('VirtueMartCart'))
      require(JPATH_VM_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');

     ?>

        <div class="control-buttons">
       <?php
       if (strpos($this->fTask, 'cart') || strpos($this->fTask, 'checkout')) {
      $rview = 'cart';
       } else {
      $rview = 'user';
       }
           // echo 'rview = '.$rview;

       if (strpos($this->fTask, 'checkout') || $this->address_type == 'ST') {
      $buttonclass = 'default';
       } else {
      $buttonclass = 'button vm-button-correct';
       }


       if (VmConfig::get('oncheckout_show_register', 1) && $this->userId == 0 && !VmConfig::get('oncheckout_only_registered', 0) && $this->address_type == 'BT' and $rview == 'cart') {
      echo JText::sprintf('COM_VIRTUEMART_ONCHECKOUT_DEFAULT_TEXT_REGISTER', JText::_('COM_VIRTUEMART_REGISTER_AND_CHECKOUT'), JText::_('COM_VIRTUEMART_CHECKOUT_AS_GUEST'));
       } else {
      //echo JText::_('COM_VIRTUEMART_REGISTER_ACCOUNT');
       }
       if (VmConfig::get('oncheckout_show_register', 1) && $this->userId == 0 && $this->address_type == 'BT' and $rview == 'cart') {
      ?>

           <button class="<?php echo $buttonclass ?>" type="submit" onclick="javascript:return callValidatorForRegister(userForm);" title="<?php echo JText::_('COM_VIRTUEMART_REGISTER_AND_CHECKOUT'); ?>"><?php echo JText::_('COM_VIRTUEMART_REGISTER_AND_CHECKOUT'); ?></button>
           <?php if (!VmConfig::get('oncheckout_only_registered', 0)) { ?>
          <button class="<?php echo $buttonclass ?>" title="<?php echo JText::_('COM_VIRTUEMART_CHECKOUT_AS_GUEST'); ?>" type="submit" onclick="javascript:return myValidator(userForm, '<?php echo $this->fTask; ?>');" ><?php echo JText::_('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); ?>'" ><?php echo JText::_('COM_VIRTUEMART_CANCEL'); ?></button>


           <?php } else { ?>

           <button class="<?php echo $buttonclass ?>" type="submit" onclick="javascript:return myValidator(userForm, '<?php echo $this->fTask; ?>');" ><?php echo JText::_('COM_VIRTUEMART_SAVE'); ?></button>
           <button class="default" type="reset" onclick="window.location.href='<?php echo JRoute::_('index.php?option=com_virtuemart&view=' . $rview); ?>'" ><?php echo JText::_('COM_VIRTUEMART_CANCEL'); ?></button>

           <?php } ?>
   </div>

</fieldset>