Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion component/site/language/en-GB/en-GB.com_redshop.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions component/site/views/account_billto/view.html.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
5 changes: 5 additions & 0 deletions libraries/redshop/helper/extrafields.php
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
29 changes: 26 additions & 3 deletions media/com_redshop/js/redshop.registration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down Expand Up @@ -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,
Copy link
Contributor

@Rmh1978 Rmh1978 Jul 13, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is wrong. In Denmark we use 4 digits zip code.

@lunguyenhat

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it should get the value from configurations, not the hard code here @Rmh1978

maxlength: 9,
number: true
},
city: {
required: function() {
return redSHOP.RSConfig._('REQUIRED_CITY') == 1 || rs("#city").length;
},
minlength: 9,
},
phone: {
required: function () {
Expand Down Expand Up @@ -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;i<validator.errorList.length;i++){
Expand Down
2 changes: 1 addition & 1 deletion media/com_redshop/js/redshop.registration.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.