Simlpe login box in oscommerce

Oct 18, 2011   //   by admin   //   osCommerce Solutions  //  1 Comment

 

How to integrate a simple login box in oscommerce, please check the following steps bellow.

////////////////////////////////////////////

<!--?php if (!tep_session_is_registered('customer_id')) { ?-->

<!--?php echo tep_draw_form('login', tep_href_link(FILENAME_LOGIN, 'action=process', 'SSL'), 'post', '', true); ?-->
<span style="float: left;">E-Mail Address:</span>

<input style="width: 90%;" type="text" name="email_address" size="10" />

<span style="float: left;">Password:</span>

<input style="width: 90%;" type="password" name="password" size="10" />

<!--?php echo tep_image_submit('sign-in.png', IMAGE_BUTTON_LOGIN, 'SSL'); ?-->

<a href="<?php echo tep_href_link('password_forgotten.php')?>">Password Forgotten ?</a>
<a href="<?php echo tep_href_link('create_account.php')?>">New Account</a>

<!--?php } else { ?-->

<!--?php echo<br ?-->
'    <a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . MODULE_BOXES_LOGIN_BOX_ACCOUNT_INFORMATION . '</a>
' .
'    <a href="' . tep_href_link(FILENAME_ADDRESS_BOOK, '', 'SSL') . '">' . MODULE_BOXES_LOGIN_BOX_ACCOUNT_ADDRESS_BOOK . '</a>
' .
'    <a href="' . tep_href_link(FILENAME_ACCOUNT_PASSWORD, '', 'SSL') . '">' . MODULE_BOXES_LOGIN_BOX_ACCOUNT_PASSWORD . '</a>
' .
'    <a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . MODULE_BOXES_LOGIN_BOX_ACCOUNT_ORDERS_VIEW . '</a>
' .
'    <a href="' . tep_href_link(FILENAME_ACCOUNT_NEWSLETTERS, '', 'SSL') . '">' . MODULE_BOXES_LOGIN_BOX_ACCOUNT_EMAIL_NOTIFICATIONS_NEWSLETTERS . '</a>
' .
'    <a href="' . tep_href_link(FILENAME_ACCOUNT_NOTIFICATIONS, '', 'SSL') . '">' . MODULE_BOXES_LOGIN_BOX_ACCOUNT_EMAIL_NOTIFICATIONS_PRODUCTS . '</a>
' .
'    <a href="' . tep_href_link(FILENAME_LOGOFF, '', 'SSL') . '">' . MODULE_BOXES_LOGIN_BOX_ACCOUNT_LOGOFF . '</a>'; ?>

<!--?php } ?-->

//////////////////////////////////////////////

Redirect Issue:

Basically this line needs to be added to the top of every page

//////////////////////////////////////////////
$navigation->set_snapshot();
//////////////////////////////////////////////

Option 2: Go to your login.php file and change:

//////////////////////////////////////////////
// restore cart contents
 $cart->restore_contents();
 if (sizeof($navigation->snapshot) > 0) {
 $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
 $navigation->clear_snapshot();
 tep_redirect($origin_href);
//////////////////////////////////////////////

to:

//////////////////////////////////////////////
// restore cart contents
 $cart->restore_contents();
echo "<script type="text/javascript">// <![CDATA[
 history.go(-2);
// ]]></script>";
 die();
 if (sizeof($navigation->snapshot) > 0) {
 $origin_href = tep_href_link($navigation->snapshot['page'], tep_array_to_string($navigation->snapshot['get'], array(tep_session_name())), $navigation->snapshot['mode']);
 $navigation->clear_snapshot();
 tep_redirect($origin_href);
//////////////////////////////////////////////

That’s it.

1 Comment

  • You are so cool! I dont suppose Ive read anything like this before. So nice to search out any person with some original ideas on this subject. realy thank you for starting this up. this web site is something that’s wanted on the net, someone with somewhat originality. useful job for bringing something new to the internet!

Leave a comment

 

Sponsors