I am trying to simplify the checkout process by just offering only the credit card numbers input.
I would like to have the option under the extension settings to:
- Enable complete billing address fields
- Enable only zip code field
- Disable billing address fields
In Authorize.net you can disable the AVS (address verification system) so it can go through without the billing address.
Code wise in Tasty Igniter, I commented these lines out to disable address verification:
tastyigniter\extensions\authorize_net_aim\controllers\Authorize_net_aim.php
[php] /*if ($this->input->post('authorize_address_id') === 'new') {
$this->form_validation->set_rules('authorize_address_id', 'lang:label_address_id', 'xss_clean|trim');
$this->form_validation->set_rules('authorize_address_1', 'lang:label_address_1', 'xss_clean|trim|required|min_length[3]|max_length[128]');
$this->form_validation->set_rules('authorize_address_2', 'lang:label_address_2', 'xss_clean|trim|max_length[128]');
$this->form_validation->set_rules('authorize_city', 'lang:label_city', 'xss_clean|trim|required|min_length[2]|max_length[128]');
$this->form_validation->set_rules('authorize_state', 'lang:label_state', 'xss_clean|trim|max_length[128]');
$this->form_validation->set_rules('authorize_postcode', 'lang:label_postcode', 'xss_clean|trim|min_length[2]|max_length[10]');
$this->form_validation->set_rules('authorize_country_id', 'lang:label_country', 'xss_clean|trim|required|integer');
} else {
$this->form_validation->set_rules('authorize_address_id', 'lang:label_address_id', 'xss_clean|trim|required|integer');
}*/[/php]
tastyigniter\extensions\authorize_net_aim\views\authorize_net_aim.php
[php] <?php /*
<div id="authorize-same-address">
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<select name="authorize_address_id" class="form-control">
<option value="new"><?php echo lang('text_add_new_address'); ?></option>
<?php foreach ($addresses as $address) { ?>
<?php if ($address['address_id'] === $authorize_address_id) { ?>
<option value="<?php echo $address['address_id']; ?>" selected="selected"><?php echo $address['address']; ?></option>
<?php } else { ?>
<option value="<?php echo $address['address_id']; ?>"><?php echo $address['address']; ?></option>
<?php } ?>
<?php $address_row++; ?>
<?php } ?>
</select>
</div>
</div>
</div>
<div id="authorize-hide-address">
<div class="row">
<div class="col-xs-12">
<div class="form-group">
<input type="text" class="form-control" name="authorize_address_1" value="<?php echo set_value('authorize_address_1'); ?>" placeholder="<?php echo lang('label_address_1'); ?>" required />
<?php echo form_error('authorize_address_1', '<span class="text-danger">', '</span>'); ?>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<input type="text" class="form-control" name="authorize_address_2" value="<?php echo set_value('authorize_address_2'); ?>" placeholder="<?php echo lang('label_address_2'); ?>" />
<?php echo form_error('authorize_address_2', '<span class="text-danger">', '</span>'); ?>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<input type="text" class="form-control" name="authorize_city" value="<?php echo set_value('authorize_city'); ?>" placeholder="<?php echo lang('label_city'); ?>" />
<?php echo form_error('authorize_city', '<span class="text-danger">', '</span>'); ?>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<input type="text" class="form-control" name="authorize_state" value="<?php echo set_value('authorize_state'); ?>" placeholder="<?php echo lang('label_state'); ?>" />
<?php echo form_error('authorize_state', '<span class="text-danger">', '</span>'); ?>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div class="form-group">
<input type="text" class="form-control" name="authorize_postcode" value="<?php echo set_value('authorize_postcode'); ?>" placeholder="<?php echo lang('label_postcode'); ?>" />
<?php echo form_error('authorize_postcode', '<span class="text-danger">', '</span>'); ?>
</div>
</div>
<div class="col-xs-6">
<div class="form-group">
<select name="authorize_country_id" class="form-control">
<?php foreach ($countries as $country) { ?>
<?php if ($country['country_id'] === $authorize_country_id) { ?>
<option value="<?php echo $country['country_id']; ?>" selected="selected"><?php echo $country['name']; ?></option>
<?php } else { ?>
<option value="<?php echo $country['country_id']; ?>"><?php echo $country['name']; ?></option>
<?php } ?>
<?php } ?>
</select>
<?php echo form_error('authorize_country', '<span class="text-danger">', '</span>'); ?>
</div>
</div>
</div>
</div>
</div> */?>[/php]