Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Problems with Cresco


glissa

Recommended Posts

Hi,

 

I'm having some trouble with the Cresco Payment module.

 

When customers selects this payment option the checkout_success.php errors.

 

Parse error: parse error, unexpected '<' in /home/sites/a/autosonic.no/checkout_success.php on line 50

 

Anyone who can figure this one out?

 

?rjan

 

The contribution can be found here:

http://www.oscommerce.com/community/contributions,3806

Regards

 

?rjan

Link to comment
Share on other sites

These are the instructions for modding the file:

 

3.2.1	Open catalog/checkout_success.php

Find:
<td valign="top" class="main"><?php echo tep_draw_separator('pixel_trans.gif', '1', '10'); ?><div align="center" class="pageHeading"><?php echo HEADING_TITLE; ?></div><br><?php echo TEXT_SUCCESS; ?><br><br>

Add after:

<!-- Dette utf?res bare hvis betalingsform er cresco //-->
<?php

$ord = tep_db_query("select orders_id, payment_method from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");
$rad = tep_db_fetch_array( $ord );

$onr = $rad['orders_id'];

$query = tep_db_query("select * from cresco_ordre where ordrenr=" . $onr );

$ant = tep_db_num_rows($query);

if( $ant != 0 )
{
$sum_query = tep_db_query( "select value from orders_total where orders_id=$onr and title like 'Total%'");
$sum = tep_db_fetch_array( $sum_query );
$totsum = ROUND($sum['value']);

$bnr_query = tep_db_query( "select configuration_value from configuration where configuration_key='MODULE_PAYMENT_CRESCO_STORE_NO'");
$result = tep_db_fetch_array( $bnr_query );

echo '<H2>Viktig!!</H2><BR><BR>';

echo 'For at ordren skal sendes fra oss m? vi ha godkjenning fra cresco.<BR><BR>';
echo 'Dersom du ikke fullf?rte s?knaden mot Cresco i det vinduet som poppet opp s? kan du trykke p? linken under for ? g? til crescos sider hvor du s?ker om betaling..<BR><BR>';

echo '<a href="https://cresco.no/forms/brukfin.aspx?bnr=' . $result['configuration_value'] . '&orderno=' . $onr . '&amount=' . $totsum . '" target="_blank"><H2><B>>G? til cresco<</B></H2></A><BR><BR>';

echo 'Ordreinfo: <BR>';
echo "Ordrenr: $onr<BR>";
echo 'Total bel?p: ' . $totsum . '<BR><BR>';

echo '<script>window.open( "https://cresco.no/forms/brukfin.aspx?bnr=' . $result['configuration_value'] . '&orderno=' . $onr . '&amount=' . $totsum . '", "cresco_window", "menubar=no,location=no,resizable=yes,scrollbars=yes,status=no" );</script>';
}
?>
<!-- Slutt cresco //-->

Regards

 

?rjan

Link to comment
Share on other sites

This is the modyfied file:

 

<?php
/*
 $Id: checkout_success.php,v 1.3 2004/09/25 14:36 DMG Exp $

 osCommerce, Open Source E-Commerce Solutions
 http://www.oscommerce.com

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

 require('includes/application_top.php');
// begin PayPal_Shopping_Cart_IPN 2.8 (DMG)
require(DIR_WS_MODULES . 'payment/paypal/classes/paypal_order.class.php');
// end PayPal_Shopping_Cart_IPN

// if the customer is not logged on, redirect them to the shopping cart page
 if (!tep_session_is_registered('customer_id')) {
tep_redirect(tep_href_link(FILENAME_SHOPPING_CART));
 }

 if (isset($HTTP_GET_VARS['action']) && ($HTTP_GET_VARS['action'] == 'update')) {
$notify_string = 'action=notify&';
$notify = $HTTP_POST_VARS['notify'];
if (!is_array($notify)) $notify = array($notify);
for ($i=0, $n=sizeof($notify); $i<$n; $i++) {
  $notify_string .= 'notify[]=' . $notify[$i] . '&';
}
if (strlen($notify_string) > 0) $notify_string = substr($notify_string, 0, -1);
// BOF: daithik change for PWA//  DMG Merge w. Paypal IPN 2.8

  if (tep_session_is_registered('noaccount')) {
	 tep_session_destroy();
  tep_redirect(tep_href_link(FILENAME_DEFAULT, '$notify_string', 'NONSSL'));
  }else{
	tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string));
  }


 } else if ((isset($HTTP_GET_VARS['action']) && $HTTP_GET_VARS['action'] == 'success')) {
	//begin PayPal_Shopping_Cart_IPN
   paypal_order::reset_checkout_cart_session();
 }

//}
//end PayPal_Shopping_Cart_IPN

//<!-- Dette utf?res bare hvis betalingsform er cresco //-->
<?php
$ord = tep_db_query("select orders_id, payment_method from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");
$rad = tep_db_fetch_array( $ord );

$onr = $rad['orders_id'];

$query = tep_db_query("select * from cresco_ordre where ordrenr=" . $onr );

$ant = tep_db_num_rows($query);

if( $ant != 0 )
{
$sum_query = tep_db_query( "select value from orders_total where orders_id=$onr and title like 'Total%'");
$sum = tep_db_fetch_array( $sum_query );
$totsum = ROUND($sum['value']);

$bnr_query = tep_db_query( "select configuration_value from configuration where configuration_key='MODULE_PAYMENT_CRESCO_STORE_NO'");
$result = tep_db_fetch_array( $bnr_query );

echo '<H2>Viktig!!</H2><BR><BR>';

echo 'For at ordren skal sendes fra oss m? vi ha godkjenning fra cresco.<BR><BR>';
echo 'Dersom du ikke fullf?rte s?knaden mot Cresco i det vinduet som poppet opp s? kan du trykke p? linken under for ? g? til crescos sider hvor du s?ker om betaling..<BR><BR>';

echo '<a href="https://cresco.no/forms/brukfin.aspx?bnr=' . $result['configuration_value'] . '&orderno=' . $onr . '&amount=' . $totsum . '" target="_blank"><H2><B>>G? til cresco<</B></H2></A><BR><BR>';

echo 'Ordreinfo: <BR>';
echo "Ordrenr: $onr<BR>";
echo 'Total bel?p: ' . $totsum . '<BR><BR>';

echo '<script>window.open( "https://cresco.no/forms/brukfin.aspx?bnr=' . $result['configuration_value'] . '&orderno=' . $onr . '&amount=' . $totsum . '", "cresco_window", "menubar=no,location=no,resizable=yes,scrollbars=yes,status=no" );</script>';
}
?>
//<!-- Slutt cresco //-->

// EOF: daithik change for PWA
 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_CHECKOUT_SUCCESS);

 $breadcrumb->add(NAVBAR_TITLE_1);
 $breadcrumb->add(NAVBAR_TITLE_2);

 $global_query = tep_db_query("select global_product_notifications from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . (int)$customer_id . "'");
 $global = tep_db_fetch_array($global_query);

 if ($global['global_product_notifications'] != '1') {
$orders_query = tep_db_query("select orders_id from " . TABLE_ORDERS . " where customers_id = '" . (int)$customer_id . "' order by date_purchased desc limit 1");
$orders = tep_db_fetch_array($orders_query);

$products_array = array();
$products_query = tep_db_query("select products_id, products_name from " . TABLE_ORDERS_PRODUCTS . " where orders_id = '" . (int)$orders['orders_id'] . "' order by products_name");
while ($products = tep_db_fetch_array($products_query)) {
  $products_array[] = array('id' => $products['products_id'],
							'text' => $products['products_name']);
}
 }

// BOF: daithik change for PWA
if (tep_session_is_registered('noaccount')) {
$order_update = array('purchased_without_account' => '1');
tep_db_perform(TABLE_ORDERS, $order_update, 'update', "orders_id = '".$orders['orders_id']."'");
//  tep_db_query("insert into " . TABLE_ORDERS . " (purchased_without_account) values ('1') where orders_id = '" . (int)$orders['orders_id'] . "'");
tep_db_query("delete from " . TABLE_ADDRESS_BOOK . " where customers_id = '" . tep_db_input($customer_id) . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS . " where customers_id = '" . tep_db_input($customer_id) . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS_INFO . " where customers_info_id = '" . tep_db_input($customer_id) . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET . " where customers_id = '" . tep_db_input($customer_id) . "'");
tep_db_query("delete from " . TABLE_CUSTOMERS_BASKET_ATTRIBUTES . " where customers_id = '" . tep_db_input($customer_id) . "'");
tep_db_query("delete from " . TABLE_WHOS_ONLINE . " where customer_id = '" . tep_db_input($customer_id) . "'");
if (!tep_session_is_registered('noaccount')){ 
tep_session_destroy();
}
}
// EOF: daithik change for PWA


 $content = CONTENT_CHECKOUT_SUCCESS;
 $javascript = 'popup_window_print.js';
 require(DIR_WS_TEMPLATES . TEMPLATE_NAME . '/' . TEMPLATENAME_MAIN_PAGE);

 require(DIR_WS_INCLUDES . 'application_bottom.php');
?>

Regards

 

?rjan

Link to comment
Share on other sites

The contribution is made for a ms2 version and you apply it with a creload version ou a ms2 with BTS.

 

So, it is not a same thing.

 

You have a syntax error because, you have

 

//<!-- Dette utf?res bare hvis betalingsform er cresco //-->
<?php

 

You open a php zone but you already are in a php zone.

 

You don't make a modification in the good file. Perhaps in catalog/templates/content/checkout_success.tpl.php

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...