Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

How Do I: Box for login and Dynamic Contact Info?


tamogila

Recommended Posts

Hey guys...Great little project you have here. I'm trying to make a shop with just some basic customization, and don't want to go crazy with contributions (probably for my next store). I'm sure my questions have been answered, but I get so many search results when I look for login and contact info that I can't find the answer.

 

1. Has someone made a "login" box to add to column_right.php? If so, can someone link it, or help me with search terms to use?

 

2. I want to add name/address/phone to my contact page. Ultimately I would like to use the information that is gathered from the admin "My Store" page, but I can't figure out where it's being stored. Even if I did know where it was stored, it doesn't mean that I could figure out how to code it, but at least it's a start. If someone could tell me where it is that would be great, if someone could tell me how to code the contact page that would be even awesomer.

 

Thanks...

Link to comment
Share on other sites

yes, just seach addons.oscommerce.com for login box - it wont be specific to the right column, oyu just put it there yourself. I took that contribution and put it into my header instead..

 

When you say add name added, ect on contact us.. did you mean add the name and address of YOUR store, or do you want to ask that from your customer?

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

yes, just seach addons.oscommerce.com for login box - it wont be specific to the right column, oyu just put it there yourself. I took that contribution and put it into my header instead..

 

When you say add name added, ect on contact us.. did you mean add the name and address of YOUR store, or do you want to ask that from your customer?

 

Thanks...I guess I should add that page to my favorites. Yes, the name and address of the shop. In admin/my store, it asks for that information, so it must be using that to define a php name somewhere. I'd like to use that to populate contact info on the contact us page.

Link to comment
Share on other sites

i think it puts it in your footer..

 

I literally JUST learned how to customize the contact us.. look at my most recent post here..

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

i think it puts it in your footer..

 

I literally JUST learned how to customize the contact us.. look at my most recent post here..

 

Must be a contact page day today. I'm hoping not to have to go the static route; hopefully someone else will be able to help.

 

Also, did you have any problems with the login box? I'm getting this error at the top of every page, and none of the text is in the login box, just some code.

 

// LoginBox Text require(DIR_WS_LANGUAGES . $language . '/' . 'loginbox.php');

 

I checked ten times, and I put loginbox.php in my language/english/ folder.

Link to comment
Share on other sites

can i see a link to your page??

 

also, what did you want to do for your contacts page??

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

post the code for application_top or header.php

 

i think that is where your issue is.

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

post the code for application_top or header.php

 

i think that is where your issue is.

 

I didn't change anyghing in those files for the login box, and it was working fine before. It's possible that some other changes I made conflict with this box, BUT my guess is the problem is with my functions/general.php file. That's the only part of the login box instal that wasn't perfectly clear. It says to find greeting_string, and put a bunch of code after that function, but I wasn't sure where that function ended and just guessed. Here is what I have for that section:

 

////
// 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, tep_output_string_protected($customer_first_name), tep_href_link(FILENAME_PRODUCTS_NEW));
} else {
  $greeting_string = sprintf(TEXT_GREETING_GUEST, tep_href_link(FILENAME_LOGIN, '', 'SSL'), tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
}

return $greeting_string;
 }

// Return a loginbox infobox customer greeting top
 function tep_box_greeting_top() {
global $customer_id, $customer_first_name;

if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {
  $greeting_box_top_string = sprintf(BOX_GREETING_TOP_PERSONAL, $customer_first_name, tep_href_link(FILENAME_PRODUCTS_NEW, '', 'NONSSL'));
} else {
  $greeting_box_top_string = sprintf(BOX_GREETING_TOP_GUEST, tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
}

return $greeting_box_top_string;
 }

////
// Return a loginbox infobox customer greeting bottom
 function tep_box_greeting_bottom() {
global $customer_id, $customer_first_name;

if (tep_session_is_registered('customer_first_name') && tep_session_is_registered('customer_id')) {
  $greeting_box_bottom_string = sprintf(BOX_GREETING_BOTTOM_PERSONAL, $customer_first_name, tep_href_link(FILENAME_PRODUCTS_NEW, '', 'NONSSL'));
} else {
  $greeting_box_bottom_string = sprintf(BOX_GREETING_BOTTOM_GUEST, tep_href_link(FILENAME_CREATE_ACCOUNT, '', 'SSL'));
}

return $greeting_box_bottom_string;
 }

////
//! Send email (text/html) using MIME

Link to comment
Share on other sites

I backed out my changes, so there are no errors, but I'd still like to get this to work.

 

I'm tring to use the "loginbox best" add-on. here

 

I followed the directions, uploading the images, loginbox.php and these are the code changes I made:

 

1. See post above for changes to functions/general.php

 

2. In the column_right.php file:

 

 Copyright (c) 2003 osCommerce

 Released under the GNU General Public License
*/

// BOF: WebMakers Added: Login Box My Account
require(DIR_WS_BOXES . 'loginbox.php');
// EOF: WebMakers Added: Login Box My Account 

 require(DIR_WS_BOXES . 'shopping_cart.php');

 

3. At the end of the english.php file:

 

 

define('FOOTER_TEXT_BODY', 'Copyright © ' . date('Y') . ' <a href="' . tep_href_link(FILENAME_DEFAULT) . '">' . STORE_NAME . '</a><br>Powered by <a href="http://www.oscommerce.com" target="_blank">osCommerce</a>');
?>

// LoginBox Text
require(DIR_WS_LANGUAGES . $language . '/' . 'loginbox.php');

 

Any sugestions?

Link to comment
Share on other sites

when you view the code in the english.php file in a code viewer, does the code that says //LoginBox Text come up grey? You can completely delete that, i THINK that might be what is screwing it up. Take part out completely and just leave the code there and see what happens.. Then try to take out the ENTIRE code out of languages to see what is happening..

 

It might help us narrow things down a little... I THINK this was the issue i was having with this box, and there is a fix, i just cant remember.. but i will try to help.

 

the one things that is confusing me is that usually the english.php file has code in it like define('LOGIN_BOX_TEXT','Type your text here'); which is the code that defines a text.. the code that it is telling you to put in there seems to be defining or calling for a file, which USUALLY would be put in the filenames.php folder.. But i'm not sure. I am DEFINITELY not a coder and am just thinking out loud here

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

Thanks Lindsay... You inspired me to beat the crap out of that line of code, and I now have it working.

 

The directions said to put the code at the bottom of english.php, so that's what I did:

 

href="http://www.oscommerce.com" target="_blank">osCommerce</a>');
?>

// LoginBox Text
require(DIR_WS_LANGUAGES . $language . '/' . 'loginbox.php');

 

Turn out that the bottom doensn't really mean the bottom. It means at the bottom, but above the

 

?>

 

so it should look like this:

 

href="http://www.oscommerce.com" target="_blank">osCommerce</a>');

// LoginBox Text
require(DIR_WS_LANGUAGES . $language . '/' . 'loginbox.php');
?>

 

Now on to the dynamic contact us page... well later tonight.

Link to comment
Share on other sites

hah.. YEP.. whenever it says bottom, they NEVER mean after the last closing <?php tag.

 

When you say dynamic contact us page, what do you want it to do?? I just did mine over. I wou;dnt call it "dynamic" it just has the basic code for the comment box, but i added the phone and address into new tables and orgnazed it.

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

hah.. YEP.. whenever it says bottom, they NEVER mean after the last closing <?php tag.

 

When you say dynamic contact us page, what do you want it to do?? I just did mine over. I wou;dnt call it "dynamic" it just has the basic code for the comment box, but i added the phone and address into new tables and orgnazed it.

 

Go to your admin panel, and click "My Store", toward the bottom is the "Store Address and Phone" section. It says "This is the Store Name, Address and Phone used on printable documents and displayed online" which means the value is stored in the database, and can be called by php. I want to use that call on the Contact Us page (in the same place that you have your contact info) so when it's updated via the admin panel it is also updated on the contact us page.

 

EDIT: I found an add-on that looks like it will do the trick:

http://addons.oscommerce.com/info/399

I'll have to try it out later.

Link to comment
Share on other sites

oh i see.. that would be kind of useless to me since i have multiple departments and all. not just one email address. what WOULD be nice is to have a dropdown menu where the person can pick which department they want to email to arrive at.

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

I am testing the login box and it works well. My problem is that I attempted to remove the "Welcome Guest..." line on the index page and I ended up with this:

 

greeting.jpg

 

This is the code that I commented out in the /includes/languages/english/english.php file:

 

/*
//define('TEXT_GREETING_PERSONAL', 'Welcome back <span class="greetUser">%s!</span> Would you like to see which <a href="%s"><u>new products</u></a> are available to purchase?');
//define('TEXT_GREETING_PERSONAL_RELOGON', '<small>If you are not %s, please <a href="%s"><u>log yourself in</u></a> with your account information.</small>');
//define('TEXT_GREETING_GUEST', 'Welcome <span class="greetUser">Guest!</span> Would you like to <a href="%s"><u>log yourself in</u></a>? Or would you prefer to <a href="%s"><u>create an account</u></a>?');
*/

 

Anyone have any idea why the "TEXT_GREETING_GUEST" is showing up?

Link to comment
Share on other sites

because even though the DEFINE for TEXT_GREETING_GUEST is commented out, it is still calling for it on the index.php page, if you go there,you should see the actual code for the greeting. you can just delete that or comment it out.

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

because even though the DEFINE for TEXT_GREETING_GUEST is commented out, it is still calling for it on the index.php page, if you go there,you should see the actual code for the greeting. you can just delete that or comment it out.

 

Lindsay,

 

I had just found it about ten minutes ago. Thanks for the reply though.

Link to comment
Share on other sites

glad it all worked out.. atleast anyone else who has the same issue can come here for an answer though.

A great place for newbies to start

Road Map to oscommerce File Structure

DO NOT PM ME FOR HELP. My time is valuable, unless i ask you to PM me, please dont. You will get better help if you post publicly. I am not as good at this as you think anyways!

 

HOWEVER, you can visit my blog (go to my profile to see it) and post a question there, i will find time to get back and answer you

 

Proud Memeber of the CODE BREAKERS CLUB!!

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...