捕梦网 OSCommerce 便利商店外挂模块教学 (Pumo711)
本公司购物网采用 SeedNet便利商店缴款,营业额屡创新高?分享这一份喜悦,捕梦网将写好的模块分享给大家,希望各位网络头家可以跟我们一
样财源广进,当然捕梦网的购物网是由目前资源最多功能最强的开店软件( Oscommerce)所架设的,由于各位头家不一定都懂得如何修改程序或
增加金流模块,笔者将 step by step 将步骤说明清楚,若不清楚可以来信指教,欢迎各位先进不吝赐教
安装 SeedNet 全省便利商店付款模块
安装 SeedNet 全省便利商店付款模块,主要分为两个部分,第一部分你必须将模块上传到你的主机上,第二部分就是你必须修改你的程序码,下面
所有的档案都以绝对路径来表示,上传或修改请依照实际的档案路径,笔者建议上传或是修改之前,请先备份你的档案,详细的安装步骤如下:
第一部分: 所需下载档案如下:
catalog/includes/modules/payment/p711.php
catalog/includes/languages/tchinese/modules/payment/p711.php
catalog/includes/p711.php
点这里下载程序码 ( 下载后请先解压缩再上传)
第二部分: 需要修改档案如下:
catalog/checkout_confirmation.php
catalog/includes/functions/html_output.php
catalog/includes/classes/currencies.php
catalog/includes/classes/payment.php
catalog/account_history_info.php (补印帐单)
catalog/includes/functions/general.php (补印帐单)
STEP 1.上传模块程序
将便利商店代收模块所需程序上传到服务器中
STEP 2.修改程序
此模块有些许功能为笔者自行增加的,所以与原本的程序码有一些不一样
,请依照文件中修改,笔者建议修改前请先备份你的档案,再开始进行修改
STEP 3.启动便利商店付款机制
当安装完成后,你就可以启动便利商店付款机制了,要正式使用超商缴费机制
请先申请商家编号,取得正式的编号后,你就可以正式上线,让你的客户使用这
么方便的缴款方式了
STEP 1 上传模块程序
首先将档案下载到本机,并且解压缩,解压缩完成后上传到你的服务器,如下图所示:
1.1 点选档案下载,将档案下载到本机中,如下图所示:

1.2 储存到计算机上任一目录中,如下图所示:

1.3 将下载的档案 p711.zip 解压缩,如下图所示:
1.4 开启压缩后的目录,如下图所示:

1.5 上传解压缩中的档案 p711.php (路径位于catalog/includes/modules/payment)到你的服务器的目录中,服务器
中的路径如下图所示:

1.6 上传解压缩中的档案 p711.php (路径位于catalog/includes/languages/tchinese/modules/payment)到
你的服务器的目录中,服务器中的路径如下图所示:

1.7 上传解压缩中的档案 p711.php (路径位于catalog/includes/)到你的服务器的目录中,服务器目录为
/catalog/includes/ ,如下图所示:

STEP 2 修改程序 GoTop
Oscommerce 便利商店付费模块,需要修改的模块有六个档案,其中两个是补印帐单用,笔者建议
修改之前请先备份你的档案,避免造成严重错误后无法修复,详细修改步骤如下:
catalog/checkout_confirmation.php
catalog/includes/functions/html_output.php
catalog/includes/classes/currencies.php
catalog/includes/classes/payment.php
catalog/account_history_info.php (补印帐单)
catalog/includes/functions/general.php (补印帐单)
2.1 修改 catalog/checkout_confirmation.php
查找到档案中下面区块的程序码:
<?php
if (isset($$payment->form_action_url)) {
$form_action_url = $$payment->form_action_url;
} else {
$form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');
}
echo tep_draw_form('checkout_confirmation', $form_action_url, 'post');
if (is_array($payment_modules->modules)) {
echo $payment_modules->process_button();
}
echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . '</form>' . "\n";
?> |
将上面的程序码替换成下面的程序码:
<?php
if (isset($$payment->form_action_url)) {
$form_action_url = $$payment->form_action_url;
} else {
$form_action_url = tep_href_link(FILENAME_CHECKOUT_PROCESS, '', 'SSL');
}
echo tep_draw_form('checkout_confirmation', $form_action_url, 'post');
if (is_array($payment_modules->modules)) {
echo $payment_modules->process_button();
}
if($$payment->code=='p711'){
echo tep_image_submit_p711($payment_modules->process_button_p711(),'button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . '</form>' . "\n";
}else{
echo tep_image_submit('button_confirm_order.gif', IMAGE_BUTTON_CONFIRM_ORDER) . '</form>' . "\n";
}
?>
|
2.2 修改 catalog/includes/functions/html_output.php
查找到档案中下面区块的程序码:
function tep_image_submit($image, $alt = '', $parameters = '') {
global $language;
$image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';
if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;
$image_submit .= '>';
return $image_submit;
} |
在这段程序码下面插入下面区块的程序码:
function tep_image_submit_p711($url,$image, $alt = '', $parameters = '') {
global $language;
$image_submit = '<input type="image" src="' . tep_output_string(DIR_WS_LANGUAGES . $language . '/images/buttons/' . $image) . '" border="0" alt="' . tep_output_string($alt) . '"';
if (tep_not_null($alt)) $image_submit .= ' title=" ' . tep_output_string($alt) . ' "';
if (tep_not_null($parameters)) $image_submit .= ' ' . $parameters;
$image_submit .= ' onClick="p711(\''.$url.'\');">';
return $image_submit;
} |
2.3 修改 catalog/includes/classes/currencies.php
查找到档案中下面区块的程序码:
function display_price($products_price, $products_tax, $quantity = 1) {
return $this->format(tep_add_tax($products_price, $products_tax) * $quantity);
} |
在这段程序码下面插入下面区块的程序码:
function display_price_p711($products_price, $products_tax, $quantity = 1) {
return tep_add_tax($products_price, $products_tax) * $quantity;
} |
2.4 修改 catalog/includes/classes/payment.php
查找到档案中下面区块的程序码:
function process_button() {
if (is_array($this->modules)) {
if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
return $GLOBALS[$this->selected_module]->process_button();
}
}
} |
在这段程序码下面插入下面区块的程序码:
function process_button_p711() {
if (is_array($this->modules)) {
if (is_object($GLOBALS[$this->selected_module]) && ($GLOBALS[$this->selected_module]->enabled) ) {
return $GLOBALS[$this->selected_module]->process_button_p711();
}
}
}
|
2.5 修改 catalog/account_history_info.php (补印帐单)
查找到档案中下面区块的程序码:
<tr>
<td class="main"><?php echo $order->info['payment_method']; ?></td>
</tr>
|
将上面的程序码替换成下面的程序码:
<!-- start seednet payment method -->
<?php require(DIR_WS_INCLUDES . 'p711.php'); ?>
<tr>
<td class="main"><?php echo $order->info['payment_method'];
if($order->info['payment_method']=='便利商店代收货款'){
?></td>
</tr>
<tr>
<td STYLE="cursor:hand"
onClick="p711('<?php echo $url;?>','SeedNet 便利商店付款','width=350,height=40')"><FONT SIZE="2" COLOR="#0000FF"><U>补印帐单</U></FONT></td>
<?}?>
</tr>
<!-- end seednet payment method --> |
2.6 修改 catalog/includes/functions/general.php (补印帐单)
查找到档案中下面区块的程序码:
function tep_date_short($raw_date) {
if ( ($raw_date == '0000-00-00 00:00:00') || empty($raw_date) ) return false;
$year = substr($raw_date, 0, 4);
$month = (int)substr($raw_date, 5, 2);
$day = (int)substr($raw_date, 8, 2);
$hour = (int)substr($raw_date, 11, 2);
$minute = (int)substr($raw_date, 14, 2);
$second = (int)substr($raw_date, 17, 2);
if (@date('Y', mktime($hour, $minute, $second, $month, $day, $year)) == $year) {
return date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, $year));
} else {
return ereg_replace('2037' . '$', $year, date(DATE_FORMAT, mktime($hour, $minute, $second, $month, $day, 2037)));
}
} |
在这段程序码下面插入下面区块的程序码:
function tep_date_p711($raw_date) {
if ( ($raw_date == '0000-00-00') || empty($raw_date) ) return false;
$year = substr($raw_date, 0, 4);
$month = (int)substr($raw_date, 5, 2);
$day = (int)substr($raw_date, 8, 2);
if (@date('Y', mktime($month, $day, $year)) == $year) {
return date('Y-m-d', mktime($month, $day, $year));
} else {
return ereg_replace('2037' . '$', $year, date(DATE_FORMAT, mktime($month, $day, 2037)));
}
} |
STEP 3 启动便利商店付款机制 GoTop
完成上面所有步骤后,启动便利商店缴款机制,进入管理者界面->外挂模块->付款方式->便利商店代收货款
点选安装,你的模块就算安装完成了,详细说明如下图所示:
3.1 安装便利商店代收货款

3.2 立即申请便利商店代收货款,若您尚未申请SeedNet 商家编号,请点选立即申请,详细说明如下图所示:

3.3 SEEDNET 商家编号,预设值为SEEDNET所提供的测试帐号,当您进行测试的时候,每一笔交易都会
使用SEEDNET的的预设帐号 SCITY000 进行交易,所以当你申请商家编号后,请把栏位中的值更正,以
免产生交易失败
3.4 缴费到期天数,设定你每一笔交易允许消费者在几天内缴款,帐单若超过缴费日期,便利商店就无法
收取这一笔款项,所以请店家依照自己的需求做调整
3.5 厂商管理界面网址: https://service.seed.net.tw/proxy_portal.htm
( 未正式上线之前可先以测试帐号 login 使用: 测试帐号: SCITY000 密码 scity000)
详细说明请阅读 帐单代收厂商使用手册
|
|