Contributions
Add customer details v1
If you go to the contact us page - you used to have to add your name and email address - even if you are logged in.
Now if you add this small contribution, your customers can save a few seconds by allowing information already saved in their customer account to be dropped into the name and email address boxes.
Expand All / Collapse All
A little correction to previous version. This contrib will work properly only if add 2 lines of code:
If you installed v1.1 do following:
FIND:
if (tep_session_is_registered('customer_id')) {
echo '<strong>' . $name . '</strong>';
REPLACE TO:
if (tep_session_is_registered('customer_id')) {
echo tep_draw_hidden_field('name', $name);
echo '<strong>' . $name . '</strong>';
FIND:
if (tep_session_is_registered('customer_id')) {
echo '<strong>' . $email . '</strong>';
REPLACE TO:
if (tep_session_is_registered('customer_id')) {
echo tep_draw_hidden_field('email', $email);
echo '<strong>' . $email . '</strong>';
or you can simple replace attached contact_us.php file.
FULL PACKAGE. Instructions upgraded.
if the customer is logged in, his name and email-address is displayed as a bold text instead of an input-field.
screenshot included, full package.
I couldn't get this to work until I came across a lil contrib from lildog which "put me on the right scent". It involves modifying two additional lines (in case anyone else has trouble getting the boxes to auto fill, you might want to give this a shot since it is a great convenience)
in contact_us.php
FIND
<td class="main"><?php echo tep_draw_input_field('name'); ?></td>
REPLACE WITH
<td class="main"><?php echo tep_draw_input_field('name',($name)?$name:''); ?></td>
FIND
<td class="main"><?php echo tep_draw_input_field('email'); ?></td>
REPLACE WITH
<td class="main"><?php echo tep_draw_input_field('email',($email)?$email:''); ?></td>
good luck!
If you go to the contact us page - you used to have to add your name and email address - even if you are logged in.
Now if you add this small contribution, your customers can save a few seconds by allowing information already saved in their customer account to be dropped into the name and email address boxes.
Note: Contributions are used at own risk.