Forums / Bug Reports / [DONE] Bug in referrals field of account-edit template

[DONE] Bug in referrals field of account-edit template

Locked

Started by glasshoppah on 25 Jun 2006, 7:10 AM · Views: 2,230

Results 1 to 3 of 3
This thread is locked. New replies are disabled.
25 Jun 2006, 7:10 AM
#1
glasshoppah avatar

glasshoppah

New Zenner

Join Date:
Apr 2006
Location:
Kaneohe, Hawaii USA
Posts:
15
Plugin Contributions:
0

[DONE] Bug in referrals field of account-edit template

/includes/modules/pages/account_edit/header_php.php

I had what appeared to be a seamless upgrade from 1.3.0.1 to 1.3.0.2 the other day. Quite impressive with the list of changed of changed files (applauds the dev team for making it so simple). I have a slight problem though...

When testing the account edit page, the referral code is listed twice in the form--once with a form field and once with just the referral code text.

ie:

referral code: [blank form field]
referral code:

I'm not sure if this was something I did during the file merge, or if it was an oversight or glitch in the upgrade file? Is it possible this is supposed to list an existing code that perhaps wasn't in the previous version? I'm sure it's something minor, but I just can't see it.

Any help would be appreciated. PM me for a login/password if needed.
Thanks,
-Christine

808's ZenCart: http://808StockPhoto.com/gallery/
Royalty Free Stock Photos at 808 Stock Photography: http://808StockPhoto.com/

25 Jun 2006, 7:24 AM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,511
Plugin Contributions:
176

Re: [DONE] Bug in referrals field of account-edit template

Hmm .... well .... that would be a bug !
:eek:

It only occurs if you have the "Customers Referral Status" from Admin->Configuration->Customer Details page set to "2"

includes/templates/template_default/templates/tpl_account_edit_default.php
starting on line 64, you have:```php

<?php if (CUSTOMERS_REFERRAL_STATUS == 2 and $customers_referral == '') { ?>

<label class="inputLabel" for="customers-referral"><?php echo ENTRY_CUSTOMERS_REFERRAL; ?></label>

<?php echo zen_draw_input_field('customers_referral', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_referral', 15), 'id="customers-referral"'); ?> <br class="clearBoth" /> <?php } ?> <?php if (CUSTOMERS_REFERRAL_STATUS == 2 and $customers_referral == '') { ?>

<label for="customers-referral-readonly"><?php echo ENTRY_CUSTOMERS_REFERRAL; ?></label>

<?php echo $customers_referral; zen_draw_hidden_field('customers_referral', $customers_referral,'id="customers-referral-readonly"'); ?> <br class="clearBoth" /> <?php } ?> ```

The fix is to change the SECOND line saying this:php if (CUSTOMERS_REFERRAL_STATUS == 2 and $customers_referral == '') { to this:```php
if (CUSTOMERS_REFERRAL_STATUS == 2 and $customers_referral != '') {

(note: the != instead of == )


Thus, the same block of code becomes:```php
<?php
  if (CUSTOMERS_REFERRAL_STATUS == 2 and $customers_referral == '') {
?>
<label class="inputLabel" for="customers-referral"><?php echo ENTRY_CUSTOMERS_REFERRAL; ?></label>
<?php echo zen_draw_input_field('customers_referral', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_referral', 15), 'id="customers-referral"'); ?>
<br class="clearBoth" />
<?php } ?>

<?php
  if (CUSTOMERS_REFERRAL_STATUS == 2 and $customers_referral != '') {
?>
<label for="customers-referral-readonly"><?php echo ENTRY_CUSTOMERS_REFERRAL; ?></label>
<?php echo $customers_referral; zen_draw_hidden_field('customers_referral', $customers_referral,'id="customers-referral-readonly"'); ?>
<br class="clearBoth" />
<?php } ?>
</fieldset>

<fieldset>
<legend><?php echo ENTRY_EMAIL_PREFERENCE; ?></legend>
<?php echo zen_draw_radio_field('email_format', 'HTML', $email_pref_html,'id="email-format-html"') . '<label class="radioButtonLabel" for="email-format-html">' . ENTRY_EMAIL_HTML_DISPLAY . '</label>' . zen_draw_radio_field('email_format', 'TEXT', $email_pref_text, 'id="email-format-text"') . '<label  class="radioButtonLabel" for="email-format-text">' . ENTRY_EMAIL_TEXT_DISPLAY . '</label>'; ?>
<br class="clearBoth" />

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

25 Jun 2006, 7:48 AM
#3
glasshoppah avatar

glasshoppah

New Zenner

Join Date:
Apr 2006
Location:
Kaneohe, Hawaii USA
Posts:
15
Plugin Contributions:
0

Re: [DONE] Bug in referrals field of account-edit template

That did the trick. Thank you very much! :cool:

808's ZenCart: http://808StockPhoto.com/gallery/
Royalty Free Stock Photos at 808 Stock Photography: http://808StockPhoto.com/