untuk menampilkan berat barang di halaman utama produk kekmana ?
Misalnya
Code: Select all
Harga : Rp 15.350.000,00-
Stok : 997
Model : SONY7009
Rating Rata-rata : Not Rated
Berat : 20 Kg
maaf gw banyak kali nanyaknya ...........
Code: Select all
Harga : Rp 15.350.000,00-
Stok : 997
Model : SONY7009
Rating Rata-rata : Not Rated
Berat : 20 Kg
"For us, OpenCart is not 'just' a shopping cart. OpenCart is bigger than that. We bring OpenCart to the next level."
Produk:
- Toko Online - Toko Online Dropshipper - Toko Online Marketpace - Online Directory - Digital Marketplace - Property & Business Listings - News Portal - Corporate Website - Social Network
Info: http://www.bukausahaonline.com
kalo nanya gimana ganti gambar bisa boz, ni aja lagi nyari function yg dimili openCart.bebaspromo wrote:Panggilan...panggilan.... ditujukan buat siapa aja, khususnya Bung Qahar ....
asli! nggak ngeh ....superbrands wrote:Harus mengubah proses query database untuk fungsi: public function getProduct($product_id) di file model product.php dulu, bro. Query-nya di JOIN-kan lagi dengan table weight_class_description. Baru kemudian variable-variablenya didefinisikan di controllernya.
dulu pernah bisa .... tapi lupaqahar wrote: OOT: ada yg minta bantuan saya bikin drop down kategori lho, dia pake theme default2 he3.. ntar klo dah slesai, saya kabari ato jgn mlah saya ntar ga dibayar..
wah ka gak ngarti gw yg kek giniansuperbrands wrote:Harus mengubah proses query database untuk fungsi: public function getProduct($product_id) di file model product.php dulu, bro. Query-nya di JOIN-kan lagi dengan table weight_class_description. Baru kemudian variable-variablenya didefinisikan di controllernya.
Maksudnya pada saat data product dibaca dari database, opencart tidak mengambil data satuan yang berada di tabel weight_class_description. Nah untuk itu kode untuk mengambil data ke databasenya harus dimodifikasi. Kodenya ada di file model/product.phpbebaspromo wrote:asli! nggak ngeh ....superbrands wrote:Harus mengubah proses query database untuk fungsi: public function getProduct($product_id) di file model product.php dulu, bro. Query-nya di JOIN-kan lagi dengan table weight_class_description. Baru kemudian variable-variablenya didefinisikan di controllernya.
Baris yang dibold pada code adalah modifikasinya.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;
}
detilnya bro .cevarief wrote:Maksudnya pada saat data product dibaca dari database, opencart tidak mengambil data satuan yang berada di tabel weight_class_description. Nah untuk itu kode untuk mengambil data ke databasenya harus dimodifikasi. Kodenya ada di file model/product.phpbebaspromo wrote:asli! nggak ngeh ....superbrands wrote:Harus mengubah proses query database untuk fungsi: public function getProduct($product_id) di file model product.php dulu, bro. Query-nya di JOIN-kan lagi dengan table weight_class_description. Baru kemudian variable-variablenya didefinisikan di controllernya.
Coba ganti function getProduct (awas tanpa s dibelakang) pada file model diatasBaris yang dibold pada code adalah modifikasinya.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;
}
Selanjutnya, di file controller/product/product.php bisa Anda keluarkan data satuan tsb dengan variabel $product_info['title'] dalam kondisi if ($product_info) {}, sekitar baris 80-an.
detail yang ininya, mungkin?cevarief wrote: Selanjutnya, di file controller/product/product.php bisa Anda keluarkan data satuan tsb dengan variabel $product_info['title'] dalam kondisi if ($product_info) {}, sekitar baris 80-an.
Code: Select all
$this->data['text_weight'] = $this->language->get('text_weight');
Code: Select all
$this->data['weight'] = $product_info['weight']; //berat
$this->data['weight_title'] = $product_info['title']; //satuan
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;
}
Code: Select all
$_['text_weight'] = 'Satuan:';
Code: Select all
<tr>
<td><b><?php echo $text_weight; ?></b></td>
<td><?php echo $weight . ' ' . $weight_title; ?></td>
</tr>
weight.jpg (10.46 KiB) Viewed 11467 times
Users browsing this forum: No registered users and 44 guests