Disable editing some address fields in checkout

  • Posts: 14
  • Thank you received: 0
12 years 1 month ago #69847

Hi, is it possible to disable editing in some address fields? I need to show but disable editing in VAT number and Fiscal Code.
maybe with some IF in editaddress.php or in editaddress function?
Also, how can I add email address editing?
I know it's managed by address_template.php but email address comes from another database table and so, another class and I can't find it
Thank you
Paolo


Corsi di formazione online RSPP HACCP RLS di Wst Europa su Scuola Sicurezza eLearning

Please Log in or Create an account to join the conversation.

  • Posts: 82818
  • Thank you received: 13361
  • MODERATOR
12 years 1 month ago #70026

Hi,

If you want to disable them, you will have to edit the corresponding view and add a check to not call the display function of the field class but directly echo the value of the field.
Actually, a simple way would be to remove the field from the address form in CSS. The field value would still be displayed on the address view if you added it in the "address_template" view file.

The address_template file can only display address fields. You won't be able to add the email address there. Why are you trying to do that ? instead, you should edit the view file where address_template is loaded. There you will be able to load the email address.

Please Log in or Create an account to join the conversation.

  • Posts: 14
  • Thank you received: 0
12 years 1 month ago #70087

Thank you for the answer, my whole point is that in the checkout step, where the customer see its address and has the possibility to edit it, in the modal popup form I don't want the possibility of editing VAT and Fiscal Code, but I want email edit field. How can I remove a field in the edit form if the values are called dinamically? Thank you
Paolo


Corsi di formazione online RSPP HACCP RLS di Wst Europa su Scuola Sicurezza eLearning

Please Log in or Create an account to join the conversation.

  • Posts: 82818
  • Thank you received: 13361
  • MODERATOR
12 years 1 month ago #70287

You need to edit the file "form" of the view "address"

and add the line:
if($fieldName=='my_skipped_field_column_name') continue;
after:
foreach($this->extraFields as $fieldName => $oneExtraField) {

And do the same in the "custom_fields" file of the view "user".

That way, you can remove the field my_skipped_field_column_name from the address form.

Please Log in or Create an account to join the conversation.

  • Posts: 14
  • Thank you received: 0
12 years 1 month ago #70366

Hi Nicolas, thank you for the help.

I changed the first string and disabled the 2 fields perfectly!

Do you think it is possible to add the email field editable in the address during checkout?

Thank you again
Paolo


Corsi di formazione online RSPP HACCP RLS di Wst Europa su Scuola Sicurezza eLearning

Please Log in or Create an account to join the conversation.

  • Posts: 82818
  • Thank you received: 13361
  • MODERATOR
12 years 1 month ago #70374

Nothing is impossible, but it's a lot more complex. You would have to hack in the controller to handle saving the user information with the new email address.
And saving that in both the hikashop user table and the joomla user table makes it even more complex.

The following user(s) said Thank You: p.sartorio

Please Log in or Create an account to join the conversation.

  • Posts: 14
  • Thank you received: 0
12 years 1 month ago #70390

I imagined, I actually don't really need to change it, I just can collect a new one.
Thank you very much
Paolo


Corsi di formazione online RSPP HACCP RLS di Wst Europa su Scuola Sicurezza eLearning

Please Log in or Create an account to join the conversation.

Time to create page: 0.065 seconds
Powered by Kunena Forum