Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Additional fields for address book

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #71  
Old 11-01-2012, 09:43 AM
 
GreatLakesVacuum GreatLakesVacuum is offline
 

eXpert
  
Join Date: Jan 2009
Posts: 286
 

Default Re: Additional fields for address book

Quote:
Originally Posted by Steel
Can the programing experts please advise the best code practice to accomplish the task of adding/positioning a Field Name (Company) between the list of stock Field Names?

For example, if the stock field names Title and Fax are not going to be utilized, (i) is it best to rename and reposition either of these; or (ii) is it better to code a new stock entry; or (iii) would it be less work and more proper to utilize an additional field?

Concerning the import/export of the Field Name values: (i) would function; (ii) would require a bit of code work; and (iii) would require the most?

Thanks for any input.

If it wasn't for the import/export problem,

I would simply either rename one (although I would have to likely redo lots of them) or I would shut off almost all of them and add all new custom ones that I can organize.

This lack of sort is so irritating and I don't appreciate X-Cart having lied to us about it being in 4.5.4.
__________________
X-Cart 4.5.4 Gold (Live Business Site)
X-Cart 5.1.9 Business (In Development Now)
Reply With Quote
  #72  
Old 11-01-2012, 09:48 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default Re: Additional fields for address book

The best way is to hard code it just like the other standard fields are - I have done this already and it is the best way at this point.

If you turn off all standard fields and just redo them as additional fields it will not work - these additional fields are not count as address fields and their values will not be populated in address book, you will also get errors if you try to use X-Payments for example as it relies on the standard fields, as well as any other payment method or any function that needs customer info....
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following 3 users thank cflsystems for this useful post:
GreatLakesVacuum (11-01-2012), Steel (11-01-2012), totaltec (11-01-2012)
  #73  
Old 11-01-2012, 09:56 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Additional fields for address book

I think utilizing an existing field is going to save you a lot of time. I don't see why fax could not be adapted to this purpose. Just change the name of the language variable and you are done. It looks like it is in a perfect position for company on most forms anyway.

Now I haven't tested this but I don't see any restrictions that would prevent this. Fax is a really redundant thing to be asking for these days...
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #74  
Old 11-01-2012, 09:58 AM
 
GreatLakesVacuum GreatLakesVacuum is offline
 

eXpert
  
Join Date: Jan 2009
Posts: 286
 

Default Re: Additional fields for address book

Quote:
Originally Posted by totaltec
I think utilizing an existing field is going to save you a lot of time. I don't see why fax could not be adapted to this purpose. Just change the name of the language variable and you are done. It looks like it is in a perfect position for company on most forms anyway.

Now I haven't tested this but I don't see any restrictions that would prevent this. Fax is a really redundant thing to be asking for these days...

I actually tried this at first... but it is at the very bottom, not at all where Company belongs... it should be FIRST. So it didn't really seem much better than a custom one that would be basically in the same spot and not require removal of Fax (and manually cleaning up all the fax numbers people have entered)
__________________
X-Cart 4.5.4 Gold (Live Business Site)
X-Cart 5.1.9 Business (In Development Now)
Reply With Quote

The following user thanks GreatLakesVacuum for this useful post:
totaltec (11-01-2012)
  #75  
Old 11-01-2012, 11:04 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Additional fields for address book

Quote:
Originally Posted by GreatLakesVacuum
I actually tried this at first... but it is at the very bottom, not at all where Company belongs... it should be FIRST. So it didn't really seem much better than a custom one that would be basically in the same spot and not require removal of Fax (and manually cleaning up all the fax numbers people have entered)
For most businesses Company is best left at the end in my opinion, putting it at the top would only be good for b2b.

Re-ordering the fields is not easy to figure out, but in theory it should be simple to do. It looks like the fields are defined in two places, once in init.php and again in the database under xcart_config>address_book_fields.

Initially I don't believe any values are stored in the db at all, but once you have used the Settings> user profiles page in the admin it stores the value in the db. Theoretically you could change the order of the fields by altering the order in init.php.

If you already have a value stored in the xcart_config table it will override this setting, and since it is serialized it is harder for humans to read and adjust. So I would just delete this entry from the db. Once the field order is loaded from init.php, it should store the value correctly in the db for later adjustment of what is active/required. So if you want to use fax as company, you can just move it to the top of the list.

Keep in mind that I have not tested this at all, don't try this on your live shop until you have tested all the implications on your dev site.

Hope that helps,
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote

The following 2 users thank totaltec for this useful post:
GreatLakesVacuum (11-01-2012), Steel (11-02-2012)
  #76  
Old 11-01-2012, 11:05 AM
 
GreatLakesVacuum GreatLakesVacuum is offline
 

eXpert
  
Join Date: Jan 2009
Posts: 286
 

Default Re: Additional fields for address book

Quote:
Originally Posted by totaltec
Re-ordering the fields is not easy to figure out, but in theory it should be simple to do. It looks like the fields are defined in two places, once in init.php and again in the database under xcart_config>address_book_fields.

Initially I don;t believe any values are stored in the db at all, but once you have used the Settings> user profiles page in the admin it stores the value in the db. Theoretically you could change the order of the fields by altering the order in init.php.

If you already have a value stored in the xcart_config table it will override this setting, and since it is serialized it is harder for humans to read. So I would just delete this entry from the db. Once the field order is loaded from init.php, it should store the value correctly in the db for later adjustment of what is active/required. So if you want to use fax as company, you can just move it to the top of the list.

Keep in mind that I have not tested this at all. For most businesses Company is best left at the end in my opinion, putting it at the top would only be good for b2b.

Hope that helps,

Ours is 100% B2B. Often it is shipped to a different plant/building/city/company completely.

I'll look this over in more detail in the morning. Thanks.
__________________
X-Cart 4.5.4 Gold (Live Business Site)
X-Cart 5.1.9 Business (In Development Now)
Reply With Quote
  #77  
Old 11-01-2012, 12:28 PM
 
Steel Steel is offline
 

eXpert
  
Join Date: Dec 2006
Posts: 253
 

Default Re: Additional fields for address book

Quote:
Originally Posted by cflsystems
The best way is to hard code it just like the other standard fields ...

So, to keep it simple, if any repositioning of field names is required, it is best to (i) just add entries for new Field Name/s to the bottom (end) of the database list, and (ii) add a block of code in the desired Field Name/Address List position/s in the various template files?

But, for simplicity, if a sufficient number of non-critical stock Field Names are available, and do not need repositioning, then as totaltec suggests, just change the name of the language variable/s?

Note: I am thinking in terms of X-Cart v4.5.4 and FLC.
__________________
X-Cart Gold v4.6.6
Reply With Quote
  #78  
Old 11-01-2012, 12:40 PM
 
GreatLakesVacuum GreatLakesVacuum is offline
 

eXpert
  
Join Date: Jan 2009
Posts: 286
 

Default Re: Additional fields for address book

Ok, so we have been playing with this more..

I have an added Company field that I added using the info from the other thread on how to add these to the "Address Book" portion.

But in order to mark this field as complete, we need to populate it for existing customers.

We tried to edit them in the Admin site via the address book part of the users. The new field shows up in red (just like the required marks) - no idea if that means anything besides it being added.

But the edits don't stick?! I mean it does on a few customers, but not on most. And some of them the additional field isn't eve there?

I do not understand this complete inconsistency and its driving us nuts!
__________________
X-Cart 4.5.4 Gold (Live Business Site)
X-Cart 5.1.9 Business (In Development Now)
Reply With Quote
  #79  
Old 11-01-2012, 04:33 PM
 
Steel Steel is offline
 

eXpert
  
Join Date: Dec 2006
Posts: 253
 

Default Re: Additional fields for address book

Quote:
Originally Posted by totaltec
Re-ordering the fields is not easy to figure out, but in theory it should be simple to do. It looks like the fields are defined in two places, once in init.php and again in the database under xcart_config>address_book_fields.

Hi Mike,

I am under the impression that what you are suggesting might re-position the Field Name entries on the admin side, but it looks like the customer side templates have the stock Field Name positions fixed and would require re-positioning of the Field Name code block/s. Is this incorrect?

If the customer side address templates require coding for proper positioning, wouldn't it be more proper to do as Steve suggested, and hard code the new Field Name/s?
__________________
X-Cart Gold v4.6.6
Reply With Quote
  #80  
Old 11-01-2012, 05:49 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default Re: Additional fields for address book

Steel,
I just tested this method of positioning, and it works like a charm for OPC and the admin side. In the address book (when accessed from my account tab not OPC) it does not automatically re-position the fields, because they are hard coded into the template.

An easy fix though, moving the fields in the templates are easy as pie. To edit the address book fields you can look at /common_files/customer/main/address_fields.tpl

You can see it working at my test site: http://trainingpen.com

Moving the fields in the address book or in FLC has never been a problem. It is OPC where this change is difficult, and requires some custom code like I suggested above. If you are using FLC then you just change the language variable for fax, and reorder the fields in the template. No need for any hair pulling.

In OPC the fields are populated in the order that they are pulled from the DB.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 11:42 PM.

   

 
X-Cart forums © 2001-2020