opencart 2.2.0.0 üye kaydı sayfasında TC kimlik vergi no ve vergi diresi ekleme





Merhaba arkadaşlar sizlere bugün opencart 2.2.0.0 versiyonlarında test ettiğimden ötürü diğer versiyonlarda da çalışır düşüncesindeyim üye kayıt sayfasında tc kimlik vergi no ve vergi dairesi modifikasyonunu anlatacağız. Bu modifikasyonla artık yeni e-ticaret kanunun uygulanmasının ardından bu bilgilerin girilmesi zorunlu hale geldiğinden ötürü böyle bir modifikasyon çevirisini uygun gördüm. Üye kayıt esnasında tc kimlik vergi dairesi ve vergi numarasını girmesi gerekliliğini sağlayan form elemanları oluşturularak buraya gereken bilgilerin girilmesi sağlanılmaktadır. Admin tarafından ise girilen bilgilerin müşteriler sayfaında görüntülenmeside sağlanılmaktadır. Baya uzun aşamalardan oluşan geniş makalemize başlayalım.



Önemli Not : Video Gün İçersinde Eklenecektir.

İlk iş veritabanındaki tabloları oluşturma.

Gerekli kayıt bilgilerinin tutulması için veritabanımızdaki tablolara ihtiyacımızvar bunun için aşağıdaki 3 slq sorgsunu phpmyadmin bölümünüze veritabanınıza tıklayıp üst kısımdaki sql butonuna tıklayıp, buradaki açılan sayfada bulunan textarea bkutucuğuna bu satırları yazıp git butonuna tıkladıktan sonra tabloların oluşturulmasını sağlayalım ancak burada dikkat edilecek bir husus sizin opencartı kurarken girmiş olduğunuz veritabanın ön ekinide yazmalısınız.örnek olarak " ALTER TABLE `önekimiz_customer` ADD `tck` VARCHAR( 50 ) NOT NULL AFTER `telephone` ; " Bordo renkle belirttiğimiz kısımı customer etiketinin önüne eklememiş gerekmektedir. Şimdi veritabanına eklenecek kodları aşağıda belirtelim.



Alıntı:ALTER TABLE `önekimiz_customer` ADD `tck` VARCHAR( 50 ) NOT NULL AFTER `telephone` ;
ALTER TABLE `önekimiz_customer` ADD `taxoffice` VARCHAR( 50 ) NOT NULL AFTER `tck` ;
ALTER TABLE `önekimiz_customer` ADD `taxno` VARCHAR( 50 ) NOT NULL AFTER `taxoffice` ;
Önekimiz dye belirttiğimiz alanı siz kendi ön ekinizi girerek değiştirmelisiniz, yoksa hata alırsınız . Bu uyarıyıda yaptıktan sonra diğer düzenlemelere başlayalım.

Dosyamızı Açalım : catalog/controller/account/

register.php

Bulalım :


Alıntı:$data['entry_email'] = $this->language->get('entry_email');

Alt Satıra Ekleyelim :

Alıntı:$data['entry_tck'] = $this->language->get('entry_tck');
$data['entry_taxoffice'] = $this->language->get('entry_taxoffice');
$data['entry_taxno'] = $this->language->get('entry_taxno');

Yine aynı Dosyamızda Bu Bloğumuzu Bulalım :

Alıntı:if (isset($this->error['email'])) {
$data['error_email'] = $this->error['email'];
} else {
$data['error_email'] = '';
}

Alt Satıra Ekleyelim :

Alıntı:if (isset($this->error['tck'])) {
$data['error_tck'] = $this->error['tck'];
} else {
$data['error_tck'] = '';
}
if (isset($this->error['taxoffice'])) {
$data['error_taxoffice'] = $this->error['taxoffice'];
} else {
$data['error_taxoffice'] = '';
}
if (isset($this->error['tck'])) {
$data['error_taxno'] = $this->error['taxno'];
} else {
$data['error_taxno'] = '';
}

Aynı DOsyada Yine Bulalım :

Alıntı:if (isset($this->request->post['email'])) {
$data['email'] = $this->request->post['email'];
} else {
$data['email'] = '';
}

Alt Satırına Ekleyelim :

Alıntı:if (isset($this->request->post['tck'])) {
$data['tck'] = $this->request->post['tck'];
} else {
$data['tck'] = '';
}
if (isset($this->request->post['taxoffice'])) {
$data['taxoffice'] = $this->request->post['taxoffice'];
} else {
$data['taxoffice'] = '';
}
if (isset($this->request->post['taxno'])) {
$data['taxno'] = $this->request->post['taxno'];
} else {
$data['taxno'] = '';
}

Yine Aynı Dosyamızda Bulalım :

Alıntı:if ($this->model_account_customer->getTotalCustomersByEmail($this->request->post['email'])) {
$this->error['warning'] = $this->language->get('error_exists');
}

Alt Satıra Ekleyelim :

Alıntı:if ((strlen(utf8_decode($this->request->post['tck'])) < 3) || (strlen(utf8_decode($this->request->post['tck'])) > 32)) {
$this->error['tck'] = $this->language->get('error_tck');
}
if ((strlen(utf8_decode($this->request->post['taxoffice'])) < 3) || (strlen(utf8_decode($this->request->post['taxoffice'])) > 32)) {
$this->error['taxoffice'] = $this->language->get('error_taxoffice');
}
if ((strlen(utf8_decode($this->request->post['taxno'])) < 3) || (strlen(utf8_decode($this->request->post['taxno'])) > 32)) {
$this->error['taxno'] = $this->language->get('error_taxno');
}
Şimdi tpl dosyamızı açalım

Dosyamızı Açalım :
 catalog/view/theme/temamız/template/account/

register.tpl

Bulalım :


Alıntı:<div class="form-group required">
<label class="col-sm-2 control-label" for="input-lastname"><?php echo $entry_lastname; ?></label>
<div class="col-sm-10">
<input type="text" name="lastname" value="<?php echo $lastname; ?>" placeholder="<?php echo $entry_lastname; ?>" id="input-lastname" class="form-control" />
<?php if ($error_lastname) { ?>
<div class="text-danger"><?php echo $error_lastname; ?></div>
<?php } ?>
</div>
</div>

Div Bloğunun Üst Kısmına Ekleyelim :

Alıntı:<div class="form-group required">
<label class="col-sm-2 control-label" for="input-tck"><?php echo $entry_tck; ?></label>
<div class="col-sm-10">
<input type="text" name="tck" value="<?php echo $tck; ?>" placeholder="<?php echo $entry_tck; ?>" id="input-tck" class="form-control" />
<?php if ($error_tck) { ?>
<div class="text-danger"><?php echo $error_tck; ?></div>
<?php } ?>
</div>
</div>
<div class="form-group required">
<label class="col-sm-2 control-label" for="input-taxoffice"><?php echo $entry_taxoffice; ?></label>
<div class="col-sm-10">
<input type="text" name="taxoffice" value="<?php echo $taxoffice; ?>" placeholder="<?php echo $entry_taxoffice; ?>" id="input-taxoffice" class="form-control" />
<?php if ($error_taxoffice) { ?>
<div class="text-danger"><?php echo $error_taxoffice; ?></div>
<?php } ?>
</div>
</div>
<div class="form-group required">
<label class="col-sm-2 control-label" for="input-taxno"><?php echo $entry_taxno; ?></label>
<div class="col-sm-10">
<input type="text" name="taxno" value="<?php echo $taxno; ?>" placeholder="<?php echo $entry_taxno; ?>" id="input-taxno" class="form-control" />
<?php if ($error_taxno) { ?>
<div class="text-danger"><?php echo $error_taxno; ?></div>
<?php } ?>
</div>
</div>

Dosyamızı Açalım :
 catalog/language/turkish/account/

register.php

Bulalım :


$_['entry_email']

Alt Satırına Ekleyelim :
Alıntı:$_['entry_tck'] = 'TC Kimlik No:';
$_['entry_taxoffice'] = 'Vergi Dairesi:';
$_['entry_taxno'] = 'Vergi No:';

Dosyamızı Açalım :
 catalog/model/account/

costumer.php

Bulalım :


Alıntı:telephone = '" . $this->db->escape($data['telephone']) . "',

Ön Satırına Ekleyelim :

Alıntı:tck = '" . $this->db->escape($data['tck']) . "',taxoffice = '" . $this->db->escape($data['taxoffice']) . "',taxno = '" . $this->db->escape($data['taxno']) . "',

Yine Aynı Dosyada Bulalım :

Alıntı:$this->db->query("UPDATE " . DB_PREFIX . "customer

Bu Satırın İÇersindeki Bunu Bulalım :

Alıntı:telephone = '" . $this->db->escape($data['telephone']) . "',

Ön Satırına Ekleyelim :

Alıntı:tck = '" . $this->db->escape($data['tck']) . "', taxoffice = '" . $this->db->escape($data['taxoffice']) . "', taxno = '" . $this->db->escape($data['taxno']) . "',

Buraya kadarki İşlemlerimiz catalog yani müşteri kayıt kısmı ziyaretçiye ait olan kısımdı şimdiki işlemlerimiz ise admin taraflı işlemlere geldi.

Dosyamızı Açalım : 
admin/view/template/customer/

costumer_form.tpl

Bulalım :


Alıntı:<div class="form-group required">
<label class="col-sm-2 control-label" for="input-lastname"><?php echo $entry_lastname; ?></label>
<div class="col-sm-10">
<input type="text" name="lastname" value="<?php echo $lastname; ?>" placeholder="<?php echo $entry_lastname; ?>" id="input-lastname" class="form-control" />
<?php if ($error_lastname) { ?>
<div class="text-danger"><?php echo $error_lastname; ?></div>
<?php } ?>
</div>
</div>

Bulduğumuz yerdeki div bloğununüst kısmına ekleyelim :

<div class="form-group required">
<label class="col-sm-2 control-label" for="input-tck"><?php echo $entry_tck; ?></label>
<div class="col-sm-10">
<input type="text" name="tck" value="<?php echo $tck; ?>" placeholder="<?php echo $entry_tck; ?>" id="input-tck" class="form-control" />
<?php if ($error_tck) { ?>
<div class="text-danger"><?php echo $error_tck; ?></div>
<?php } ?>
</div>
</div>
<div class="form-group required">
<label class="col-sm-2 control-label" for="input-taxoffice"><?php echo $entry_taxoffice; ?></label>
<div class="col-sm-10">
<input type="text" name="taxoffice" value="<?php echo $taxoffice; ?>" placeholder="<?php echo $taxoffice; ?>" id="input-tck" class="form-control" />
<?php if ($error_taxoffice) { ?>
<div class="text-danger"><?php echo $error_taxoffice; ?></div>
<?php } ?>
</div>
</div>
<div class="form-group required">
<label class="col-sm-2 control-label" for="input-taxno"><?php echo $entry_taxno; ?></label>
<div class="col-sm-10">
<input type="text" name="taxno" value="<?php echo $taxno; ?>" placeholder="<?php echo $taxno; ?>" id="input-tck" class="form-control" />
<?php if ($error_taxno) { ?>
<div class="text-danger"><?php echo $error_taxno; ?></div>
<?php } ?>
</div>
</div>

Dosyamızı Açalım : admin/controller/customer/

costumer.php

Bulalım :


Alıntı:$data['entry_email'] = $this->language->get('entry_email');

Alt Satıra Ekleyelim :

Alıntı:$data['entry_tck'] = $this->language->get('entry_tck');
$data['entry_taxoffice'] = $this->language->get('entry_taxoffice');
$data['entry_taxno'] = $this->language->get('entry_taxno');

Aynı Dosyada Bulalım :

Alıntı:if (isset($this->error['email'])) {
$data['error_email'] = $this->error['email'];
} else {
$data['error_email'] = '';
}
Alt Satıra Ekleyelim:

Alıntı:if (isset($this->error['tck'])) {
$data['error_tck'] = $this->error['tck'];
} else {
$data['error_tck'] = '';
}
if (isset($this->error['taxoffice'])) {
$data['error_taxoffice'] = $this->error['taxoffice'];
} else {
$data['error_taxoffice'] = '';
}
if (isset($this->error['taxno'])) {
$data['error_taxno'] = $this->error['taxno'];
} else {
$data['error_taxno'] = '';
}

Yine Aynı Dosyada Bu Bloğu Bulalım :

Alıntı:if (isset($this->request->post['email'])) {
$data['email'] = $this->request->post['email'];
} elseif (isset($customer_info)) {
$data['email'] = $customer_info['email'];
} else {
$data['email'] = '';
}

Alt Satıra Ekleyelim :

Alıntı:if (isset($this->request->post['tck'])) {
$data['tck'] = $this->request->post['tck'];
} elseif (isset($customer_info)) {
$data['tck'] = $customer_info['tck'];
} else {
$data['tck'] = '';
}
if (isset($this->request->post['taxoffice'])) {
$data['taxoffice'] = $this->request->post['taxoffice'];
} elseif (isset($customer_info)) {
$data['taxoffice'] = $customer_info['taxoffice'];
} else {
$data['taxoffice'] = '';
}
if (isset($this->request->post['taxno'])) {
$data['taxno'] = $this->request->post['taxno'];
} elseif (isset($customer_info)) {
$data['taxno'] = $customer_info['taxno'];
} else {
$data['taxno'] = '';
}

Yine Aynı Dosyada Bulalım :

if ((strlen(utf8_decode($this->request->post['email'])) > 96) || !preg_match('/^[^\@]+@.*\.[a-z]{2,6}$/i', $this->request->post['email'])) {
$this->error['email'] = $this->language->get('error_email');
}

Alt Satıra Ekleyelim :

Alıntı:if ((strlen(utf8_decode($this->request->post['tck'])) < 3) || (strlen(utf8_decode($this->request->post['tck'])) > 32)) {
$this->error['tck'] = $this->language->get('error_tck');
}
if ((strlen(utf8_decode($this->request->post['taxoffice'])) < 3) || (strlen(utf8_decode($this->request->post['taxoffice'])) > 32)) {
$this->error['taxoffice'] = $this->language->get('error_taxoffice');
}
if ((strlen(utf8_decode($this->request->post['taxno'])) < 3) || (strlen(utf8_decode($this->request->post['taxno'])) > 32)) {
$this->error['taxno'] = $this->language->get('error_taxno');
}

Dosyamızı Açalım : 
admin/language/turkish/customer/

costumer.php

Bulalım :

Alıntı:$_['entry_email']

Alt Satıra Ekleyelim :

Alıntı:$_['entry_tck'] = 'TC Kimlik No:';
$_['entry_taxoffice'] = 'Vergi Dairesi:';
$_['entry_taxno'] = 'Vergi No:';

Dosyamızı Açalım : admin/model/customer/

costumer.php

Bulalım :


Alıntı:$this->db->query("INSERT INTO " . DB_PREFIX . "customer

Bu satırdaki Bu kodu Bulalım :

Alıntı:telephone = '" . $this->db->escape($data['telephone']) . "',

Ön Satırına Ekleyelim :

Alıntı:tck = '" . $this->db->escape($data['tck']) . "',taxoffice = '" . $this->db->escape($data['taxoffice']) . "',taxno = '" . $this->db->escape($data['taxno']) . "',

Aynı Dosyada Bulalım :

Alıntı:$this->db->query("UPDATE " . DB_PREFIX . "customer

Yine Bu Satrdaki Aşağıdaki Satırı Bulalım :

Alıntı:telephone = '" . $this->db->escape($data['telephone']) . "',

Ön Satırına Ekleyelim :

Alıntı:tck = '" . $this->db->escape($data['tck']) . "',taxoffice = '" . $this->db->escape($data['taxoffice']) . "',taxno = '" . $this->db->escape($data['taxno']) . "',












kaynak tr-opencart türkiye

0 yorum: