Jump to content
Latest News: (loading..)
Sign in to follow this  
stratula

extra field for VAT ID in create_account

Recommended Posts

2.3.4.1 CE BS responsive / PHP 7.1.15

Hello,
i want to make an extra field in create_account for VAT ID below company.
It should be as option like company.

The problem is that i do not understand of all what is to do.

I'm sure to start in create_account and make changes like this:

in catalog/create_account.php on line: 33

    if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($_POST['company']);

to:

    if (ACCOUNT_COMPANY == 'true') $company = tep_db_prepare_input($_POST['company']);
    if (ACCOUNT_VAT-ID == 'true') $vat-id = tep_db_prepare_input($_POST['vat-id']);

 

on line: 196

      if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;

to

      if (ACCOUNT_COMPANY == 'true') $sql_data_array['entry_company'] = $company;
	  if (ACCOUNT_VAT-ID == 'true') $sql_data_array['entry_vat-id'] = $vat-id;

 

on line: 346

<?php
  if (ACCOUNT_COMPANY == 'true') {
?>

  <h2 class="h3"><?php echo CATEGORY_COMPANY; ?></h2>
  
  <div class="contentText">
    <div class="form-group">
      <label for="inputCompany" class="control-label col-sm-3"><?php echo ENTRY_COMPANY; ?></label>
      <div class="col-sm-9">
        <?php
        echo tep_draw_input_field('company', NULL, 'id="inputCompany" placeholder="' . ENTRY_COMPANY_TEXT . '"');
        ?>
      </div>
    </div>
  </div>

<?php
  }
?>

to

<?php
  if (ACCOUNT_COMPANY == 'true') {
?>

  <h2 class="h3"><?php echo CATEGORY_COMPANY; ?></h2>
  
  <div class="contentText">
    <div class="form-group">
      <label for="inputCompany" class="control-label col-sm-3"><?php echo ENTRY_COMPANY; ?></label>
      <div class="col-sm-9">
        <?php
        echo tep_draw_input_field('company', NULL, 'id="inputCompany" placeholder="' . ENTRY_COMPANY_TEXT . '"');
        ?>
      </div>
    </div>
  </div>

<?php
  }
?>

<?php
  if (ACCOUNT_VAT-ID == 'true') {
?>

  <h2 class="h3"><?php echo CATEGORY_VAT-ID; ?></h2>
  
  <div class="contentText">
    <div class="form-group">
      <label for="inputVAT-ID" class="control-label col-sm-3"><?php echo ENTRY_VAT-ID; ?></label>
      <div class="col-sm-9">
        <?php
        echo tep_draw_input_field('vat-id', NULL, 'id="inputVAT-ID" placeholder="' . ENTRY_VAT-ID_TEXT . '"');
        ?>
      </div>
    </div>
  </div>

<?php
  }
?>

 

After this i think in admin/customers.php making the same kind of changes and of course the languages files.

But from this point i need help, i don't know what else files have to be change and how to write the sql for dbase.

Any kind of help for this would be nice

thx

Stefan

 

Share this post


Link to post
Share on other sites

There's an addon that does this for 2.3.4. Unfortunately apps site doesn't allow searching for 3 letter words so you'll have to find it manuallu.

Share this post


Link to post
Share on other sites

@LeeFoster

Thank you for the infos.

Is it for the account section only the address_book.php if i want the same rules like company?

The SQL will be a problem for me...😩

@piernas 

The only addon i found is for 2.3.3 and its not the same i want. I need just an extra field straight below company wich follows the same rules like company. No need to make it switchable in admin.

best regards

stefan

Share this post


Link to post
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
Sign in to follow this  

×