Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Configuring special user accounts


Booker

Recommended Posts

Posted

Before I get into details, I just want to say this is a great piece of software and I'm enjoying customizing it. I'm not a programmer at all and it took a bit of getting into this, but the way it has been laid out makes things easy to follow. The FAQ certainly helps a lot as well :)

 

Well, now I've run into a snag in my configuring of user accounts. What I want to do is make two different types of accounts. One will be for normal consumers, which doesn't need much adjustment at all from the original setup. The second is what I'm having a problem with. I am trying to find a way to identify these special accounts. In the My Account page, I want to have an additional button to an extra page of features for these special accounts.

 

What I've done so far, is set the Company setting to False, so it doesn't appear on anybody's account page. I then thought it might be easy to use this setting to identify which customers are my *special* customers. So, in the admin settings, I've configured things so that I can add text to the Company box without the users ever seeing what is there (it doesn't appear under My Account, but I can add a value to this setting in the Customers section in administration).

 

Next, I have been trying to write an "If" statement, where the special customers will see the extra button on the bottom of their My Account page and the regular customers will see the regular buttons.

 

My problem here is the actual "If" statement. I tried to copy a statement from other parts of the program and adjust to my needs, but it doesn't seem to want to work. I don't know what I am doing wrong with this. Could somebody please check my code and see if they can point out anything that may help?

 

The code is in the "account.php" file:

 

<?php

if (ENTRY_COMPANY_TEXT == 'special') {

?>

           <td align="center" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . tep_image_button('button_history.gif', IMAGE_BUTTON_HISTORY) . '</a>'; ?></td>

           <td align="center" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_NOTIFICATIONS, '', 'SSL') . '">' . tep_image_button('button_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '</a>'; ?></td>

           <td align="center" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . tep_image_button('button_edit_account.gif', IMAGE_BUTTON_EDIT_ACCOUNT) . '</a>'; ?></td>

           <td align="center" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_SPECIAL_ACCOUNT, '', 'SSL') . '">' . tep_image_button('button_special_account.gif', IMAGE_BUTTON_SPECIAL_ACCOUNT) . '</a>'; ?></td>

<?php

} else {

?>

           <td align="center" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_HISTORY, '', 'SSL') . '">' . tep_image_button('button_history.gif', IMAGE_BUTTON_HISTORY) . '</a>'; ?></td>

           <td align="center" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_PRODUCT_NOTIFICATIONS, '', 'SSL') . '">' . tep_image_button('button_notifications.gif', IMAGE_BUTTON_NOTIFICATIONS) . '</a>'; ?></td>

           <td align="center" class="main"><?php echo '<a href="' . tep_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL') . '">' . tep_image_button('button_edit_account.gif', IMAGE_BUTTON_EDIT_ACCOUNT) . '</a>'; ?></td>

          <td align="center" class="main"></td>

<?php

}

?>

 

From the above, you can see that what I want to do is add the word "special" in the company box in the administration files. This will add the *Special* button onto the My Account page, where the user can then go to the *Special* page. My problem is that

if (ENTRY_COMPANY_TEXT == 'special')

doesn't recognize the text I enter into the administration page... What can I do?

Posted

Try replacing

if (ENTRY_COMPANY_TEXT == 'special')

with

if ($account['entry_company'] == 'special')

Regards, Wizzud

"It is better to remain silent and be thought a fool, than to open your mouth and remove all doubt."

Posted

Thanks so much, Wiz. Works perfectly now :D

 

I can't believe how many different types of text I used for that line without it working. Now I'll be better prepared for the next time 8)

Archived

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

×
×
  • Create New...