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 > Changing and adding new features
 
Thread Tools Search this Thread
  #101  
Old 07-23-2014, 06:06 PM
 
Ben G Ben G is offline
 

Advanced Member
  
Join Date: Nov 2006
Posts: 100
 

Default Re: Additional fields for address book

Thanks Steve!

In version 4.6.3, the setting up the company address field as an "additional address field" in user profile doesn't allow it to be put in the correct field order for address labels (as many now know).

So I used your hard coding of the Company field as per your coding (slightly modified as 4.6.3 has the bugs removed). I don't really understand why but I just couldn't get the company field to show anywhere, even after clearing caches. None of the array functions would pick it up. Then, in PHPMyadmin I searched xcart_config table for "address_book_fields" I decided to manually insert the company field

Quote:
{s:5:"field";s:7:"company";s:5:"avail";s:2:"CH";s: 8:"required";N;}i:4;a:3:

So it now contains :

Quote:
a:13:{i:0;a:3:{s:5:"field";s:5:"title";s:5:"avail" ;N;s:8:"required";N;}i:1;a:3:{s:5:"field";s:9:"fir stname";s:5:"avail";s:2:"CH";s:8:"required";s:2:"C H";}i:2;a:3:{s:5:"field";s:8:"lastname";s:5:"avail ";s:2:"CH";s:8:"required";s:2:"CH";}i:3;a:3:{s:5:"field";s:7:"company";s:5:"avail";s:2:"CH";s: 8:"required";N;}i:4;a:3:{s:5:"field";s:7:"address";s:5:"avail";s:2:"CH";s: 8:"required";s:2:"CH";}i:5;a:3:{s:5:"field";s:9:"a ddress_2";s:5:"avail";s:2:"CH";s:8:"required";N;}i :6;a:3:{s:5:"field";s:4:"city";s:5:"avail";s:2:"CH ";s:8:"required";s:2:"CH";}i:7;a:3:{s:5:"field";s: 6:"county";s:5:"avail";N;s:8:"required";N;}i:8;a:3 :{s:5:"field";s:5:"state";s:5:"avail";s:2:"CH";s:8 :"required";s:2:"CH";}i:9;a:3:{s:5:"field";s:7:"co untry";s:5:"avail";s:2:"CH";s:8:"required";s:2:"CH ";}i:10;a:3:{s:5:"field";s:7:"zipcode";s:5:"avail" ;s:2:"CH";s:8:"required";s:2:"CH";}i:11;a:3:{s:5:" field";s:5:"phone";s:5:"avail";s:2:"CH";s:8:"requi red";N;}i:12;a:3:{s:5:"field";s:3:"fax";s:5:"avail ";s:2:"CH";s:8:"required";N;}}

and everything started working correctly - including the field showing in User Profiles and it the avail/req'd checkboxes also work - see attached.

In 4.6.3, userprofiles.php call for $default_address_book_fields; but func.user.php calls for $default_address_fields - I think this is where the hard-coding of the fields is complicated a little.

Hope this helps someone!
Attached Thumbnails
Click image for larger version

Name:	Hard-Coded-Company.jpg
Views:	41
Size:	40.8 KB
ID:	3838  
__________________
Ben
X-Cart 4.6.6 Gold Plus - lots of modules
X-Cart 4.7.9 Gold Plus - lots of modules
Reply With Quote

The following user thanks Ben G for this useful post:
zone1creative (09-05-2018)
  #102  
Old 07-23-2014, 06:21 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 13,484
 

Default Re: Additional fields for address book

Quote:
Originally Posted by Ben G
I don't really understand why but I just couldn't get the company field to show anywhere, even after clearing caches. None of the array functions would pick it up. Then, in PHPMyadmin I searched xcart_config table for "address_book_fields" I decided to manually insert the company field
!

Just delete the entry for address fields in config table - XC will generate it again from the init.php values and include the changes you have made for "company" field
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
Ben G (07-23-2014)
  #103  
Old 07-23-2014, 06:29 PM
 
Ben G Ben G is offline
 

Advanced Member
  
Join Date: Nov 2006
Posts: 100
 

Default Re: Additional fields for address book

Cheers & Thanks.

So it is another cache - DB cache.

As you replied I read
http://forum.x-cart.com/showthread.php?t=58832&page=2&highlight=func_get_d efault_fields

Appears you need to do this in PHPMyAdmin, as clearing x-cart cache doesn't do it.

Much appreciated
__________________
Ben
X-Cart 4.6.6 Gold Plus - lots of modules
X-Cart 4.7.9 Gold Plus - lots of modules
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing and adding new features


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 03:36 AM.

   

 
X-Cart forums © 2001-2018