Jump to content

Remove "Alias" field on signup form


Recommended Posts

You can do it from the back office installing this module to add custom CSS: https://www.sunnytoo.com/download/10901/ and then in the module configuration paste the code I gave you above. 

This is more of a technical field so the customer can give a name to each address in order to distinguish them better (for example "Home", "Work", etc), it is not address-related field, that is why it is not in the country configuration. 

Link to comment
Share on other sites

Ok I see, actually i can edit css by myself, don't need a plugin for that.
However, i believe Prestashop already has a way to remove this field wich is not mandatory.
Where could i find this option ?

 

  • Haha 1
Link to comment
Share on other sites

2 hours ago, toimata said:

I used my theme editor to add the css you sent but doesn't work. Even using !important; property
 

From what I see it did work... seems like you just have to clear your cache. I registered on your site and the field is gone on the form, hidden by the code I gave you ;)

1008020440_Screenshot2021-05-28at09_38_20.thumb.png.4db12150aa940263682088165c8b78ca.png

Link to comment
Share on other sites

  • 5 months later...
On 5/26/2021 at 1:19 AM, w3bsolutions said:

As long as its the first field in the form (which it is, unless you specifically change it), you can just hide it via CSS:

.address-form .form-group:first-of-type {
  display: none;
}

 

Sorry to steal this topic, but I am after the same thing.
I did install the CSS module like you suggested and added the code to the first "Custom CSS Code" field.
Nothing seems to happen though.

Also I would like to hide the company an VAT fields. How do I go about that?

Found that one already, but:
Equally the tickbox for "use this address for the invoice too" needs to go.

 

image.png

Edited by ConH (see edit history)
Link to comment
Share on other sites

  • 7 months later...

This didn't work for me so i used Js if someone needs it:

Quote

function hideAlias(){
    
    var bodyId = document.body.id;
    var aliasField = document.getElementsByClassName("form-group row ")[0];
    
    if(bodyId == "checkout"){
        if(aliasField == undefined){
            // do nothing
        }
        else{
            aliasField.style.display = "none";
        }
    }
    else{
        // do nothing
    }
}

window.onload = hideAlias();

Just put it in custom.js

Link to comment
Share on other sites

  • 1 month later...

Bonjour J'ai le même problème mais sur PrestaShop 1.6.1.18.

Existe-t-il aussi un module gratuit que je peux installer ? La version proposée m'indique à l'installation que le module n'est pas compatible avec ma version.

Link to comment
Share on other sites

  • 2 years later...
  • 2 weeks later...

Hello All,
Read this topic and i want to add that the correct method to hide the "Alias" field is to remove this code from Public_html/classes/form/CustomerAddressForm.php   this will hide it from the user to edit.

 image.png.3166786603a81299ad14821f8502fbc4.png(see attached image) 

Link to comment
Share on other sites

il y a une heure, Mian Waqas a dit :

Hello All,
Read this topic and i want to add that the correct method to hide the "Alias" field is to remove this code from Public_html/classes/form/CustomerAddressForm.php   this will hide it from the user to edit.

 image.png.3166786603a81299ad14821f8502fbc4.png(see attached image) 

A radical solution that will fail at the slightest update.

The CSS code solution is the safest and most durable.

Link to comment
Share on other sites

On 8/15/2024 at 9:34 PM, Mediacom87 said:

A radical solution that will fail at the slightest update.

The CSS code solution is the safest and most durable.

Yeah but you can further override it right?
and the CSS method is old school for this, as anyone can change the display:none from developer tools on browser easily to show it? am i correct? if i am correct then why telling them to just simply hide this important box via CSS, if 1 change by 1 customer by unhiding it can ruin all there logic they want to make. why miss guide them at first place?

so like i said its the proper way to do, which most of the people are looking for.

Kind Regards

Edited by Mian Waqas
Typo (see edit history)
Link to comment
Share on other sites

il y a 15 minutes, Mian Waqas a dit :

it can ruin all there logic they want to make

At the same time, we have no idea why he wants to implement this option.

By using CSS, we can keep PrestaShop running without disturbing it or causing any side-effects. We can be sure that PrestaShop will continue to function properly.

Link to comment
Share on other sites

5 minutes ago, Mediacom87 said:

At the same time, we have no idea why he wants to implement this option.

By using CSS, we can keep PrestaShop running without disturbing it or causing any side-effects. We can be sure that PrestaShop will continue to function properly.

better find the side-effects of core changes.
And similarly find the side-effects of CSS hiding.

(for me i had already tested & had found none with core changes & dozens with css changes)  and afterwards i had advised them with the correct method.



 

Link to comment
Share on other sites

Il y a 2 heures, Mian Waqas a dit :

better find the side-effects of core changes.
And similarly find the side-effects of CSS hiding.

(for me i had already tested & had found none with core changes & dozens with css changes)  and afterwards i had advised them with the correct method.



 

Thanks for these clarifications, although I don't know what side-effects there might be to simply hiding a native input field that won't impact any operation since nothing really changes.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...