Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

order confirmation page


lastblackjellybean

Recommended Posts

I need to add a few lines of javascript to the order confirmation page. Where would be the best place to insert this code? Thankyou

Avoid placing anything with PHP Tags - <?php ?>

 

search body closing tag </body> and place it just below it.

 

Cheers,

Gaurav

Best Regards,
Gaurav

Link to comment
Share on other sites

Avoid placing anything with PHP Tags - <?php ?>

 

search body closing tag </body> and place it just below it.

 

Cheers,

Gaurav

 

Thankyou for your quick reply but which page should i add the code to? at the minute i am trying includes/languages/english/checkout_success.php but there are no body tags so i'm guessing this is the wrong file to edit.

Link to comment
Share on other sites

includes/languages/english/checkout_success.php

 

this was naerly correct

 

it's checkout_success.php in the catalog folder

 

javascript code should be between

 

<head>

and

</head>

 

e.g:

<head>

<script language="javascript">

<!--

function test() {

}

//-->

</script>

</head>

 

 

or

 

<head>

<script type="text/javascript" src="javascriptcode.js"></script>

</head>

Link to comment
Share on other sites

includes/languages/english/checkout_success.php

 

this was naerly correct

 

it's checkout_success.php in the catalog folder

 

javascript code should be between

 

<head>

and

</head>

 

e.g:

<head>

<script language="javascript">

<!--

function test() {

}

//-->

</script>

</head>

or

 

<head>

<script type="text/javascript" src="javascriptcode.js"></script>

</head>

 

 

So i add the <head> and </head> tags myself with the script? can these be anywhere in the file.

 

Thankyou for the help so far

Link to comment
Share on other sites

I just tried adding the head tags myself as there were none in the file mentioned, and got the following error on the order success page:

 

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/tinybask/public_html/checkout_success.php:4) in /home/tinybask/public_html/includes/functions/sessions.php on line 97

 

 

 

Sorry this is proving so complicated

Link to comment
Share on other sites

this is completly wrong, you are editing the wrong file!!!!

 

 

ITS NOT

includes/languages/english/checkout_success.php

 

this is a language file without any html tags

 

 

 

 

open your catalog folder

and edit checkout_success.php

Link to comment
Share on other sites

Sorry for the last comment, it was unrelated and i had left a bit of code in there from when i tried it before. However i am now looking at checkout_success.php in the catalog folder. The entrie file is below, where should i insert the code?

 

Thanks

 

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

 osCommerce, Open Source E-Commerce Solutions
 [url="http://www.oscommerce.com"]http://www.oscommerce.com[/url]

 Copyright © 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
// 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');
?>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...