View Full Version : Where are the Field Descriptors Defined?
Brainwrek
October 23rd, 2003, 07:12 AM
I would like to change "State or Province" to "State". Where can I find these settings? I've looked all over, but can't find it. :side:
Brainwrek
October 23rd, 2003, 07:17 AM
Also...where is this string defined?
"A default shipping method of U.S.Postal Service First-Class Mail ($1.00) has been added to your order."
Thanks!!!
Jamie
October 23rd, 2003, 11:11 AM
Hi,
I would like to change "State or Province" to "State". Where can I find these settings?
This is a little tricky. The cart uses the actual field name from the database to generate that code. It is not template based. There is a template that the cart uses for each field called "ship_fields.php" that looks like this:
EDIT 01/19/2006: The file that controls the fields on the address form (v2 and newer) are now in the template file "address_form_fields.tpl.php". The file that controls the fields on the account form are in "account_form_fields.tpl.php".
EDIT 12/12/2006: Updated the code below for version 2.4.2.
<tr>
<td style="text-align:right">
<span class="field_name"><?=$Field_Descriptor?>: </span>
</td>
<td style="text-align:left">
<input class="field_input" type="text" name="<?=$Field_Name ?>" value="<?=$Field_Value?>">
<span style="width: 20"><?=$Required?></span>
</td>
</tr>
The only way to do what you described is by adding custom PHP to that template. You could add something like this to the top of the file:
<?
if ($Field_Descriptor == "State or Province") $Field_Descriptor = "State";
?>
Also...where is this string defined?
"A default shipping method of U.S.Postal Service First-Class Mail ($1.00) has been added to your order."
Line 62 of "squirrelcart/functions/show_cart.func".
-Jamie
Brainwrek
October 23rd, 2003, 11:01 PM
Hi Jaime! I tried your inventive solution. This is what I used...
<?
if ($Field_Name = "State_or_Province") $Field_Descriptor = "State";
?>
Funny thing is that it changes all the field descriptors *except* the State or Province one! Ha ha ha...
Any ideas on a fix?
Also...thanks for the heads up on locating the "default shipping method" text.
Brainwrek
October 23rd, 2003, 11:11 PM
Actually...correction...
There are two field descriptors that are unchanged:
(1) State or Province
(2) Country
Check the pic...
http://www.abrava.com/descriptor.gif
Jamie
October 24th, 2003, 02:44 PM
I think that happened because you used a single equal sign instead of a double one. In the eyes of PHP, your statement is always true, as it is setting $Field_Name instead of checking it's value.
Actually, it looks like the method I described will not work for the country or state field, because they are dynamically generated. The descriptor for the State field is actually defined in "squirrelcart/functions/address_info.func", on line 246.
Thanks,
Jamie
ajcolburn
November 18th, 2005, 12:14 PM
Could this solution be updated for the latest version of SquirrelCart, I've made the changes to address_form_fields.tpl.php yet this doesn't work...
help!
Many thanks,
Alex
zedtech78
January 3rd, 2006, 12:56 PM
If it helps, I had to do this for the Postal Code descriptor, I had to slightly modify Jamie's code in the ship_fields.php file to make it work though.
<?
if ($Field_Descriptor == "Postal Code") $Field_Descriptor = "Postal or Zip Code";
?>
Hope that helps!
Rich
mdesilets
April 27th, 2006, 05:25 PM
I'd like to change the "Username" field to Say "Email Address" a customer will always remember their email... however they might forget a username they created 6 months ago...
I added the following code to "address_form_fields.tpl.php" & "account_form_fields.tpl.php"
<?
if ($Field_Descriptor == "UserName") $Field_Descriptor = "Email Address";
?>
However nothing worked... is this due to the fact that there allready is an "Email Address field on the page? Or perhaps you have a better suggestion to solve this problem?
Thx
Marty
Jamie
April 27th, 2006, 05:58 PM
If your code is exactly as it appears in your post, the problem is that you have "UserName" where you should have "Username". I'd be careful changing the label of this field. There already is an "email address" field on the account page (provided you have it enabled). That field is used whenever Squirrelcart needs to email the customer (basically when they place an order).
If you label the username field as "email address", they may wonder why they aren't receiving emails to whatever they enter there, if it doesn't match what they entered for the true email address field.
You definitely don't have to worry about uniqueness of usernames. If a username is already taken they will receive a warning to choose a different one.
Nater
May 24th, 2006, 02:17 PM
Hi,
Thanks for the help on the changing the Field_Descriptors. Works brilliantly.
Now I am interested in Changing the values for the radio buttons. I am currently translating the cart into spanish and while nearly complete, I am hanging up on changing the names of the radio buttons: Residential and Commercial on the address form template page.
Any thoughts
Thanks,
Nate Flint
simonh
December 10th, 2006, 04:24 PM
OK ... I have the latest version, (2.4.2), and have updated the 'states' records to read UK counties, but I can't find where to update the code so that, at checkout, it reads "County / State" instead of "State or Province" ...
Any help much appreciated ;)
ATB
Simon
simonh
December 12th, 2006, 05:08 PM
* bump *
Changing 'State or Province' to 'County or State' in 2.4.2 ... how do I do it?
Help please!!
Simon
Jamie
December 12th, 2006, 05:34 PM
My first post in this thread has been update with code to change "State or Province". The only difference is before it was checking for "State_or_Province" and now it has to check for "State or Province" without the underscores. If you are trying to match a variable in an if statement, when in doubt just print it for testing purposes:
<?php print "field descriptor: $Field_Descriptor<br />" ?>
cases
January 19th, 2007, 02:57 PM
I want to take out or delete the Province names (ex. Alberta, Quebec) from
the Pull-Down list of options in the State or Province section.
How do I do this?
Jamie
January 19th, 2007, 03:29 PM
Go to this URL: http://www.EXAMPLE.com/squirrelcart/index.php?States
From there, you can select the states you don't want and delete them.
vickie
January 25th, 2007, 06:17 PM
I noticed that on order notification emails, and the output in manage your order... that the COUNTRY is not printed.
I sell quite often to countries in Europe. I use dazzle to capture my shipping addresses and print my shipping labels. (great program and works like a charm as long as you have the entire address in the correct format). SC has the name, street, city, state, zip all in the correct format but I need the country to show up too. Or at least foreign countries, I don't need the U.S. to show up.
Is there an easy way to add country to the shipping address so that it prints out too? (remember, I said easy :o )
Jamie
January 25th, 2007, 06:47 PM
The variables for that are described here: http://www.ldev.com/forums/showthread.php?t=2735
vickie
January 25th, 2007, 07:40 PM
Jamie,
Read through the other thread and your reply. I tried a fake order using the 2nd street address and it seemed to work ok for me (2nd street line showed up on the order information).
So I guess I would only need to put in the country part of the code you gave?
I'll try this tomorrow. Was hoping I could just click a square somewhere but apparently I have to get my feet wet :p
Thanks
Vickie
Jamie
January 25th, 2007, 08:22 PM
So I guess I would only need to put in the country part of the code you gave?
Yes, that's right.
christopherO
January 30th, 2007, 04:39 AM
Until now I have been UK based only; I have recently started selling across Europe. As I am a total non-programmer I always find real visual examples the most helpful. I have followed help from Jamie and this is now the code I use to get this information, including telephone number which we need to call the customer when we have an out of stock.
I hope this is also useful to you :)
This starts at line 27 in my template:
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<? /* DO NOT MODIFY THIS LINE!! */ if ($Show_Billing) { ?>
<td width="200" align="left">
<table class="address_block" cellspacing="0" cellpadding="4" align="left">
<tr class="header_row">
<td width="132" colspan="2">
Customer Address
</td></tr><tr>
<td style="text-align:left"><p>
<?=$Bill_First_Name ?>
<?=$Bill_Last_Name ?><br />
<?php /*DO NOT MODIFY THIS LINE!*/ if ($Bill_Company || $Ship_Company) { ?> <?=$Bill_Company?></br>
<?php /*DO NOT MODIFY THIS LINE!*/ } ?>
<?=$Bill_Street?><br />
<?=$Bill_Street_2?><br />
<?=$Bill_City ?> <?=$Bill__State_Name?> <br>
<?=$Bill_Postal_Code?><br>
<?=$Bill_Country_Name?></p>
<p>
<span class="style4">Telephone:</span>
<?=$Bill_Phone?>
</p></td>
</tr>
</table> </td>
<td width="50"> </td>
<? /* DO NOT MODIFY THIS LINE!! */ } ?>
<? /* DO NOT MODIFY THIS LINE!! */ if ($Show_Shipping) { ?>
<td width="200">
<table class="address_block" cellspacing="0" cellpadding="4" align="left">
<tr class="header_row">
<td colspan="2">
<strong>Delivery Address</strong> </td>
</tr>
<tr>
<td style="text-align: left"> <p>
<?=$Ship_First_Name ?>
<?=$Ship_Last_Name ?><br />
<?php /*DO NOT MODIFY THIS LINE!*/ if ($Bill_Company || $Ship_Company) { ?>
<?=$Ship_Company?></br>
<?php /*DO NOT MODIFY THIS LINE!*/ } ?>
<?=$Ship_Street?><br />
<?=$Ship_Street_2?><br />
<?=$Ship_City?> <?=$Ship__State_Name?><br />
<?=$Ship_Postal_Code?><br />
<?=$Ship_Country_Name?></p>
<p><span class="style3">Special Instructions:</span><br />
<?=$Ship_Special_Instructions?><br>
</p></td>
</tr>
</table> </td>
<? /* DO NOT MODIFY THIS LINE!! */ } ?>
</tr>
</table>
vBulletin® v3.7.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.