- Posts: 141
- Thank you received: 3
Problem with guest form validation.
7 years 1 week ago #311784
by Greg_C
Problem with guest form validation. was created by Greg_C
-- HikaShop version -- : 4.2.1
-- Joomla version -- : 3.9.12
-- PHP version -- : 7.2.14
Hello, I have found a problem in checkout process with proper presentation of TAX number field related with following settings:
TAX number field - defined in custom field as required for Companies and not required for Individuals.
Buyer field – defined in custom field either as Radio Button or as Checkbox
The problem appears when and you try to accept checkout guest form for Companies without filling in Tax number field: there is a warning “Please complete the VAT number field” but Tax number field disappears from the form (Company Name is also disappear and Ordering Person Data also – so I think that the form "switching" data as required for Individual and not for the Company) – it is becoming visible again only when you change Buyer from Company to Individual and back again to Company.
However this improper situation doesn’t appear when you set Buyer field as Single Dropdown In custom field parameters – but I would like to use for the Buyer field either Radio Button or Checkbox
I would like to ask for a hint how to solve this problem.
I have tested this situation also on Prostar template and I think you shouldn't have problem to reproduce this scenario on your end.
Regards,
Greg
-- Joomla version -- : 3.9.12
-- PHP version -- : 7.2.14
Hello, I have found a problem in checkout process with proper presentation of TAX number field related with following settings:
TAX number field - defined in custom field as required for Companies and not required for Individuals.
Buyer field – defined in custom field either as Radio Button or as Checkbox
The problem appears when and you try to accept checkout guest form for Companies without filling in Tax number field: there is a warning “Please complete the VAT number field” but Tax number field disappears from the form (Company Name is also disappear and Ordering Person Data also – so I think that the form "switching" data as required for Individual and not for the Company) – it is becoming visible again only when you change Buyer from Company to Individual and back again to Company.
However this improper situation doesn’t appear when you set Buyer field as Single Dropdown In custom field parameters – but I would like to use for the Buyer field either Radio Button or Checkbox
I would like to ask for a hint how to solve this problem.
I have tested this situation also on Prostar template and I think you shouldn't have problem to reproduce this scenario on your end.
Regards,
Greg
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
7 years 6 days ago #311791
by Mohamed Thelji
Replied by Mohamed Thelji on topic Problem with guest form validation.
Hello Greg,
Can you show us some screenshots of
- How you configured your checkout "Hikashop->System->Configuration->Checkout"
- The issue you are having
So that we can also reproduce it on our end ?
Best regards,
Mohamed Thelji.
Can you show us some screenshots of
- How you configured your checkout "Hikashop->System->Configuration->Checkout"
- The issue you are having
So that we can also reproduce it on our end ?
Best regards,
Mohamed Thelji.
Please Log in or Create an account to join the conversation.
7 years 6 days ago #311834
by Greg_C
Replied by Greg_C on topic Problem with guest form validation.
Hi Mohamed, ok, please find below screenshots
1. Configuration – checkout
2. Custom Field – address_vat_company
3. Custom Field – Buyer
4. Form – all required data filled in except VAT number – before Next button is submitted
5. Form – after Next button is submitted – Error Message to complete the VAT number Field but VAT number (and Company Name is not Visible) – in fact only fields, which are linked to Individual Buyer are visible
6. Form – after change Buyer from Company to Individual and back again to Company
Regards,
Greg
1. Configuration – checkout
2. Custom Field – address_vat_company
3. Custom Field – Buyer
4. Form – all required data filled in except VAT number – before Next button is submitted
5. Form – after Next button is submitted – Error Message to complete the VAT number Field but VAT number (and Company Name is not Visible) – in fact only fields, which are linked to Individual Buyer are visible
6. Form – after change Buyer from Company to Individual and back again to Company
Regards,
Greg
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
7 years 5 days ago #311849
by Mohamed Thelji
Replied by Mohamed Thelji on topic Problem with guest form validation.
Hello Greg,
Thank you for your feedback, here is a quick fix that you can test on your end, you'll just have to edit the "\media\com_hikashop\js\hikashop.js" file and change these lines :
by :
Kind regards,
Mohamed Thelji.
Thank you for your feedback, here is a quick fix that you can test on your end, you'll just have to edit the "\media\com_hikashop\js\hikashop.js" file and change these lines :
Code:
if( new_value === null) {
if(d.getElementById(type + namekey))
new_value = d.getElementById(type + namekey).value;
else {
inputs = d.getElementsByName('data['+field_type+']['+namekey+']');
for(var i = inputs.length - 1; i >= 0; i--) {
if(inputs[i].checked)
new_value = inputs[i].value;
}
}
}
by :
Code:
if( new_value === null) {
if(d.getElementById(type + namekey))
new_value = d.getElementById(type + namekey).value;
else {
inputs = d.getElementsByName('data['+field_type+']['+namekey+']');
if(!inputs.length) {
var row = d.getElementById( prefix + field_type + '_' + namekey );
if(row) {
inputs = row.getElementsByTagName('input');
}
}
if(inputs.length) {
for(var i = inputs.length - 1; i >= 0; i--) {
if(inputs[i].checked)
new_value = inputs[i].value;
}
}
}
}
Kind regards,
Mohamed Thelji.
The following user(s) said Thank You: Greg_C
Please Log in or Create an account to join the conversation.
7 years 5 days ago #311881
by Greg_C
Replied by Greg_C on topic Problem with guest form validation.
Hi Mohamed, ok, it works - thank you for your help !
will you also add this change on your end in the next version of Hikashop ?
Regards,
Greg
will you also add this change on your end in the next version of Hikashop ?
Regards,
Greg
Please Log in or Create an account to join the conversation.
7 years 4 days ago - 7 years 4 days ago #311897
by Greg_C
Replied by Greg_C on topic Problem with guest form validation.
Hi Mohamed, Unfortunately after further tests (on other devices and browsers) it is turned out that this changed caused problems with proper site functioning - Slideshow Module is now not working (there is only empty space) and we have problem with presentation of list of products which are now presented only in one column. It means this changed in the hikashop.js is causing problem with other elements.
Regards,
Greg
Regards,
Greg
Last edit: 7 years 4 days ago by Greg_C.
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
7 years 4 days ago #311941
by Mohamed Thelji
Replied by Mohamed Thelji on topic Problem with guest form validation.
Hello,
Can you send us a link to the page where you are having that issue so that we can check and reproduce it ?
Kind regards,
Mohamed Thelji.
Can you send us a link to the page where you are having that issue so that we can check and reproduce it ?
Kind regards,
Mohamed Thelji.
Please Log in or Create an account to join the conversation.
7 years 3 days ago #311971
by Greg_C
Replied by Greg_C on topic Problem with guest form validation.
Hello Mohamed, I have found what caused the problem - it was caused because I have missed the last mark "}" in your code !
once again thank you for your help !
will you also add this change on your end in the next version of Hikashop ?
Regards,
Greg
once again thank you for your help !
will you also add this change on your end in the next version of Hikashop ?
Regards,
Greg
Please Log in or Create an account to join the conversation.
Less
More
- Posts: 12953
- Thank you received: 1778
7 years 2 days ago #311990
by Mohamed Thelji
Replied by Mohamed Thelji on topic Problem with guest form validation.
Hello Greg,
Sure we'll add this change on next Hikashop release !
Kind regards,
Mohamed Thelji.
Sure we'll add this change on next Hikashop release !
Kind regards,
Mohamed Thelji.
Please Log in or Create an account to join the conversation.
Time to create page: 0.401 seconds