ecshop,大商创后台支付系统修改模板
初始模板
要求修改
增加了多个账户可供用户进行选择
解决方法
一找到要修改模板路径;即:http://dsctest.cn/admin/payment.php?act=edit&code=bank
2;找到后台源代码操作文件即操作方法就可以找到对应模板
3,设置要求的字段及属性
4,设置字段属性的名称
注:对于select可以使用 字段_rand[i]=""设置可选择的值
4;返回你的后台设置页面即可完成
二:前台调用
找到支付页面的是否在线支付选择的else
2增加一下代码
即:
if($order['pay_id']==10){
$sql = 'SELECT * FROM ' . $ecs->table('payment') . (' WHERE pay_code =\'bank\' AND enabled = \'1\'');
$pay = $db->getRow($sql);
if (empty($pay)) {
$links[] = array('text' => $_LANG['back_list'], 'href' => 'payment.php?act=list');
sys_msg($_LANG['payment_not_available'], 0, $links);
}
$set_modules = true;
include_once ROOT_PATH . 'includes/modules/payment/bank.php';
$data = $modules[0];
if (is_string($pay['pay_config'])) {
$store = unserialize($pay['pay_config']);
$code_list = array();
foreach ($store as $key => $value) {
$code_list[$value['name']] = $value['value'];
}
$pay['pay_config'] = array();
foreach ($data['config'] as $key => $value) {
$pay['pay_config'][$key]['desc'] = isset($_LANG[$value['name'] . '_desc']) ? $_LANG[$value['name'] . '_desc'] : '';
$pay['pay_config'][$key]['label'] = $_LANG[$value['name']];
$pay['pay_config'][$key]['name'] = $value['name'];
$pay['pay_config'][$key]['type'] = $value['type'];
if (isset($code_list[$value['name']])) {
$pay['pay_config'][$key]['value'] = $code_list[$value['name']];
}
else {
$pay['pay_config'][$key]['value'] = $value['value'];
}
if ($pay['pay_config'][$key]['type'] == 'select' || $pay['pay_config'][$key]['type'] == 'radiobox') {
$pay['pay_config'][$key]['range'] = $_LANG[$pay['pay_config'][$key]['name'] . '_range'];
}
}
}
}else{
$payment = payment_info($order['pay_id']);
$payment_file = 'includes/modules/payment/' . $payment['pay_code'] . '.php';
if (file_exists($payment_file)) {
include_once $payment_file;
$pay_obj = new $payment['pay_code']();
$pay_online = $pay_obj->get_code($order, unserialize_config($payment['pay_config']));
}
else {
$pay_online = '';
}
}