diff --git a/component/site/language/en-GB/en-GB.com_redshop.ini b/component/site/language/en-GB/en-GB.com_redshop.ini index 23c1b6695da..b0b9c4d71be 100755 --- a/component/site/language/en-GB/en-GB.com_redshop.ini +++ b/component/site/language/en-GB/en-GB.com_redshop.ini @@ -5,7 +5,9 @@ ; translation en-GB source redWEB Aps ; copyright com_redshop (C) 2008 - 2017 redCOMPONENT.com ; license GNU/GPL, see LICENSE.php - +COM_REDSHOP_ADDRESS_MIN_CHARACTER_LIMIT = "Your address must consist of at least 9 characters" +COM_REDSHOP_ZIPCODE_MIN_CHARACTER_LIMIT = "Enter only 9 digits without spaces" +COM_REDSHOP_CITY_MIN_CHARACTER_LIMIT = "The address is not available" COM_REDSHOP_PLEASE_ENTER_EAN_NUMBER = "Please enter EAN number" COM_REDSHOP_EAN_NUMBER = "EAN Number" COM_REDSHOP_REQUISITION_NUMBER = "Requisition Number" diff --git a/component/site/views/account_billto/view.html.php b/component/site/views/account_billto/view.html.php index 6739e6f817b..6a44b5a17c0 100644 --- a/component/site/views/account_billto/view.html.php +++ b/component/site/views/account_billto/view.html.php @@ -62,6 +62,9 @@ public function display($tpl = null) $document = JFactory::getDocument(); $document->addScriptOptions('account_billto', $accountBilltoJs); + JText::script('COM_REDSHOP_ADDRESS_MIN_CHARACTER_LIMIT'); + JText::script('COM_REDSHOP_ZIPCODE_MIN_CHARACTER_LIMIT'); + JText::script('COM_REDSHOP_CITY_MIN_CHARACTER_LIMIT'); JHtml::_('behavior.framework'); JHtml::_('redshopjquery.framework'); JHtml::_('script', 'com_redshop/jquery.validate.min.js', false, true); diff --git a/libraries/redshop/helper/extrafields.php b/libraries/redshop/helper/extrafields.php index 5a2230c9fbe..65b9caec067 100644 --- a/libraries/redshop/helper/extrafields.php +++ b/libraries/redshop/helper/extrafields.php @@ -1488,6 +1488,11 @@ public static function listAllFieldDisplay( // 12 :- Date Picker case self::TYPE_DATE_PICKER: $extraFieldValue = ($dataValue && $dataValue->data_txt) ? $dataValue->data_txt : ''; + + $format = \Redshop::getConfig()->get('DEFAULT_DATEFORMAT'); + $extraFieldValue = date($format, strtotime($extraFieldValue)); + //$extraFieldValue = date(\Redshop::getConfig()->get('DEFAULT_DATEFORMAT'), strtotime($extraFieldValue)); + $exField .= RedshopLayoutHelper::render( 'field_display.datepicker', array( diff --git a/media/com_redshop/js/redshop.registration.js b/media/com_redshop/js/redshop.registration.js index b4644cdaba3..fb7c3f26aa0 100644 --- a/media/com_redshop/js/redshop.registration.js +++ b/media/com_redshop/js/redshop.registration.js @@ -69,8 +69,9 @@ if (typeof(window['jQuery']) != "undefined") { }, address: { required: function() { - return redSHOP.RSConfig._('REQUIRED_ADDRESS') == 1 - } + return redSHOP.RSConfig._('REQUIRED_ADDRESS') == 1 || rs("#private-address").length; + }, + minlength: 9, }, vat_number: { required: function () { @@ -128,7 +129,16 @@ if (typeof(window['jQuery']) != "undefined") { }, zipcode: { zipcodeValidation: true, - required: redSHOP.RSConfig._('REQUIRED_POSTAL_CODE') == 1 ? true : false + required: redSHOP.RSConfig._('REQUIRED_POSTAL_CODE') == 1 ? true : false, + minlength: 9, + maxlength: 9, + number: true + }, + city: { + required: function() { + return redSHOP.RSConfig._('REQUIRED_CITY') == 1 || rs("#city").length; + }, + minlength: 9, }, phone: { required: function () { @@ -200,6 +210,19 @@ if (typeof(window['jQuery']) != "undefined") { number: Joomla.JText._('COM_REDSHOP_EAN_MIN_CHARACTER_LIMIT') } }, + address: { + minlength: Joomla.JText._('COM_REDSHOP_ADDRESS_MIN_CHARACTER_LIMIT') + //minlength: JText::script('COM_REDSHOP_ADDRESS_MIN_CHARACTER_LIMIT') + }, + zipcode: { + minlength: Joomla.JText._('COM_REDSHOP_ZIPCODE_MIN_CHARACTER_LIMIT'), + maxlength: Joomla.JText._('COM_REDSHOP_ZIPCODE_MIN_CHARACTER_LIMIT'), + number: Joomla.JText._('COM_REDSHOP_ZIPCODE_MIN_CHARACTER_LIMIT') + }, + city: { + minlength: Joomla.JText._('COM_REDSHOP_CITY_MIN_CHARACTER_LIMIT') + }, + /* invalidHandler: function(e,validator) { //validator.errorList contains an array of objects, where each object has properties "element" and "message". element is the actual HTML Input. for (var i=0;i0&&redSHOP.RSConfig._("REQUIRED_EAN_NUMBER")==1},minlength:13,maxlength:13,decimal:false,negative:false,number:true},email1:{email:true},email2:{required:true,equalTo:"[name=email1]:visible"},password1:{required:function(){return rs("#createaccount")&&rs("#createaccount").is(":checked")||(rs("#user_id")&&rs("#user_id").val()==0&&rs("#password1"))||(!rs("#createaccount").length&&rs("#password1").length)},minlength:5},password2:{required:function(){return rs("#createaccount")&&rs("#createaccount").is(":checked")||(rs("#user_id")&&rs("#user_id").val()==0&&rs("#password2"))||(!rs("#createaccount").length&&rs("#password2").length)},minlength:5,equalTo:"#password1"},topic:{required:"#newsletter:checked",minlength:2},zipcode:{zipcodeValidation:true,required:redSHOP.RSConfig._("REQUIRED_POSTAL_CODE")==1?true:false,minlength:9,maxlength:9,number:true},city:{required:function(){return redSHOP.RSConfig._("REQUIRED_CITY")==1||rs("#city").length},minlength:5},phone:{required:function(){return rs("input[name='phone']")&&rs("input[name='phone']").is(":visible")&&redSHOP.RSConfig._("REQUIRED_PHONE")==1}},country_code_ST:{required:function(){return rs("#div_country_st_txt")&&rs("#div_country_st_txt").is(":visible")}},phone_ST:{required:function(){return rs("input[name='phone_ST']")&&rs("input[name='phone_ST']").is(":visible")}},termscondition:{required:function(){return rs("#termscondition")&&rs("#termscondition").is(":visible")}},agree:"required"},ignore:"#adminForm input:not(:visible)",messages:{company_name:Joomla.JText._("COM_REDSHOP_PLEASE_ENTER_COMPANY_NAME"),firstname:Joomla.JText._("COM_REDSHOP_YOUR_MUST_PROVIDE_A_FIRSTNAME"),lastname:Joomla.JText._("COM_REDSHOP_YOUR_MUST_PROVIDE_A_LASTNAME"),address:Joomla.JText._("COM_REDSHOP_YOUR_MUST_PROVIDE_A_ADDRESS"),country_code:Joomla.JText._("COM_REDSHOP_PLEASE_SELECT_COUNTRY"),zipcode:Joomla.JText._("COM_REDSHOP_YOUR_MUST_PROVIDE_A_ZIP"),city:Joomla.JText._("COM_REDSHOP_YOUR_MUST_PROVIDE_A_CITY"),phone:Joomla.JText._("COM_REDSHOP_YOUR_MUST_PROVIDE_A_VALID_PHONE"),firstname_ST:Joomla.JText._("COM_REDSHOP_YOUR_MUST_PROVIDE_A_FIRSTNAME"),lastname_ST:Joomla.JText._("COM_REDSHOP_YOUR_MUST_PROVIDE_A_LASTNAME"),address_ST:Joomla.JText._("COM_REDSHOP_YOUR_MUST_PROVIDE_A_ADDRESS"),country_code_ST:Joomla.JText._("COM_REDSHOP_PLEASE_SELECT_COUNTRY"),zipcode_ST:Joomla.JText._("COM_REDSHOP_YOUR_MUST_PROVIDE_A_ZIP"),city_ST:Joomla.JText._("COM_REDSHOP_YOUR_MUST_PROVIDE_A_CITY"),phone_ST:Joomla.JText._("COM_REDSHOP_YOUR_MUST_PROVIDE_A_VALID_PHONE"),username:{required:Joomla.JText._("COM_REDSHOP_YOU_MUST_PROVIDE_LOGIN_NAME"),minlength:Joomla.JText._("COM_REDSHOP_USERNAME_MIN_CHARACTER_LIMIT"),remote:Joomla.JText._("COM_REDSHOP_USERNAME_ALREADY_EXISTS")},email1:{required:Joomla.JText._("COM_REDSHOP_PROVIDE_EMAIL_ADDRESS")},email2:{required:Joomla.JText._("COM_REDSHOP_PROVIDE_EMAIL_ADDRESS"),equalTo:Joomla.JText._("COM_REDSHOP_EMAIL_NOT_MATCH")},address:{minlength:Joomla.JText._("COM_REDSHOP_ADDRESS_MIN_CHARACTER_LIMIT")},zipcode:{minlength:Joomla.JText._("COM_REDSHOP_ZIPCODE_MIN_CHARACTER_LIMIT"),maxlength:Joomla.JText._("COM_REDSHOP_ZIPCODE_MIN_CHARACTER_LIMIT"),number:Joomla.JText._("COM_REDSHOP_ZIPCODE_MIN_CHARACTER_LIMIT")},city:{minlength:Joomla.JText._("COM_REDSHOP_CITY_MIN_CHARACTER_LIMIT")},password1:{required:Joomla.JText._("COM_REDSHOP_PLEASE_ENTER_PASSWORD"),minlength:Joomla.JText._("COM_REDSHOP_PASSWORD_MIN_CHARACTER_LIMIT")},password2:{required:Joomla.JText._("COM_REDSHOP_PLEASE_ENTER_PASSWORD"),minlength:Joomla.JText._("COM_REDSHOP_PASSWORD_MIN_CHARACTER_LIMIT"),equalTo:Joomla.JText._("COM_REDSHOP_PASSWORD_NOT_MATCH")},termscondition:Joomla.JText._("COM_REDSHOP_PLEASE_SELECT_TEMS_CONDITIONS"),agree:"Please accept our policy",ean_number:{minlength:Joomla.JText._("COM_REDSHOP_EAN_MIN_CHARACTER_LIMIT"),maxlength:Joomla.JText._("COM_REDSHOP_EAN_MIN_CHARACTER_LIMIT"),decimal:Joomla.JText._("COM_REDSHOP_EAN_MIN_CHARACTER_LIMIT"),negative:Joomla.JText._("COM_REDSHOP_EAN_MIN_CHARACTER_LIMIT"),number:Joomla.JText._("COM_REDSHOP_EAN_MIN_CHARACTER_LIMIT")}},focusInvalid:false,invalidHandler:function(d,c){if(!c.numberOfInvalids()){return}rs("html").animate({scrollTop:rs(c.errorList[0].element).offset().top},200)}});rs("#username").focus(function(){var d=rs("#firstname").val();var c=rs("#lastname").val();if(d&&c&&!this.value){this.value=d+"."+c}});rs.validator.addMethod("billingRequired",function(d,c){if(rs("#billisship").is(":checked")){return rs(c).parents(".subTable").length}return !this.optional(c)},"")})}; \ No newline at end of file