Post by vohanks » Thu Oct 18, 2012 7:05 am

agan2 maaf mau tanya nih

saya punya fungsi di mysql namanya generate_id fungsi untuk generate kode di product

tapi pas saya jalankan di OC error
ini errornya :
Fatal error: Call to undefined function generate_id() in D:\xampp\htdocs\yukbelanja\upload\admin\model\catalog\product.php on line 4

ini scriptnya di OC
class ModelCatalogProduct extends Model {
public function addProduct($data) {
$this->db->query("INSERT INTO " . DB_PREFIX . "product SET product_id = '". generate_id('BRG') ."', model = '" . $this->db->escape($data['model']) . "', sku = '" . $this->db->escape($data['sku']) . "', location = '" . $this->db->escape($data['location']) . "', quantity = '" . (int)$data['quantity'] . "', minimum = '" . (int)$data['minimum'] . "', maximum = '" . (int)$data['maximum'] . "', subtract = '" . (int)$data['subtract'] . "', stock_status_id = '" . (int)$data['stock_status_id'] . "', date_available = '" . $this->db->escape($data['date_available']) . "', manufacturer_id = '" . (int)$data['manufacturer_id'] . "', shipping = '" . (int)$data['shipping'] . "', price = '" . (float)$data['price'] . "', cost = '" . (float)$data['cost'] . "', weight = '" . (float)$data['weight'] . "', weight_class_id = '" . (int)$data['weight_class_id'] . "', length = '" . (float)$data['length'] . "', width = '" . (float)$data['width'] . "', height = '" . (float)$data['height'] . "', length_class_id = '" . (int)$data['length_class_id'] . "', status = '" . (int)$data['status'] . "', tax_class_id = '" . (int)$data['tax_class_id'] . "', sort_order = '" . (int)$data['sort_order'] . "', date_added = NOW()");

Newbie

Posts

Joined
Thu Oct 18, 2012 6:52 am

Post by sa1638 » Thu Oct 18, 2012 8:56 pm

belum dibikin kali tabelnya di database juragan
biasanya sih ada perintah ALTER ... ADD ........ after ......... gitu.

New member

Posts

Joined
Sun Jun 24, 2012 11:41 am

Post by rempong » Thu Oct 18, 2012 9:00 pm

Fatal error: Call to undefined function generate_id() in D:\xampp\htdocs\yukbelanja\upload\admin\model\catalog\product.php on line 4
Sudah ada belum fungsi "generate_id()" ? tempatnya benar ? sudah di load model nya ?

OPENCART MODULE :
Opencart Compare Link VQMOD, Link your compared product to forum/email

Copy and DIRECTLY Edit Product, the easy way.

Custom Product Sort, Full control to product sorting options

Already Sold Product Module, shows total product sold

Opencart Shortcode (Wordpress Clone)


Active Member

Posts

Joined
Fri Sep 14, 2012 2:38 pm
Location - Indonesia
Who is online

Users browsing this forum: No registered users and 4 guests