Ciqrcode generate |
Hi bros, how can i automatically create QrCode upon product creation.
i have managed to create the product and then to add one button which generates the QRCode for the specific id. //Generate QRCode public function qrgenerator($id){ $config['cacheable'] = true; //boolean, the default is true $config['cachedir'] = ''; //string, the default is application/cache/ $config['errorlog'] = ''; //string, the default is application/logs/ $config['quality'] = true; //boolean, the default is true $config['size'] = '1024'; //interger, the default is 1024 $config['black'] = array(224,255,255); // array, default is array(255,255,255) $config['white'] = array(70,130,180); // array, default is array(0,0,0) $this->ciqrcode->initialize($config); //GenerateQR $params['data'] = base_url().'products/'.$id; $params['level'] = 'H'; $params['size'] = 10; $image_name = $id.'.png'; $params['savename'] = FCPATH.'uploads/qr_image/'.$image_name; $this->ciqrcode->generate($params); $product = $this->product_model->get_product_by_id($id); $data = array( 'title' => 'print_qrcode', 'product' => $product['product_id'], 'qr_image' => $image_name, ); $this->session->set_flashdata('success', 'Generated'); redirect(base_url('product/index')); } |
Messages In This Thread |
Ciqrcode generate - by Lipe Shtogu - 02-01-2022, 02:02 AM
RE: Ciqrcode generate - by InsiteFX - 02-02-2022, 02:03 AM
|