Zen Cart Logo
Forums / General Questions / How can I increase the 32 character limit in the Checkout Referral Box?

How can I increase the 32 character limit in the Checkout Referral Box?

Locked

Views: 1,906

Results 1 to 6 of 6
This thread is locked. New replies are disabled.
17 Mar 2007, 7:13 PM
#1
postergame avatar

postergame

New Zenner

Join Date:
Jan 2007
Location:
Altamont, NY USA
Posts:
25
Plugin Contributions:
2

How can I increase the 32 character limit in the Checkout Referral Box?

Can anyone tell me how to increase the amount of text a customer can type into the referral box on the checkout page? It appears to be limited to 32 characters.

I am using the referral code box simply as a place for customers to leave their comments. It is titled: "OPTIONAL: How did you hear about us?".

A customer recently wrote "website @ bot. of pic @ work". They meant to say, "I saw your web address printed on the bottom of a poster at work", but couldn't write all that, given the 32 character limit.

I wonder if I need to increase some field length in my database, however I can find no field labeled "referral ..." , nor would I know how to change the length anyway.

Can anyone help?

Thanks!

17 Mar 2007, 8:53 PM
#3
postergame avatar

postergame

New Zenner

Join Date:
Jan 2007
Location:
Altamont, NY USA
Posts:
25
Plugin Contributions:
2

Re: How can I increase the 32 character limit in the Checkout Referral Box?

Thanks, but I have looked at that module in the past and it involves a drop-down box listing choices.

I want a comment box similar to the one on the shipping instructions page, where a customer can write unlimited text. Is there a way to duplicate the shipping comments box and place it on the first checkout page?

18 Mar 2007, 12:10 AM
#4
j_schilz avatar

j_schilz

New Zenner

Join Date:
Mar 2007
Posts:
40
Plugin Contributions:
0

Re: How can I increase the 32 character limit in the Checkout Referral Box?

postergame,

I think the simplest way to do this would be to create a new field in create account, and then include that entry in the e-mail you receive from create account success.

So, first you'd create a form in tpl_modules_create_account.php with something like this:

<?php echo zen_draw_textarea_field('ourReferralBox', '45', '3'); ?>

I'm not terribly familiar with the inputs of the draw textarea field function, you'll have to change the parameters to fit your needs.

Then in /includes/modules/yourtemplate/create_account.php, towards the end where it's adding on extra info you'd want to modify:

      $extra_info=email_collect_extra_info($name,$email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'] , $account->fields['customers_email_address']);

      $html_msg['EXTRA_INFO'] = $extra_info['HTML'];
      zen_mail('', SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO, SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO_SUBJECT . ' ' . EMAIL_SUBJECT,
      $email_text . $extra_info['TEXT'], STORE_NAME, EMAIL_FROM, $html_msg, 'welcome_extra');
    } //endif send extra emails

such that:

      $extra_info=email_collect_extra_info($name,$email_address, $account->fields['customers_firstname'] . ' ' . $account->fields['customers_lastname'] , $account->fields['customers_email_address']);

      $html_msg['EXTRA_INFO'] = $extra_info['HTML'];
      zen_mail('', SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO, SEND_EXTRA_CREATE_ACCOUNT_EMAILS_TO_SUBJECT . ' ' . EMAIL_SUBJECT,
      $email_text . $_POST['ourReferalBox'] . "\n" . $extra_info['TEXT'], STORE_NAME, EMAIL_FROM, $html_msg, 'welcome_extra');
    } //endif send extra emails

For this to work, you have to receive the account creation e-mails, and read them. If you like this and need help tweaking it or such, let me know.

--Joe

18 Mar 2007, 3:09 AM
#5
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How can I increase the 32 character limit in the Checkout Referral Box?

Second poster is correct - this is a DB driven field size and to be capable of storing this info you need to increase the var for it in the DB. Zen Cart will auto size the box based on the value in the DB

18 Mar 2007, 5:40 PM
#6
postergame avatar

postergame

New Zenner

Join Date:
Jan 2007
Location:
Altamont, NY USA
Posts:
25
Plugin Contributions:
2

Re: How can I increase the 32 character limit in the Checkout Referral Box?

J_Schilz

Thanks for your hard work.

kobra

Thanks for confirming the field limitation in the php database. I searched harder and found customers > customers_referral and was able to change the field length there. Much better!

Zencart does not automatically resize the field on my form. I changed the form length in the tpl create account module, under zen_set_field_length.

Do you know the code to make the display box several lines taller? Can I add a set_field_height or something? I couldn't manage to find the code description for the shipping comments box, to copy it.

Thanks!