chrometweaks.org

Where can I pay a iPage web host with a visa card?

Click Here To View All Answers...


First off, Where can I pay a iPage web host with a visa card? Many thanks for any answer or 2. My 2nd question... Following our upgrade to osCommerce 2.2-MS2 we are seeing a problem with all new accounts that are created. When a customer creates a new account and tries to checkout, the default shipping address is not being shown on the checkout_shipping.php screen. Instead a comma is shown. All pre-upgrade accounts are fine and can check out no problem..

Looking into the customers db table it appears for some reason that the field customer_default_address_id is being populated with a 0 instead of a 1. If this value is manually edited at the table level and the account is logged out and logged back in the address problem is fixed. At the checkout_shipping screen the correct address is shown..

Can anyone point me in the right direction for troubleshooting this problem please...

Comments (5)

Hmm... I need to find out myself. I don't know what is the right answer to your question. I'll do some research in Google and get back to you if I got an useful answer. You should email the people at iPage as they probably could give you help..

Comment #1

Ok, I've have this problem too and I can't find anything that addresses this in.

Any.

Forum on this site..

The problem is that with the default osCommerce code, it inserts a 0 in the.

`address_book_id`.

In the.

`address_book`.

Table. The problem arises in several areas when you can't see a customer's details because the default in the.

`customers`.

Table adds a.

'1'.

In for the.

`customers_default_address_id`.

, so no longer by default when a customer signs up, does.

`address_book`.`address_book_id` = `customers`.`customers_default_address_id`.

They are by default a 0 and a 1 respectively..

I've searched and dug throughout the code to find the INSERT sql for.

Checkout_shipping_address.php.

And.

Address_book_process.php.

So I can change the sql to add the correct number.

`1`.

In the.

`address_book`.`address_book_id`.

Does anyone know where the insert statement is for these two files?.

And does anyone know why this all changed? It was working fine in older versions of osCommerce! I looked at an older setup and the.

`address_book`.`address_book_id`.

Is set and an auto_increment and it no longer is. Why?.

Thanks!.

Chris..

Comment #2

Hi Chris,.

Yes I have been searching the forum for any related topics but can't find any answers - hence my post..

Any pointers gratefully received!..

Comment #3

Ok I got mine to work by way of a major workaround. I'm not sure if you want to try this or not, but here's what I did. PS I would recommend not doing this to a live site....

1. Changed the `address_book_id` in the `address_book` table to have a default of 1 because that seems to be what the default create_account.php file automatically adds to the corresponding field `customers`.`customers_default_address_id`..

2. Since this affects people who want to add to their address books, I had to change the following files to do an addition function to increment the address_book_id field. This is done because if you don't, you'll get an error saying your trying to add a duplicate entry. So the two files I've found thus far that is affected by this is checkout_shipping_address.php and address_book_process.php.

3. Change checkout_shipping_address.php.

~ around line 135 inside the if ($error == false) statement I added.

// function added to auto increment address_book_id by Chris.

 $add_book_query = tep_db_query("select`customers_id`,`address_book_id` FROM "TABLE_ADDRESS_BOOK" WHERE `customers_id` = "(int)$customer_id" ORDER BY `address_book_id` DESC LIMIT 1");.

 $add_book_array = tep_db_fetch_array($add_book_query);.

 $count_number = $add_book_array['address_book_id'];.

 $new_count_number = $count_number + 1;.

 $address_book_id = $new_count_number;.

// end function.

~ and then a couple of lines down in the $sql_data_array query under 'customers_id' => $customer_id I added.

// added address book id by Chris .

'address_book_id' => $address_book_id,.

4. in the address_book_process.php file I did the same thing and added the same function in the if ($error == false) code at around line 123.

// new function for address_book_id by Chris.

 $add_book_query = tep_db_query("select`customers_id`,`address_book_id` FROM "TABLE_ADDRESS_BOOK" WHERE `customers_id` = "(int)$customer_id" ORDER BY `address_book_id` DESC LIMIT 1");.

 $add_book_array = tep_db_fetch_array($add_book_query);.

 $count_number = $add_book_array['address_book_id'];.

 $new_count_number = $count_number + 1;.

 $address_book_id = $new_count_number;.

// end function.

And then in the $sql_data_array statement a few lines down, I added.

// address book id added by Chris.

        'address_book_id' => $address_book_id,.

I hope this helps you. It fixed my cart, so hopefully it will yours too. I just don't understand what happened since the upgrade and I actually went and downloaded and installed again because I thought something got messed up. But if you look at older installations in the address_book table, address_book_id was the key and it was on auto_increment. But they changed it for whatever reason....

Chris..

Comment #4

Thanks for that Chris..

Out of interest, do you have any contributions installed when you see this problem? I would have thought that if this was a problem that affected a stock install there would be more people seeing the problem and more info on the forum relating to it......

Comment #5

Well I have modded the heck out of this installation, but I didn't think that anything affected the address_book table. Who knows?.

Thanks!.

Chris..

Comment #6


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