- Posts: 5
- Thank you received: 0
Check-out page login form validation issue
11 years 8 months ago - 11 years 8 months ago #191955
by rajaswin
Check-out page login form validation issue was created by rajaswin
-- HikaShop version -- : 2.3.5
-- Joomla version -- : 3.3.6
Hi,
Check-out page login form validation isn't working, when we submit form without giving username/password, form submits without showing any warning message. We tried adding HTML5 required attribute but that doesn't work as well. Please advice.
Thanks!!
-- Joomla version -- : 3.3.6
Hi,
Check-out page login form validation isn't working, when we submit form without giving username/password, form submits without showing any warning message. We tried adding HTML5 required attribute but that doesn't work as well. Please advice.
Thanks!!
Last edit: 11 years 8 months ago by rajaswin.
Please Log in or Create an account to join the conversation.
11 years 8 months ago #192002
by nicolas
Replied by nicolas on topic Check-out page login form validation issue
Hi,
The check is done on the PHP side and there should be an error message displayed on the page telling you that the password was empty on the page reload.
If you don't see it, it could be that your Joomla template is not displaying messages:
www.hikashop.com/support/support/documen...tibility-issues.html
The check is done on the PHP side and there should be an error message displayed on the page telling you that the password was empty on the page reload.
If you don't see it, it could be that your Joomla template is not displaying messages:
www.hikashop.com/support/support/documen...tibility-issues.html
Please Log in or Create an account to join the conversation.
11 years 8 months ago #192020
by rajaswin
Replied by rajaswin on topic Check-out page login form validation issue
This is your demo page,
demo.hikashop.com/index.php/en/hikashop/...checkout/step/step-2
Add a product to cart and goto checkout login page, don't give username/password, it just submits form but doesn't show any warning.
demo.hikashop.com/index.php/en/hikashop/...checkout/step/step-2
Add a product to cart and goto checkout login page, don't give username/password, it just submits form but doesn't show any warning.
Please Log in or Create an account to join the conversation.
11 years 8 months ago - 11 years 8 months ago #192048
by Xavier
Replied by Xavier on topic Check-out page login form validation issue
Hi,
To display a message when the login/password fields are empty, you can potentially edit the file "components/com_hikashop/controllers/checkout.php" and replace the function "after_login()" by:
To display a message when the login/password fields are empty, you can potentially edit the file "components/com_hikashop/controllers/checkout.php" and replace the function "after_login()" by:
Code:
function after_login($success){
$user = JFactory::getUser();
$status = true;
$app = JFactory::getApplication();
$user_id=$app->getUserState( HIKASHOP_COMPONENT.'.user_id' );
global $messDisplay;
if(is_null($messDisplay)) $messDisplay = 0;
else $messDisplay = 1;
if(!$this->cart_update && $user->guest && empty($user_id)){
JPluginHelper::importPlugin('user');
$register=JRequest::getString('register','');
$action = JRequest::getString('login_view_action','');
if($action=='register' || ($action!='login' && !empty($register))){
$status = $this->_doRegister();
}else{
$login=JRequest::getString('login','');
if($action=='login' || !empty($login)){
$status = $this->_doLogin();
}else{
$name = @$_REQUEST['data']['register']['email'];
$username = JRequest::getVar('username', '', 'request', 'username');
if(!empty($name)){
$status = $this->_doRegister();
}elseif(!empty($username)){
$status = $this->_doLogin();
}elseif(empty($name) && empty($username) && $messDisplay == 0){
$app->enqueueMessage('PLEASE_FILL_LOGIN_FIELDS');
}
}
}
if($status){
if($this->_getStep('address',$this->previous)!==false || $this->_getStep('confirm',(int)$this->previous)===(int)$this->previous){
$status = false;
}
//try to auto select the address. If the address was selected and that the address is on the same step as the login, stay on the same page
if(!$this->before_address()){
$status = false;
}
//try to auto select the shipping if the shipping view is not on the same step or if the address has been auto selected
if(!$status || $this->_getStep('shipping', $this->previous) !== false) {
$this->before_shipping();
}
$this->before_login();
}
}
return $status;
}
Last edit: 11 years 8 months ago by Xavier.
Please Log in or Create an account to join the conversation.
Time to create page: 0.056 seconds