这个是hoveryi 老大的 ,我的就是老大帮弄好的 哈哈
代码如下:
<?php
defined( '_VALID_MOS' ) or die( 'Direct Access to this location is not allowed.' );
/**
* This file is called after the order has been placed by the customer
*
* @version $Id: checkout.thankyou.php,v 1.7 2005/10/24 18:13:07 soeren_nb Exp $
* @package VirtueMart
* @subpackage html
* @copyright Copyright (C) 2004-2005 Soeren Eberhardt. All rights reserved.
* @license
http://www.gnu.org/copyleft/gpl.html GNU/GPL, see LICENSE.php
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
*
http://virtuemart.net
*/
mm_showMyFileName( __FILE__ );
require_once(CLASSPATH.'ps_product.php');
$ps_product= new ps_product;
$Itemid = mosGetParam( $_REQUEST, "Itemid", null );
global $vendor_currency;
// Order_id is returned by checkoutComplete function
$order_id = $GLOBALS['vmInputFilter']->process( $vars["order_id"] );
$print = mosgetparam( $_REQUEST, 'print', 0);
/** Retrieve User Email **/
$q = "SELECT * FROM #__{vm}_order_user_info WHERE order_id='$order_id' AND address_type='BT'";
$db->query( $q );
$db->next_record();
$user = $db->record[0];
$dbbt = $db->_clone( $db );
$user->email = $db->f("user_email");
/** Retrieve Order & Payment Info **/
$db = new ps_DB;
$q = "SELECT * FROM #__{vm}_payment_method, #__{vm}_order_payment, #__{vm}_orders ";
$q .= "WHERE #__{vm}_order_payment.order_id='$order_id' ";
$q .= "AND #__{vm}_payment_method.payment_method_id=#__{vm}_order_payment.payment_method_id ";
$q .= "AND #__{vm}_orders.user_id='" . $auth["user_id"] . "' ";
$q .= "AND #__{vm}_orders.order_id='$order_id' ";
$db->query($q);
if ($db->next_record()) {
?>
<h3><?php echo $VM_LANG->_
PHPSHOP_THANKYOU ?></h3>
<p>
<?php
if( empty($vars['error'])) { ?>
<img src="<?php echo IMAGEURL ?>ps_image/button_ok.png" height="48" width="48" align="center" alt="Success" border="0" />
<?php echo $VM_LANG->_PHPSHOP_THANKYOU_SUCCESS?>
<br /><br />
<?php echo $VM_LANG->_PHPSHOP_EMAIL_SENDTO .": <strong>". $user->user_email; ?></strong><br />
</p>
<?php
} ?>
<!-- Begin Payment Information -->
<?php
if ($db->f("order_status") == "P" ) {
// Copy the db object to prevent it gets altered
$db_temp = ps_DB::_clone( $db );
/** Start printing out HTML Form code (Payment Extra Info) **/ ?>
<br />
<table width="100%">
<tr>
<td width="100%" align="center">
<?php
/* Try to get PayPal/PayMate/Worldpay/whatever Configuration File */
@include( CLASSPATH."payment/".$db->f("payment_class").".cfg.php" );
echo DEBUG ? vmCommonHTML::getInfoField('Beginning to parse the payment extra info code...' ) : '';
// Here's the place where the Payment Extra Form Code is included
// Thanks to Steve for this solution (why make it complicated...?)
if( eval('?>' . $db->f("payment_extrainfo") . '<?php ') === false ) {
echo vmCommonHTML::getErrorField( "Error: The code of the payment method ".$db->f( 'payment_method_name').' ('.$db->f('payment_method_code').') '
.'contains a Parse Error!<br />Please correct that first' );
}
else {
echo DEBUG ? vmCommonHTML::getInfoField('Successfully parsed the payment extra info code.' ) : '';
}
/** END printing out HTML Form code (Payment Extra Info) **/
?>
</td>
</tr>
</table>
<br />
<?php
$db = $db_temp;
}
?>
<p><a href="<?php $sess->purl(SECUREURL."index.php?page=account.order_details&order_id=". $order_id) ?>">
<?php echo $VM_LANG->_PHPSHOP_ORDER_LINK ?></a>
</p>
<?php
$q1 = "SELECT order_status,order_total,order_number FROM #__{vm}_orders WHERE ";
$q1 .= "#__{vm}_orders.user_id='" . $auth["user_id"] . "' ";
$q1 .= "AND #__{vm}_orders.order_id='$order_id'";
$db->query($q1);
$total = $db->f("order_total");
$orderno = $db->f("order_number");
?>
<!-- 支付宝 包含头文件 放在顶部 开始-->
<?php
require_once("alipay/Alipay_Payto.php");
?>
<!-- 支付宝 包含头文件 放在顶部 结束-->
<!-- 支付宝 接口代码 开始 -->
<?php
$interfaceurl = "https://www.alipay.com/payto:";
$sitename = "";
$weburl = "";
$seller = "
ndxjj@126.com"; //支付宝账号
$payalikey = "1t90mnblxphjdhdfhdfhb3egve3ewayt"; //安全校验码
$imgurl = "images/alipay_bwrx.gif"; //按钮图片源
$imgtitle = "使用支付宝购买"; //按钮图片说明
$cmd = '0001';
$subject = '订单号:'.$orderno;
$body = 'www.13hao.com,总价包含邮费';
$order_no = $orderno;
$price = $total;
$url = 'www.13hao.com';
$type = '1';
$number = '1';
$transport = '2';
$ordinary_fee = "10"; //平邮费
$express_fee = "20"; //快递费
$readonly = 'true';
$buyer_msg = '';
$buyer = '';
$buyer_name = '';
$buyer_address = '';
$buyer_zipcode = '';
$buyer_tel = '';
$buyer_mobile = '';
$partner = '';
$geturl = new alipay_payto;
$link = $geturl->geturl
(
$cmd,$subject,$body,$order_no,$price,$url,$type,$number,$transport,
$ordinary_fee,$express_fee,$readonly,$buyer_msg,$seller,$buyer,
$buyer_name,$buyer_address,$buyer_zipcode,$buyer_tel,$buyer_mobile,$partner,
$interfaceurl,$payalikey
);
} /* End of security check */
?><!-- 支付宝 接口代码 结束 -->
<div align="left">
<a href="<?php echo $link?>" target="_blank"><img src="<?php echo $imgurl?>" border="0"></a>
</div>
---------------------------------------------------------------------------------------------------------
上面的是/administrator/components/com_virtuemart/html/checkout.thankyou.php 替换这个文件
还有需要支付宝的文件:这个文件上传到/administrator/components/com_virtuemart/html/目录
还有就是支付按钮文件alipay_bwrx.gif,在支付宝论坛有的下:上传到/images/ 这个文件你可以换成你喜欢的就可以了
最后创建支付宝支付方式就可以了!
让我们一起感谢hoveryi 老大吧 哈哈哈哈哈
演示:
http://www.collegebook.cn/
http://www.13hao.com