Jump to content

I need help hiding the address field


JPI

Recommended Posts

I don't need the "Address" field under my fast checkout. I tried hiding the address1 div under my order-opc-new-account.tpl file with a default value, but even with the field hidden with a set value, I'm still getting the warning to fill the address.

 

Code:

<div style="display: none;" class="required text form-group">
<label for="address1">{l s='Address'} <sup>*</sup></label>
<input type="text" class="text form-control validate" name="address1" id="address1" data-validate="isAddress" value="Default address" />
</div>

Any other workaround?

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

hello

what prestashop version and what template?

you modified something in addition to tpl files?

(php classes / controllers / js scripts related to otder process)

 

Prestashop version: 1.6.0.11 (default template)

 

As I enabled the one-page checkout option, I also removed the guest checkout option so the new user form appears automatically. For this, I edited the order-opc.js file as following:

if (guestCheckoutEnabled && !isLogged)
 {
    $('#opc_account_choice').show();
    $('#opc_account_form, #opc_invoice_address').show();

I don't really care about users filling their address since I'm selling virtual goods.

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

removing the address portion can result in later payment gateways failing, i.e. they may require customer address...so don't go and outsmart yourself...

 

I don't want to use Prestashop to process any payments, I just need users to generate their orders with certain information. Shipping address is not needed in this case.

 

 

You can take a look at a recent thread: removing or making address fields optional?

Especially bellini13's remarks here

 

Thank you for your reply, it was useful, but unfortunately, I don't know what classes or controllers are involved or need to be edited to set a default address. If you could provide me more information about that, I will really appreciate it.

  • Like 1
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...