Menu Dropdown Nama Kota (City) di Alamat Penerima Barang (Shipping Address) untuk Opencart v.1.4.7 bisa digunakan untuk Opencart v.1.4.8, namun harus mengubah beberapa scriptnya.
Berikut cara instalasi Menu Dropdown untuk Opencart v.1.4.8:
1. Instal file-file berikut di Opencart v.1.4.8 anda:
- admin/controller/localisation/city.php
- admin/model/localisation/city.php
- admin/language/english/localisation/city.php
- admin/view/template/localisation/city_form.tpl
- admin/view/template/localisation/city_list.tpl
2. Di Opencart v.1.4.8 anda, temukan dan edit file-file berikut:
a. admin/controller/localisation/city.php
pada baris: 48, 80, 114,
Code: Select all
$this->redirect(HTTPS_SERVER . 'index.php?route=localisation/city' . $url);
ubah menjadi:
Code: Select all
$this->redirect(HTTPS_SERVER . 'index.php?route=localisation/city&token=' . $this->session->data['token'] . $url);
pada baris: 156
Code: Select all
'href' => HTTPS_SERVER . 'index.php?route=common/home',
udah menjadi:
Code: Select all
'href' => HTTPS_SERVER . 'index.php?route=common/home&token=' . $this->session->data['token'],
pada baris: 162
Code: Select all
'href' => HTTPS_SERVER . 'index.php?route=localisation/city' . $url,
ubah menjadi:
Code: Select all
'href' => HTTPS_SERVER . 'index.php?route=localisation/city&token=' . $this->session->data['token'] . $url,
pada baris: 167
Code: Select all
$this->data['insert'] = HTTPS_SERVER . 'index.php?route=localisation/city/insert' . $url;
ubah menjadi:
Code: Select all
$this->data['insert'] = HTTPS_SERVER . 'index.php?route=localisation/city/insert&token=' . $this->session->data['token'] . $url;
pada baris: 168
Code: Select all
$this->data['delete'] = HTTPS_SERVER . 'index.php?route=localisation/city/delete' . $url;
ubah menjadi:
Code: Select all
$this->data['delete'] = HTTPS_SERVER . 'index.php?route=localisation/city/delete&token=' . $this->session->data['token'] . $url;
pada baris: 188
Code: Select all
'href' => HTTPS_SERVER . 'index.php?route=localisation/city/update&city_id=' . $result['city_id'] . $url
ubah menjadi:
Code: Select all
'href' => HTTPS_SERVER . 'index.php?route=localisation/city/update&token=' . $this->session->data['token'] . '&city_id=' . $result['city_id'] . $url
pada baris: 239
Code: Select all
$this->data['sort_city'] = HTTPS_SERVER . 'index.php?route=localisation/city&sort=z.name' . $url;
ubah menjadi:
Code: Select all
$this->data['sort_city'] = HTTPS_SERVER . 'index.php?route=localisation/city&token=' . $this->session->data['token'] . '&sort=z.name' . $url;
pada baris: 240
Code: Select all
$this->data['sort_name'] = HTTPS_SERVER . 'index.php?route=localisation/city&sort=ct.name' . $url;
ubah menjadi:
Code: Select all
$this->data['sort_name'] = HTTPS_SERVER . 'index.php?route=localisation/city&token=' . $this->session->data['token'] . '&sort=ct.name' . $url;
pada baris: 241
Code: Select all
$this->data['sort_code'] = HTTPS_SERVER . 'index.php?route=localisation/city&sort=ct.code' . $url;
ubah menjadi:
Code: Select all
$this->data['sort_code'] = HTTPS_SERVER . 'index.php?route=localisation/city&token=' . $this->session->data['token'] . '&sort=ct.code' . $url;
pada baris: 258
Code: Select all
$pagination->url = HTTPS_SERVER . 'index.php?route=localisation/city' . $url . '&page={page}';
ubah menjadi:
Code: Select all
$pagination->url = HTTPS_SERVER . 'index.php?route=localisation/city&token=' . $this->session->data['token'] . $url . '&page={page}';
pada baris: 319
Code: Select all
'href' => HTTPS_SERVER . 'index.php?route=common/home',
ubah menjadi:
Code: Select all
'href' => HTTPS_SERVER . 'index.php?route=common/home&token=' . $this->session->data['token'],
pada baris: 325
Code: Select all
'href' => HTTPS_SERVER . 'index.php?route=localisation/city' . $url,
ubah menjadi:
Code: Select all
'href' => HTTPS_SERVER . 'index.php?route=localisation/city&token=' . $this->session->data['token'] . $url,
pada baris: 331
Code: Select all
$this->data['action'] = HTTPS_SERVER . 'index.php?route=localisation/city/insert' . $url;
ubah menjadi:
Code: Select all
$this->data['action'] = HTTPS_SERVER . 'index.php?route=localisation/city/insert&token=' . $this->session->data['token'] . $url;
pada baris: 333
Code: Select all
$this->data['action'] = HTTPS_SERVER . 'index.php?route=localisation/city/update&city_id=' . $this->request->get['city_id'] . $url;
ubah menjadi:
Code: Select all
$this->data['action'] = HTTPS_SERVER . 'index.php?route=localisation/city/update&token=' . $this->session->data['token'] . '&city_id=' . $this->request->get['city_id'] . $url;
pada baris: 336
Code: Select all
$this->data['cancel'] = HTTPS_SERVER . 'index.php?route=localisation/city' . $url;
ubah menjadi:
Code: Select all
$this->data['cancel'] = HTTPS_SERVER . 'index.php?route=localisation/city&token=' . $this->session->data['token'] . $url;
b. admin/view/template/common/header.tpl
setelah script (baris ke-105):
Code: Select all
<li><a href="<?php echo $geo_zone; ?>"><?php echo $text_geo_zone; ?></a></li>
sisipkan script berikut:
Code: Select all
<li><a href="<?php echo $city; ?>"><?php echo $text_city; ?></a></li>
c. admin/controller/common/header.php
setelah script (baris ke-67):
Code: Select all
$this->data['text_confirm'] = $this->language->get('text_confirm');
sisipkan script berikut:
Code: Select all
$this->data['text_city'] = $this->language->get('text_city');
setelah script (baris ke-128):
Code: Select all
$this->data['zone'] = HTTPS_SERVER . 'index.php?route=localisation/zone&token=' . $this->session->data['token'];
sisipkan script berikut:
Code: Select all
$this->data['city'] = HTTPS_SERVER . 'index.php?route=localisation/city&token=' . $this->session->data['token'];
d. admin/language/english/common/header.php
setelah script (baris ke-55):
sisipkan script berikut:
3. Setelah itu instal file-file yang ada di catalog.
4. Tahap instalasi selanjutnya sama seperti yang ada di instalasi.doc.
5. Lakukan pengetesan. Apabila ditemukan bug atau error, mohon dilaporkan ke saya.
Semoga bermanfaat. Thanks.
Untuk metode pengiriman TIKI JNE dan PT Pos Indonesia menyusul.