Results 1 to 7 of 7

Help to link to different URL

This is a discussion on Help to link to different URL within the osCommerce 2.2 Modification Help forums, part of the osCommerce 2.2 Forums category; Hi, I posted this question to the other forum with no answer, I am wondering if we have nice expert ...

      
  1. #1
    New Member
    Join Date
    Oct 2004
    Posts
    16
    Rep Power
    0


    Default Help to link to different URL

    Hi,

    I posted this question to the other forum with no answer, I am wondering if we have nice expert here.

    I've just installed and setup an oscommerce site, when the customer goes through the checkout system, after completing the checkout (checkout_success.php) I want to link to different URL instead of index page. Can I do this? and how? I can't find any clues in the checkout_success.php.

    Any help appreciated.

    LJ

  2. #2
    New Member
    Join Date
    Oct 2004
    Posts
    16
    Rep Power
    0


    Default

    Below is the checkout_success.php. I want to find out which part is the bit to modify so that the user press "continue" on this page will link to different URL then the index.php.

    Please help!

    Li


    <?php
    /*
    $Id: checkout_success.php,v 1.49 2003/06/09 23:03:53 hpdl 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');

    // 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);

    tep_redirect(tep_href_link(FILENAME_DEFAULT, $notify_string));
    }

    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']);
    }
    }
    ?>
    <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html <?php echo HTML_PARAMS; ?>>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
    <title><?php echo TITLE; ?></title>
    <base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>">
    <link rel="stylesheet" type="text/css" href="stylesheet.css">
    </head>
    <body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0">
    <!-- header //-->
    <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
    <!-- header_eof //-->

    <!-- body //-->
    <table border="0" width="100%" cellspacing="3" cellpadding="3">
    <tr>
    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
    <!-- left_navigation //-->
    <?php require(DIR_WS_INCLUDES . 'column_left.php'); ?>
    <!-- left_navigation_eof //-->
    </table></td>
    <!-- body_text //-->
    <td width="100%" valign="top"><?php echo tep_draw_form('order', tep_href_link(FILENAME_CHECKOUT_SUCCESS, 'action=update', 'SSL')); ?><table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td><table border="0" width="100%" cellspacing="4" cellpadding="2">
    <tr>
    <td valign="top"><?php echo tep_image(DIR_WS_IMAGES . 'table_background_man_on_board.gif', HEADING_TITLE); ?></td>
    <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>
    <?php
    if ($global['global_product_notifications'] != '1') {
    echo TEXT_NOTIFY_PRODUCTS . '<br><p class="productsNotifications">';

    $products_displayed = array();
    for ($i=0, $n=sizeof($products_array); $i<$n; $i++) {
    if (!in_array($products_array[$i]['id'], $products_displayed)) {
    echo tep_draw_checkbox_field('notify[]', $products_array[$i]['id']) . ' ' . $products_array[$i]['text'] . '<br>';
    $products_displayed[] = $products_array[$i]['id'];
    }
    }

    echo '</p>';
    } else {
    echo TEXT_SEE_ORDERS . '<br><br>' . TEXT_CONTACT_STORE_OWNER;
    }
    ?>
    <h3><?php echo TEXT_THANKS_FOR_SHOPPING; ?></h3></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>
    <tr>
    <td align="right" class="main"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
    </tr>
    <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>
    <tr>
    <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td width="50%" align="right"><?php echo tep_draw_separator('pixel_silver.gif', '1', '5'); ?></td>
    <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
    </tr>
    </table></td>
    <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
    <td width="25%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
    <td width="25%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
    <tr>
    <td width="50%"><?php echo tep_draw_separator('pixel_silver.gif', '100%', '1'); ?></td>
    <td width="50%"><?php echo tep_image(DIR_WS_IMAGES . 'checkout_bullet.gif'); ?></td>
    </tr>
    </table></td>
    </tr>
    <tr>
    <td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_DELIVERY; ?></td>
    <td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_PAYMENT; ?></td>
    <td align="center" width="25%" class="checkoutBarFrom"><?php echo CHECKOUT_BAR_CONFIRMATION; ?></td>
    <td align="center" width="25%" class="checkoutBarCurrent"><?php echo CHECKOUT_BAR_FINISHED; ?></td>
    </tr>
    </table></td>
    </tr>
    <?php if (DOWNLOAD_ENABLED == 'true') include(DIR_WS_MODULES . 'downloads.php'); ?>
    </table></form></td>
    <!-- body_text_eof //-->
    <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2">
    <!-- right_navigation //-->
    <?php require(DIR_WS_INCLUDES . 'column_right.php'); ?>
    <!-- right_navigation_eof //-->
    </table></td>
    </tr>
    </table>
    <!-- body_eof //-->

    <!-- footer //-->
    <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
    <!-- footer_eof //-->
    <br>
    </body>
    </html>
    <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

  3. #3
    New Member
    Join Date
    Oct 2004
    Posts
    16
    Rep Power
    0


    Default

    I don't know anything of PHP, Only thing I can find in the code above that may indicated a link to the index page after press "continue - checkout_success" button is the code below:

    <tr>
    <td align="right" class="main"><?php echo tep_image_submit('button_continue.gif', IMAGE_BUTTON_CONTINUE); ?></td>
    </tr>
    <tr>
    <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
    </tr>

    If that is true, and how can I change it to link to a different URL then? Please help!

    LJ

  4. #4
    New Member
    Join Date
    Sep 2004
    Posts
    12
    Rep Power
    0


    Default

    <td align="right"><?php echo '<a href="http://www.yoursite">' . tep_image_button 'button_continue.gif',IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>

    Change the url to where you need to go and Replace that line you found with this one.

  5. #5
    New Member
    Join Date
    Oct 2004
    Posts
    16
    Rep Power
    0


    Default

    Thank you very much shy. I will have a go.

  6. #6
    New Member
    Join Date
    Sep 2004
    Posts
    12
    Rep Power
    0


    Default

    Yellowriver
    Let me know how it worked for you, I have it working on one of my sites.
    Mike

  7. #7
    New Member
    Join Date
    Sep 2004
    Posts
    12
    Rep Power
    0


    Default

    Sorry about the add here, but I also added the code to the Logoff as well.
    Mike

Similar Threads

  1. how do i change the TOP link to link to a different page
    By jcomputers in forum osCmax v2 Customization/Mods
    Replies: 1
    Last Post: 07-23-2006, 01:45 PM
  2. how do i change the home link to link to somewhere else?
    By jcomputers in forum osCmax v2 Customization/Mods
    Replies: 1
    Last Post: 07-22-2006, 10:01 PM
  3. how do i set a link active, if the link links to actual page
    By poschiman in forum osCommerce 2.2 Modification Help
    Replies: 0
    Last Post: 06-03-2006, 05:10 PM
  4. How can I ad a link to header.php
    By ozstar in forum osCmax v2 Customization/Mods
    Replies: 0
    Last Post: 12-04-2005, 03:50 PM
  5. How do I add a new link to an info box?
    By Anonymous in forum osCmax v1.7 Discussion
    Replies: 3
    Last Post: 09-11-2003, 02:33 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •