X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (https://forum.x-cart.com/forumdisplay.php?f=20)
-   -   Additional fields for address book (https://forum.x-cart.com/showthread.php?t=62429)

qualiteam 01-25-2012 06:04 AM

Re: Additional fields for address book
 
There should be only "id" field in the address book table, no "addressid" one (it is indeed means "addressid", but called "id").

The "addressid" field should be added to the "xcart_register_field_values" table.

Hope it helps.

carlisleglass 01-25-2012 06:30 AM

Re: Additional fields for address book
 
Quote:

Originally Posted by qualiteam
There should be only "id" field in the address book table, no "addressid" one (it is indeed means "addressid", but called "id").

The "addressid" field should be added to the "xcart_register_field_values" table.

Hope it helps.



For some reason my installation was causing php errors saying addressid was a missing field within address_book - unfortunately i don't have the error messages anymore, but adding addressid to the table stopped the error.

CartOnSteroids.com 01-25-2012 07:54 AM

Re: Additional fields for address book
 
Brilliant! This is really useful!

alinush 01-25-2012 11:00 AM

Re: Additional fields for address book
 
I'm getting this:

Code:


    SQL query  : SELECT COUNT(id) FROM xcart_address_book WHERE userid='0' AND addressid='S' LIMIT 1
    Error code  : 1054
    Description : Unknown column 'addressid' in 'where clause'
Request URI: /cart.php?mode=order_message&orderids=11970
Backtrace:
/home/user/public_html/xcart/include/func/func.db.php:291
/home/user/public_html/xcart/include/func/func.db.php:191
/home/user/public_html/xcart/include/func/func.db.php:542
/home/user/public_html/xcart/include/func/func.user.php:1210
/home/user/public_html/xcart/include/func/func.user.php:724
/home/user/public_html/xcart/include/checkout_init.php:304
/home/user/public_html/xcart/cart.php:119


alinush 01-25-2012 11:06 AM

Re: Additional fields for address book
 
Actually there's a set of errors on each completed order, from the same URL specified above

Code:

    SQL query  : SELECT COUNT(id) FROM xcart_address_book WHERE userid='0' AND addressid='0' LIMIT 1

    SQL query  : SELECT COUNT(id) FROM xcart_address_book WHERE userid=■ AND addressid=■ LIMIT 1

    SQL query  : SELECT COUNT(id) FROM xcart_address_book WHERE userid='0' AND addressid='B' LIMIT 1

    SQL query  : SELECT COUNT(id) FROM xcart_address_book WHERE userid='0' AND addressid='S' LIMIT 1


qualiteam 01-25-2012 10:07 PM

Re: Additional fields for address book
 
Oh, sorry. There seem to be an issue with the patch.

Please edit the include/func/func.user.php script and replace this code:
Code:

$_address_exists = func_query_first_cell("SELECT COUNT(id) FROM $sql_tbl[address_book] WHERE userid='$user' AND addressid='$address'") == 0 ? false : true;

with this:
Code:

$_address_exists = func_query_first_cell("SELECT COUNT(id) FROM $sql_tbl[address_book] WHERE userid='$user' AND id='$address'") == 0 ? false : true;

qualiteam 01-25-2012 10:09 PM

Re: Additional fields for address book
 
I've update the patch. So, it contains the fix provided above.

alinush 01-26-2012 12:06 AM

Re: Additional fields for address book
 
Thank you, this solved the problem.

For some reason though, the extra fields are invisible, even if the HTML code is there. Please see:

http://www.blueneon.ro/alinush/hidden.jpg

Also, how can we insert these fields between the other address book fields? For example, I need Address line 3 after Address line 2, but I can't insert it there:

http://www.blueneon.ro/alinush/fields.jpg

qualiteam 01-26-2012 02:56 AM

Re: Additional fields for address book
 
Repositioning is not supported, unfortunately.

Additional customization will be rquired e.g. in this template -> skin/%skin%/(main/modules)/address_fields.tpl

qualiteam 01-26-2012 02:57 AM

Re: Additional fields for address book
 
What browser do you use? Please clarify.


All times are GMT -8. The time now is 04:48 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.