Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How to eliminate the pop-up window on login.php


kahml

Recommended Posts

Tired of pop-up windows? I know I am. Well, there?s one hiding in plain sight on the login.php page. If you want to show a full page of text, then this tip is for you!

 

There are five parts to this procedure.

 

1. Replace your existing catalog/info_shopping_cart.php page so that it is a full page

2. Modify your existing catalog/includes/language/english/info_shopping_cart.php page

3. Modify your existing catalog/login.php to eliminate the JavaScript

4. Modify your existing catalog/includes/language/english/login.php page to display the full page instead of a pop-up

5. Test your changes

 

Important note: As with any other form of customization in osCommerce, please make sure you create back-up copies of any files that you change before you begin.

 

Now, let?s get to it.

 

To begin, edit catalog/info_shopping_cart.php. Replace the contents of your file with the following code.

 

Note: If you have already customized this page, compare the two files and merge the results, as needed.

 

<?php
/*
 $Id: info_shopping_cart.php,v 1.19 2003/02/13 03:01:48 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');

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_INFO_SHOPPING_CART);

 $breadcrumb->add(NAVBAR_TITLE, tep_href_link(FILENAME_INFO_SHOPPING_CART));

?>
<!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"><table border="0" width="100%" cellspacing="0" cellpadding="0">
     <tr>
       <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
         <tr>
           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td>
         </tr>
       </table></td>
     </tr>
     <tr>
 <td valign="top"><br>
   <p class="main"><b><i><?php echo SUB_HEADING_TITLE_1; ?></i></b><br><?php echo SUB_HEADING_TEXT_1; ?></p>
   <p class="main"><b><i><?php echo SUB_HEADING_TITLE_2; ?></i></b><br><?php echo SUB_HEADING_TEXT_2; ?></p>
   <p class="main"><b><i><?php echo SUB_HEADING_TITLE_3; ?></i></b><br><?php echo SUB_HEADING_TEXT_3; ?></p>
 </td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
     </tr>
     <tr>
       <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox">
         <tr class="infoBoxContents">
           <td><table border="0" width="100%" cellspacing="0" cellpadding="2">
             <tr>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
               <td align="right"><?php echo '<a href="' . tep_href_link(FILENAME_LOGIN) . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td>
               <td width="10"><?php echo tep_draw_separator('pixel_trans.gif', '10', '1'); ?></td>
             </tr>
           </table></td>
         </tr>
       </table></td>
     </tr>
   </table></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'); ?>

 

Save your changes and end the edit session.

 

Next, edit catalog/includes/languages/english/info_shopping_cart.php.

 

Add the following definition to the top of the list:

 

define('NAVBAR_TITLE', 'Visitors Cart / Members Cart');

 

Save your changes and end the edit session.

 

Next, edit catalog/login.php.

 

Find the following lines of code:

 

<script language="javascript"><!--
function session_win() {
 window.open("<?php echo tep_href_link(FILENAME_INFO_SHOPPING_CART); ?>","info_shopping_cart","height=460,width=430,toolbar=no,statusbar=no,scrollbars=yes").focus();
}
//--></script>

 

Delete them from the file (yep, they are no longer necessary). If you want, you can put in an HTML comment to indicate that you did so.

 

Save your changes and end the edit session.

 

Finally, edit catalog/includes/languages/english/login.php.

 

Find the following line of code (it spans more than one line):

 

define('TEXT_VISITORS_CART', '<font color="#ff0000"><b>Note:</b></font> Your "Visitors Cart" contents will be merged with your "Members Cart" contents once you have logged on. <a href="javascript:session_win();">[More Info]</a>');

 

Comment it out entirely and add the following code immediately after it:

 

define('TEXT_VISITORS_CART', '<font color="#ff0000"><b>Note:</b></font> Your "Visitors Cart" contents will be merged with your "Members Cart" contents once you have logged on. <a href="' . tep_href_link(FILENAME_INFO_SHOPPING_CART) . '">[More Info]</a>');

 

Save your changes and end the edit session.

 

Now it is time to test your changes.

 

Open up your browser to your store?s home page and search for, or display, a product.

 

Add the product to your shopping cart.

 

Click on the link to checkout so that the login.php page is displayed.

 

Click on the [More Info] link to display the additional information.

 

Click the Continue button at the bottom of the page to return to the login.php page.

 

That?s it!

 

Larry

Link to comment
Share on other sites

I'm not so much concerned on >my< end as administrator; I'll configure my workstation accordingly.

 

But it is the customer that I'm trying to look out for. They may (or may not) have JavaScript on their machine. They may have some form of pop-up blocker enabled that prevents the window from forming.

 

If I can remove small constraints that have been placed in the code, the end result for the customer is "ease of use." And then I don't have to wonder/worry/concern myself with what a potential customer runs on the client side.

 

Larry

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...