public function printSetting() { if (!empty($this->post_data)) { $fileMD5 = $this->post_data->fileMD5; $option = $this->post_data->option; $option_value = $this->post_data->option_value; $cart = new MY_Cart(); try { $res = $cart->changePrintSetting($fileMD5, $option, $option_value); echo json_encode(array("success" => true, "single" => $res['unitPrice'], "gross" => $res['subtotal'])); } catch (Exception $e) { $this->echo_msg(false); echo $e; } } }