chrometweaks.org

I want to run a web iPage hosting service where can find the know how?

Click Here To View All Answers...


Quick question... I want to run a web iPage hosting service where can find the know how? Many thanks for any comment. Second question.. Hi Guys,.

I would like to add an extra drop down field for uk counties on the create account page..

I have added the uk counties contrib which adds the counties to the database, I am just unsure as how to call them..

<tr>.

               <td class="main"><?php echo ENTRY_COUNTRY; ?></td>.

               <td class="main"><?php echo tep_get_country_list('country')'&nbsp;'(tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">'ENTRY_COUNTRY_TEXT'</span>': ''); ?></td>.

             </tr>.

I know I need to change this code but to what is the question?.

This is the first line from the sql in the contrib if it helps!.

Thanks.

Mark..

Comments (98)

Good question... I dunno what is the answer to your question. I'll do some research in Google and get back to you if I find an useful answer. You should email the people at iPage as they probably could answer your iPage question..

Comment #1

Hi Todd,.

Thanks for your reply. There was no create new function in the contrib, still not sure what I need to add do..

I think this one might be out of my league!.

Mark..

Comment #2

The code below will create a pull down menu of all zones in the UK. I don't know what that really means as I'm not in the UK but that's what it does..

The value entered into the database for that field will be the zone_code. I just put this together quickly so it's not perfect, but it should work..

Add to /catalog/includes/function/general.php:.

 function tep_pull_down_ukcounty() {.

   $name = 'ukcounty';.

   $ukcounty_array = array(array('id' => '0', 'text' => PULL_DOWN_DEFAULT));.

   $ukcounty_query = tep_db_query("select zone_code, zone_name from "TABLE_ZONES" where zone_country_id = '222' order by zone_name");.

   while ($ukcounty = tep_db_fetch_array($ukcounty_query)) {.

     $ukcounty_array[] = array('id' => $ukcounty['zone_code'],.

                                'text' => $ukcounty['zone_name']);.

   }.

   return tep_draw_pull_down_menu($name, $ukcounty_array, 0);.

 }.

Then use this in create_account (or wherever you need it) to get the menu:.

Tep_pull_down_ukcounty().

I hard-coded the field name 'ukcounty' Just change it to whatever it needs to be for that field...

Comment #3

Todd,.

That worked great!.

Now for the admin side - would the code in general.php be the same or different?.

Thanks.

Mark..

Comment #4

Same applies for the admin side. Again, just change the field name if need be...

Comment #5

Todd,.

I have no idea what I need to do in customers.php because it looks so complex..

A few pointers would be great!.

Thanks.

Mark..

Comment #6

It does look a bit intimidating doesn't it? hehe I was working with it earlier and was getting annoyed just having to scroll between line 250 and line 790..

I don't exactly how you're using it, but it would go somewhere around here:.

<?php.

   if (ACCOUNT_STATE == 'true') {.

?>.

         <tr>.

           <td class="main"><?php echo ENTRY_STATE; ?></td>.

           <td class="main">.

For me, that's around line 600 but should be up a bit from there for you...

Comment #7

Todd,.

Found where it needs to go but what about pulling the county info from the data base..

Can I copy this code and just change the fields in it? If so what do I change them to?.

<tr>.

           <td class="main"><?php echo ENTRY_COUNTRY; ?></td>.

           <td class="main">.

<?php.

 if ($error == true) {.

   if ($entry_country_error == true) {.

     echo tep_draw_pull_down_menu('entry_country_id', tep_get_countries(), $cInfo->entry_country_id)'&nbsp;'ENTRY_COUNTRY_ERROR;.

   } else {.

     echo tep_get_country_name($cInfo->entry_country_id)tep_draw_hidden_field('entry_country_id');.

   }.

 } else {.

   echo tep_draw_pull_down_menu('entry_country_id', tep_get_countries(), $cInfo->entry_country_id);.

 }.

?></td>.

         </tr>.

Do I need to add anything to this part of the code.

$sql_data_array = array('entry_firstname' => $customers_firstname,.

                               'entry_lastname' => $customers_lastname,.

                               'entry_street_address' => $entry_street_address,.

                               'entry_postcode' => $entry_postcode,.

                               'entry_city' => $entry_city,.

                               'entry_country_id' => $entry_country_id);.

My eyes are now boggling!!!!!.

Mark..

Comment #8

Well, if you need the county to be stored in a new field anywhere, you will need to add entries to the arrays..

A quick explanation of that 2nd part ....

Your form might call the county field 'ukcounty.' On submit, it would see the action as edit. Up in the edit case, you would then add something like:.

$ukcounty = tep_db_prepare_input($HTTP_POST_VARS['ukcounty']);.

Then the array would be changed to:.

$sql_data_array = array('entry_firstname' => $customers_firstname,.

                              'entry_lastname' => $customers_lastname,.

                              'entry_street_address' => $entry_street_address,.

                              'entry_postcode' => $entry_postcode,.

                              'entry_city' => $entry_city,.

                              'entry_country_id' => $entry_country_id,.

                              'entry_uk_county' => $ukcounty);.

OK, back to the first part. Again, I'm not familiar with the conties place in the world..

If you just need a dropdown with the list of counties which will enter the zone in the database, then you can use the same code as you used from the catalog side. Just copy the function over to /catalog/admin/includes/functions/general.php and then use the function in customers.php..

Comment #9

Hi Guys,.

I would like to add an extra drop down field for uk counties on the create account page..

I have added the uk counties contrib which adds the counties to the database, I am just unsure as how to call them..

<tr>.

               <td class="main"><?php echo ENTRY_COUNTRY; ?></td>.

               <td class="main"><?php echo tep_get_country_list('country')'&nbsp;'(tep_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">'ENTRY_COUNTRY_TEXT'</span>': ''); ?></td>.

             </tr>.

I know I need to change this code but to what is the question?.

This is the first line from the sql in the contrib if it helps!.

Thanks.

Mark..

Comment #10

When you installed the contribution, did it have you create a new function for the UK counties? If not, the best way to get your dropdown would be to create one based on the country dropdown in /functions/general.php..

Comment #11


This question was taken from a support group/message board and re-posted here so others can learn from it.