[ad]
If you are using proxypay as your payment gateway in cscart you can give you visitors/buyers option to pay in installments with this simple cscart module. to use this module/addon following changes in files needs to be done.
firstly in file : skins/currently-used-skin-name/customer/views/orders/components/payments/cc_outside.tpl
paste following code replacing all existing code
{* $Id: cc_outside.tpl 6645 2008-12-22 20:21:37Z zeke $ *}
{*dimarzio*}
{php}
$order_total=$this->_tpl_vars["cart"]["total"];
if($order_total<=99 )
{
$this->assign('loop_times', 2);
}
else if($order_total>99 && $order_total<=199)
{
$this->assign('loop_times', 3);
}
else if($order_total>199 && $order_total<=349)
{
$this->assign('loop_times', 5);
}
else if($order_total>349 && $order_total<=499)
{
$this->assign('loop_times', 7);
}
else if($order_total>499 && $order_total<=649)
{
$this->assign('loop_times', 9);
}
else if($order_total>649 && $order_total<=799)
{
$this->assign('loop_times', 11);
}
else if($order_total>800)
{
$this->assign('loop_times', 13);
}
{/php}
<div>
<label for="period">{$lang.no_of_installments}:</label>
<span>*</span>
<select id="period" name="no_of_installments">
{section name="period" start="1" loop=$loop_times step="1"}
<option value="{if $smarty.section.period.index == 1}0{else}{$smarty.section.period.index}{/if}">
{if $smarty.section.period.index == 1}
1
{else}
{$smarty.section.period.index}
{/if}
</option>
{/section}
</select>
</div>
<script type="text/javascript" language="javascript 1.2">
//<![CDATA[
// Check payment info fields
function fn_can_place_order()
{$ldelim}
return fn_check_agreement();
{$rdelim}
//]]>
</script>Secondly in file: payments/proxypay3.php paste following code over writing your existing code
<?php
/******************************************************************************
* *
* Copyright (c) 2009 Simbirsk Technologies LTD. All rights reserved. *
* *
*******************************************************************************
* *
* CS-Cart is commercial software, only users who have purchased a valid *
* license through http://www.cs-cart.com/ and accept to the terms of this *
* License Agreement can install this product. *
* *
*******************************************************************************
* THIS CS-CART SHOP END-USER LICENSE AGREEMENT IS A LEGAL AGREEMENT BETWEEN *
* YOU AND YOUR COMPANY (COLLECTIVELY, "YOU") AND SIMBIRSK TECHNOLOGIES LTD *
* (HEREINAFTER REFERRED TO AS "THE AUTHOR") FOR THE SOFTWARE PRODUCT *
* IDENTIFIED ABOVE, WHICH INCLUDES COMPUTER SOFTWARE AND MAY INCLUDE *
* ASSOCIATED MEDIA, PRINTED M ATERIALS, AND "ONLINE" OR ELECTRONIC *
* DOCUMENTATION (COLLECTIVELY, THE "SOFTWARE"). BY USING THE SOFTWARE, *
* YOU SIGNIFY YOUR AGREEMENT TO ALL TERMS, CONDITIONS, AND NOTICES CONTAINED *
* OR REFERENCED HEREIN. IF YOU ARE NOT WILLING TO BE BOUND BY THIS *
* AGREEMENT, DO NOT INSTALL OR USE THE SOFTWARE. *
* *
* PLEASE READ THE FULL TEXT OF SOFTWARE LICENSE AGREEMENT IN THE *
* "copyright.txt" FILE PROVIDED WITH THIS DISTRIBUTION. THE AGREEMENT TEXT IS *
* ALSO AVAILABLE AT THE FOLLOWING URL: http://www.cs-cart.com/license.html *
******************************************************************************/
//
// $Id: proxypay3.php 6785 2009-01-16 13:22:37Z zeke $
//
if ( !defined('IN_CSCART') ) { die('Access denied'); }
$totals_100 = array('EUR', 'USD', 'GBP', 'CHF', 'NLG', 'DEM', 'FRF', 'ATS');
if (defined('PAYMENT_NOTIFICATION')) {
if ($mode == 'notify') {
if ($action == 'ok') {
$__status = db_get_field("SELECT status FROM ?:orders WHERE order_id = ?i", $_REQUEST['order_id']);
$pp_response = array();
$pp_response['order_status'] = $__status;
$pp_response['reason_text'] = fn_get_lang_var('order_id') . '-' . $_REQUEST['order_id'];
if (fn_check_payment_script('proxypay3.php', $_REQUEST['order_id'])) {
fn_finish_payment($_REQUEST['order_id'], $pp_response, false);
}
fn_order_placement_routines($_REQUEST['order_id']);
} elseif ($action == 'nok') {
if (empty($_REQUEST['order_id'])) {
fn_set_notification('E', fn_get_lang_var('error'), fn_get_lang_var('connection_error'));
fn_redirect("$index_script?dispatch=checkout.checkout");
} else {
$pp_response = array(
'order_status' => 'D',
'reason_text' => 'Error in data validation',
);
fn_finish_payment($_REQUEST['order_id'], $pp_response, false);
fn_order_placement_routines($_REQUEST['order_id']);
}
}
}
} else {
$languages = array('EN', 'GR');
if (!in_array(CART_LANGUAGE, $languages)) {
$lang = 'EN';
} else {
$lang = CART_LANGUAGE;
}
if (in_array($processor_data['params']['currency'], $totals_100)) {
$total_cost = $order_info['total'];
} else {
$total_cost = $order_info['total'] * 100;
}
echo <<<EOT
<body onLoad="document.process.submit();">
<form method="POST" action="https://{$processor_data['params']['url']}" name="process">
<input type="hidden" name="APACScommand" value="NewPayment">
<input type="hidden" name="merchantID" value="{$processor_data['params']['merchantid']}">
<input type="hidden" name="amount" value="{$total_cost}">
<input type="hidden" name="merchantRef" value="{$order_id}">
<input type="hidden" name="merchantDesc" value="{$processor_data['params']['details']}">
<input type="hidden" name="currency" value="{$processor_data['params']['currency']}">
<input type="hidden" name="lang" value="{$lang}">
<input type="hidden" name="CustomerEmail" value="{$order_info['email']}">
<input type="hidden" name="period" value="{$_REQUEST['no_of_installments']}">
EOT;
$msg = fn_get_lang_var('text_cc_processor_connection');
$msg = str_replace('[processor]', 'Eurobank', $msg);
echo <<<EOT
</form>
<br>
<div align="center">{$msg}</div>
</body>
</html>
EOT;
}
exit;
?>[ad]
That’s all. This should do it.
