Jump to content

I can`t remove country field from new registration form?


Detelin Markov

Recommended Posts

Hi,

 

What i want: To remove Country drop and down menu from guest registration form in one page checkout.

post-335617-0-46267000-1394041620_thumb.png

 

What i try:

- Remove country from address format in active country from BO:

firstname lastname
address1
postcode city
phone_mobile
post-335617-0-62399700-1394041633_thumb.png
 

- All country except my country is disabled from BO. I try to disable my country to, but when click  "save" presta give me error: required id_country... 

post-335617-0-78551600-1394041625_thumb.png

 

- Try to remove required from class/Address.php (, 'required' => true) and remove field from order-opc-new-account.tpl but againg when "save" i get error..

 

How look row in address.php after modification:

'id_country' =>array('type' => self::TYPE_INT, 'validate' => 'isUnsignedId'),

I don`t know what to do... I don`t need country, i sell only in my country and want to optimize checkout process.

 

I make many changes in order-opc-new-account.tpl but i do something wrong i know. From address.php and may be somewhere else i need to delete something.

 

How to remove it?

 

prestashop 1.5.6.2
test store: test.detelinmarkov.com/quick-order

 

I read several topic here but nowhere i don`t find way that i cannot try

 

Thanks

Detelin

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

 

What i try:

- Remove country from address format in active country from BO:

firstname lastname
address1
postcode city
phone_mobile
post-335617-0-62399700-1394041633_thumb.

 

Thanks for answer Milosz!

 

First thing that i try but not working for me. May be because i using guest checkout or may be because my fields are little modified, i don`t know but not working.

 

Now i again return to default for my country, remove country from fields and again not working... Try to remove again field from .tpl but get the same error (if i remove country from .tpl)...

Another way?

Link to comment
Share on other sites

  • 1 year later...
  • 3 years later...

Replace this in theme/address.tpl
            {if $field_name eq 'Country:name' || $field_name eq 'country' || $field_name eq 'Country:iso_code'}
                <div class="required form-group">
                    <label for="id_country">{l s='Country'} <sup>*</sup></label>
                    <select id="id_country" class="form-control" name="id_country">{$countries_list}</select>
                </div>
            {/if}
By this
            {if $field_name eq 'Country:name' || $field_name eq 'country' || $field_name eq 'Country:iso_code'}
                <div class="form-group">
                    <label class="hidden" for="id_country">{l s='Country'} <sup>*</sup></label>
                    <select id="id_country" class="form-control hidden" name="id_country">{$countries_list}</select>
                </div>
            {/if}

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...