Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Loginbox Advanced!!!


Waza04

Recommended Posts

Written for osCommerce v2.2MS1/CVS

(not tested with other versions but, should

be compatible)

 

This is an update to Linda McGraths login box mod!! - This has to be already installed!!

 

This version has many more features!

 

Such as:

Elari's Customer Status Built-In

Linda's Download Controller Built-in

Recent Orders Built-in

Status Icons Built-in

 

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

Link to comment
Share on other sites

Having a slight problem as there is a function included in the loginbox.php that does not exist. Am I missing something?

 

                <td align="center" class="infoBoxContents">

                " . [b]tep_loginbox_greeting_top() [/b]. "

               </td>

Link to comment
Share on other sites

Hi Waza04...

 

I just installed your loginbox nicely over the original one (like it sais in you manual)... But I get a parce error on line 26 in "loginbox.php" when I open my main page.

if ( (!strstr($HTTP_SERVER_VARS['PHP_SELF'],'login.php')) and (!strstr($HTTP_SERVER_VARS['PHP_SELF'],'create_account.php')) and !tep_session_is_registered('customer_id') )  {

 

Any ideas anyone? I know a bit of programming but this is already over my head :oops: Just a bit to much "("'s and "[" 's for me :?

 

....

thanks in advance!

_____.:::.________###__________|/______

:(o o): . (o o) (o o)

ooO--(_)--Ooo-ooO--(_)--Ooo-ooO--(_)--Ooo-

Link to comment
Share on other sites

Thanx for the great support you're giving guys!

 

Really... this is speed service :D

Unfortunalty (can you hear me coming :lol: ) Now I get a new error:

Fatal error: Cannot redeclare tep_customer_greeting() (previously declared in c:phpdevwwwcatalogincludesfunctionsgeneral.php:930) in c:phpdevwwwcatalogincludesboxesloginbox.php on line 28

 

hmm...I can understand dat you can't redeclare an existing function. How does this happen?

 

can I get another dose of that speedy support? :lol:

nice going and thanks in advance!!!

 

DicE

_____.:::.________###__________|/______

:(o o): . (o o) (o o)

ooO--(_)--Ooo-ooO--(_)--Ooo-ooO--(_)--Ooo-

Link to comment
Share on other sites

Elari's customer status is not compatible with 2.2ms1.

but this contrib says elari's customer status is built in.

What does that mean exactly?

 

Quote:

>Elari's Customer Status Built-In

 

Thanks for any info.

brian

Link to comment
Share on other sites

Hi Brian!!

 

Elaris Customer Status can be used with this mod - if it already is installed!

 

So therefore - it isnt installed for you!

 

If you have it installed, according to the instruction you can enable some extra features of the loginbox that will be relative to elaris mods...

 

Hope that helps...

 

Warren

Link to comment
Share on other sites

Is there a site with an example of this?

 

Also, I was not able to find Linda's Login box mod int he contributions. I have been asking for a search feature for a while, but in the meantime I have gotten pretty good at using the interface and just guessing the title of the mod. If you can give me some pointers to find it, that would be great.

 

JG

Link to comment
Share on other sites

Such as:

Elari's Customer Status Built-In

Linda's Download Controller Built-in

Recent Orders Built-in

Status Icons Built-in

 

So are any of these things included in your Login box or do they just already need to be installed. I am confused by your post above about Elari's box.

[no external urls in signatures please, kthanks]

Link to comment
Share on other sites

OK - OK - OK!!!

 

People are getting confused!!

 

This mod dose NOT include ANY OTHER contribution!!!

 

However, if you have Lindas Download Controller and Box OR/AND Elari's Customer status - you can enable some features in the loginbox.php file for the login box to show the customer status options from elari and downloads remaning from linda!!

 

If these mods ARNT installeed - they wont work if you enable them!!!

 

Thanks,

Warren

Link to comment
Share on other sites

  • 3 weeks later...

I installed Linda's 5.2 login box, then Warren's 1.2 update but having a few problems. Several greeting variables seem to be missing from the English file, which is easy to fix. However, the functions aren't pulling the customer's name, at least for me.

 

Also, I'm getting a '.' instead of a pixel line after Log Off and after the status indicator light. Any ideas?

Link to comment
Share on other sites

[sorry for the re-post, but I failed to click "notify when reply is posted" and couldn't edit the original msg.]

 

 

I installed Linda's 5.2 login box, then Warren's 1.2 update but having a few problems. Several greeting variables seem to be missing from the English file, which is easy to fix. However, the functions aren't pulling the customer's name, at least for me.

 

Also, I'm getting a '.' instead of a pixel line after Log Off and after the status indicator light. Any ideas?

Link to comment
Share on other sites

I fixed my pixel display problem...had to tweak html_output.php from previously installed mod. Still don't have the customer's name showing in the greeting, but it's no biggie. I liked the way the original Wishlist mod included more info about the contents of the list, so I hacked up the loginbox code to add the original Wishlist mod (minus the separate info box) and remove the standalone box from my right column. Here's the code I inserted after the Order History block and before the Linda's Download Controller section:

 

//MOD - added wishlist from separate box into loginbox

$info_box_contents[] = array('align' => 'left',

                                'text' => tep_draw_separator()

                          );

$info_box_contents[] = array('align' => 'left',

                              'text'  => WISHLIST_LINKS_TEXT . '<br>');

                              

$wishlist_query = tep_db_query("select * from " . TABLE_WISHLIST . " WHERE customers_id=$customer_id");



if (tep_db_num_rows($wishlist_query)) {

if (tep_db_num_rows($wishlist_query) < MAX_DISPLAY_WISHLIST_BOX) {

   $product_ids = '';

   while ($wishlist = tep_db_fetch_array($wishlist_query)) {

     $product_ids .= $wishlist['products_id'] . ',';

   }

   $product_ids = substr($product_ids, 0, -1);



   $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "n";

   $products_query = tep_db_query("select products_id, products_name from " . TABLE_PRODUCTS_DESCRIPTION . " where products_id in (" . $product_ids . ") and language_id = '" . $languages_id . "' order by products_name");

   while ($products = tep_db_fetch_array($products_query)) {

     $customer_wishlist_string .= '  <tr>' . "n" .

                                '    <td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'cPath=' . tep_get_product_path($products['products_id']) . '&products_id=' . $products['products_id'], 'NONSSL') . '">' . $products['products_name'] . '</a></td>' . "n" .

        '   </tr>' . "n" .

        '   <tr>' . "n" .

                                '    <td class="infoBoxContents" align="center" valign="bottom"><b><a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=cust_order&pid=' . $products['products_id'] . '&rfw=1', 'NONSSL') . '">Move to Cart</a> |' . "n" .

                                '    <a href="' . tep_href_link(basename($PHP_SELF), tep_get_all_get_params(array('action')) . 'action=remove_wishlist&pid=' . $products['products_id'], 'NONSSL') . '">Delete</a></b></td>' . "n" .

                                '  </tr><tr><td class="infoBoxContents" valign="top">' . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5') . tep_draw_separator('pixel_black.gif', '100%', '1') . tep_image(DIR_WS_IMAGES . 'pixel_trans.gif', '', '1', '5') . '</td></tr>' . "n";

   }

  } else {

   $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "n";

$customer_wishlist_string .= '<tr><td class="infoBoxContents">' . sprintf(TEXT_WISHLIST_COUNT, tep_db_num_rows($wishlist_query)) . '</td></tr>' . "n";

  }

} else {

   $customer_wishlist_string = '<table border="0" width="100%" cellspacing="0" cellpadding="0">' . "n";

$customer_wishlist_string .= '<tr><td class="infoBoxContents">' . BOX_WISHLIST_EMPTY . '</td></tr>' . "n";

}

   $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="' . tep_href_link(FILENAME_WISHLIST, '','NONSSL') . '"><u>View ' . BOX_HEADING_CUSTOMER_WISHLIST . '</u> [+]</a></td></tr>' . "n";

   $customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="javascript:popupWindowWishlist('' . tep_href_link('popup_' . FILENAME_WISHLIST_HELP, '','NONSSL') . '')"><u>'. BOX_HEADING_CUSTOMER_WISHLIST . ' Help</u> [?]</a></td></tr>' . "n"; // Popup link

   //$customer_wishlist_string .= '<tr><td colspan="3" align="right" class="smallText"><a href="' . tep_href_link(FILENAME_WISHLIST_HELP, '','NONSSL') . '"><u>'. BOX_HEADING_CUSTOMER_WISHLIST . ' Help</u> [?]</a></td></tr>' . "n"; // Normal link

   $customer_wishlist_string .= '</table>';



   $info_box_contents[] = array('align' => 'left',

                                'text'  => $customer_wishlist_string);

Link to comment
Share on other sites

The greeting text uses its own function - Here is the code which should be placed in your general.php file...

 

Locate the following code in /catalog/includes/functions/general.php... 



// Return a customer greeting

 function tep_customer_greeting() {

   global $customer_id, $customer_first_name;



   if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {

     $greeting_string = sprintf(TEXT_GREETING_PERSONAL, $customer_first_name, tep_href_link(FILENAME_PRODUCTS_NEW, '', 'NONSSL'));

   } else {

     $greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));

   }



   return $greeting_string;

 }



////



Add the following functions just below it... 



// Return a loginbox infobox customer greeting top

 function tep_loginbox_greeting_top() {

   global $customer_id, $customer_first_name;



   if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {

     $greeting_loginbox_top_string = sprintf(LOGINBOX_GREETING_TOP_PERSONAL, $customer_first_name, tep_href_link(FILENAME_PRODUCTS_NEW, '', 'NONSSL'));

   } else {

     $greeting_loginbox_top_string = sprintf(LOGINBOX_GREETING_TOP_GUEST, tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));

   }



   return $greeting_loginbox_top_string;

 }



////

// Return a loginbox infobox customer greeting bottom

 function tep_loginbox_greeting_bottom() {

   global $customer_id, $customer_first_name;



   if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {

     $greeting_loginbox_bottom_string = sprintf(LOGINBOX_GREETING_BOTTOM_PERSONAL, $customer_first_name, tep_href_link(FILENAME_PRODUCTS_NEW, '', 'NONSSL'));

   } else {

     $greeting_loginbox_bottom_string = sprintf(LOGINBOX_GREETING_BOTTOM_GUEST, tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));

   }



   return $greeting_loginbox_bottom_string;

 }



////

 

The wishlist is something to be included in the next update for sure - thanks for the suggestion!!

 

Warren

Link to comment
Share on other sites

Thanks for the code. I really wanted to use the personalized greeting function. I just added the 2 functions to general.php, but getting this error:

 

Fatal error: Cannot redeclare tep_loginbox_greeting_top() (previously declared in c:abria merlinapachehtdocscatalogincludesfunctionsgeneral.php:942) in c:abria merlinapachehtdocscatalogincludesboxesloginbox.php on line 20

 

What does this mean?

 

Thanks

Lee

Link to comment
Share on other sites

OKOKOK - Take that bit of code out 9The whole of what I told you to add)

 

And install loginbox 5.2 Extended from the contributions...

 

Then install my mod...

 

Try that...

 

Warren

Link to comment
Share on other sites

Warren,

 

I installed your loginbox, but I think I'm missing something since , once logged in as a registered user, the box displayed in the column_left.php shows too many green lights and there's no definition for reseller discount ( 20%).

 

Try to log in as:

[email protected]

PWD=test

 

Thanks

Franco

Outside links in signatures are not allowed!

Link to comment
Share on other sites

Warren,

 

I have CS installed ( if you log as a guest user you get regular prices instead of discounted ones... )

 

Any suggestions ? seems like I have to edid some language files

 

For instance, I put the description ' Quantity discount' by editing the file boxes/loginbox.php, otherwise it only displayed ' 0.00%' next to the green dot...

 

Thanks

Outside links in signatures are not allowed!

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...