Post by donaldkzs » Fri Dec 16, 2011 4:22 pm

mulunix wrote:dengan cara ini bisa juga :)
catalog/view/theme/yg kamu pakek/template/product.tpl
cari code ini

Code: Select all

<span><?php echo $text_stock; ?></span> <?php echo $stock; ?><br />
tambahkan code ini dibawah atau di atasnya

Code: Select all

<span>Berat: </span> <?php echo $product_info['weight']; ?> Kg<br />
contoh :
http://souveniraceh.com/tas-ransel-L

Ini baru simple, ane udah coba di OC 1.5.1.3 dan berhasil.
thanks buat mulunix

Newbie

Posts

Joined
Fri Dec 16, 2011 2:43 pm

Post by abil » Tue Feb 21, 2012 6:39 pm

TheCovenant wrote:Hasil Oprekan untuk Opencart Versi 1.5.x

1. File controller/product/product.php
a. Sisipkan baris text weight di baris 139

Code: Select all

$this->data['text_weight'] = $this->language->get('text_weight');
b. Sisipkan berat dan satuan di baris 237-238

Code: Select all

$this->data['weight'] = $product_info['weight'];
$this->data['weight_class'] = $product_info['weight_class'];
2. language/folderbahasa/product/product.php
* Sisipkan di baris 8

Code: Select all

$_['text_weight']         = 'Berat Barang:';
3. view/theme/namatemplate/template/product/product.tpl
* Sisipkan berat dan satuan di baris 40, sesudah <br/> nya class price

Code: Select all

<span > <?php echo $text_weight; ?></span> <span> <?php echo $weight; ?> </span> <span> <?php echo $weight_class; ?></span> <br />
Catatan :
1. Masuk ke menu Admin
2. Masuk ke menu System
3. Masuk ke Sub Menu Settings
4. Pilih Tabs Local, Paling bawah, Weight Class: rubah ke Kilogram
5. Pilih Tabs Option, Paling bawah, Display Weight on Cart Page, set ke Yes
-

Tidak perlu merubah query database seperti yang ditunjukkan pada halaman 1. Opencart 1.5.x sudah otomatis query Berat barang apabila pilihan nomor 5 diatas diaktifkan, hanya tidak aktif pada halaman depan toko.
Query yang dipakai adalah Query Weight, untuk satuan berat dipakai Query Weight_Class.

Bila anda merubah/menambah sesuatu, selalu aktifkan Display Errors: pada Tabs Server, untuk melihat kesalahan yang terjadi.
Saya udah coba bos, tapi Kg nya gak bisa tampil ya.... cuman berat aja Berat Barang : 1.00 kalau Kg nya tampil dibelakang bagai mana bos....

Newbie

Posts

Joined
Sun Feb 19, 2012 9:12 am

Post by kohde » Thu Jun 13, 2013 3:13 pm

Udah berhasil gan, tapi kok keluarnya 20.00000000 Kg ya (banyak sekali nol nya) apa bisa di setting supaya jadi 20.00 Kg ?

Thanks :choke:

Newbie

Posts

Joined
Thu Jun 13, 2013 3:11 pm

Post by sans » Sat Jun 15, 2013 9:31 pm

kohde wrote:Udah berhasil gan, tapi kok keluarnya 20.00000000 Kg ya (banyak sekali nol nya) apa bisa di setting supaya jadi 20.00 Kg ?

Thanks :choke:
Iya bro, itu karena di databasenya menggunakan 8 desimal place. Klo mau 2 decimal place ya,edit aja di databasenya, ato klo tahu coding ya pakai pembulatan 2 desimal.

kaos jersey, jersey bola, baju bola, baju bola terbaru, baju bola murah


Active Member

Posts

Joined
Tue Dec 07, 2010 9:18 am

Post by tomo » Mon Jul 15, 2013 9:19 am

Kalo pakai OC 147 bgamana cara settingannya
Mohon bantuan pencerahan, terima kasih

New member

Posts

Joined
Sat May 28, 2011 11:35 pm

Post by nashirr » Thu Nov 21, 2013 4:45 pm

satuan beratnya ga muncul nihh di opencart 1.5.4.1

Newbie

Posts

Joined
Mon Mar 04, 2013 6:55 am

Post by nashirr » Thu Nov 21, 2013 4:50 pm

cevarief wrote:Ini saya revise stepnya untuk menampilkan berat dan satuan, sekalian mau saya gunakan untuk project yang sedang saya garap :D

Hasil yang diinginkan adalah property product Weight: 1.5 Kilogram

Ada 4 file yang harus dimodifikasi yaitu : controller product, model product, language product dan template product.

1. File controller/product/product.php
a. Sisipkan baris text weight di baris 138

Code: Select all

$this->data['text_weight'] = $this->language->get('text_weight');
b. Sisipkan berat dan satuan di baris 240

Code: Select all

$this->data['weight'] = $product_info['weight']; //berat
$this->data['weight_title'] = $product_info['title']; //satuan
2. model/catalog/product.php
Ganti satu block public function getProduct($product_id) di awal-awal baris file tsb menjadi :

Code: Select all

public function getProduct($product_id) {
        $query = $this->db->query("SELECT DISTINCT *, pd.name AS name, p.image, m.name AS manufacturer, ss.name AS stock, w.title FROM " . DB_PREFIX . "product p LEFT JOIN " . DB_PREFIX . "product_description pd ON (p.product_id = pd.product_id) LEFT JOIN " . DB_PREFIX . "product_to_store p2s ON (p.product_id = p2s.product_id) LEFT JOIN " . DB_PREFIX . "manufacturer m ON (p.manufacturer_id = m.manufacturer_id) LEFT JOIN " . DB_PREFIX . "stock_status ss ON (p.stock_status_id = ss.stock_status_id) LEFT JOIN " . DB_PREFIX . "weight_class_description AS w USING (weight_class_id) WHERE p.product_id = '" . (int) $product_id . "' AND pd.language_id = '" . (int) $this->config->get('config_language_id') . "' AND p2s.store_id = '" . (int) $this->config->get('config_store_id') . "' AND ss.language_id = '" . (int) $this->config->get('config_language_id') . "' AND p.date_available <= NOW() AND p.status = '1'");
        return $query->row;
}
3. language/folderbahasa/product/product.php
Tambahkan di baris 8 atau bebas untuk text berat. Sesuaikan dengan bahasa yang digunakan.

Code: Select all

$_['text_weight']         = 'Satuan:'; 
4. view/theme/namatemplate/template/product.product.tpl
Sisipkan kode berikut untuk menampilkan berat. Sesuiakan dimana ingin menampilkannya. Misal sebelum text manufacturer pada baris 38.

Code: Select all

<tr>
                <td><b><?php echo $text_weight; ?></b></td>
                <td><?php echo $weight . ' ' . $weight_title; ?></td>
</tr>
Hasil bisa dilihat diattahment.

Watch this : Hacking OC code is a nightmare after upgrading to a newer version later :laugh: :laugh: :laugh:
satuan beratnya kaga muncul. gimana biar muncul di opencart 1.5.4.1 ?

Newbie

Posts

Joined
Mon Mar 04, 2013 6:55 am

Post by indramb » Wed May 09, 2018 4:13 pm

maaf agan2, klo code ini dipakai untuk oc 3.0.2.0 bagaimana y?
terima kasih

Newbie

Posts

Joined
Tue Aug 01, 2017 2:48 pm
Who is online

Users browsing this forum: No registered users and 3 guests