Author Topic: Error: Something went wrong while adding the new address.  (Read 16474 times)

SodaJim

  • Jr. Member
  • **
  • Posts: 115
Re: Error: Something went wrong while adding the new address.
« Reply #15 on: January 26, 2011, 16:50:27 pm »
Following up to see if anyone else has successfully performed the listed modifications...?
Is one mod better than the other...?
I performed Table Filed Name change and tested to no avail...

Any direction is appreciated!
Jim

SodaJim

  • Jr. Member
  • **
  • Posts: 115
Re: Error: Something went wrong while adding the new address.
« Reply #16 on: February 03, 2011, 02:10:39 am »
I may be understanding the Function/Feature of "New Address"...
I thought VM would allow a user to store/save more than one shipping address so during checkout either address could be utilized.

I have performed both suggested solutions previously listed, but neither have yielded a positive result in allowing a second shipping address for the customer.

Has anyone overcome this bug in VM...?
OR am I misunderstanding this feature/concept...?

Thank you for your time and direction!
Jim

chongkan

  • Beginner
  • *
  • Posts: 2
    • www.likandevelopment.com
Re: Error: Something went wrong while adding the new address.
« Reply #17 on: February 28, 2011, 13:36:41 pm »
Here is what I did:


1- Without the quoted code modification you will not get the new email address saved to the DB and you will get the mentioned error:

"Error: Something went wrong while adding the new address."

Once you put that code in, the email gets saved to "user_email" and the error goes away.

I found the problem with mine a few minutes ago.  I'll post in case someone else comes across this same problem.  It may not fix their exact problem, but then again it may...

For whatever reason, there was an SQL statement that was trying to update the email field in the #__{vm}_user_info table when it should have been updating user_email.  This was causing the sql statement to fail since email was not a field.

In the file ps_user_address.php you need to make this change

Code: [Select]

// These are pre-defined fields.
$fields['user_id'] = !$perm->check("admin,storeadmin") ? $_SESSION['auth']['user_id'] : (int)$d["user_id"];
$fields['user_info_id'] = md5( uniqid( $hash_secret ));
$fields['address_type'] = 'ST';
$fields['cdate'] = $timestamp;
$fields['mdate'] = $timestamp;

to

Code: [Select]
// These are pre-defined fields.
$fields['user_id'] = !$perm->check("admin,storeadmin") ? $_SESSION['auth']['user_id'] : (int)$d["user_id"];
$fields['user_info_id'] = md5( uniqid( $hash_secret ));
$fields['address_type'] = 'ST';
$fields['cdate'] = $timestamp;
$fields['mdate'] = $timestamp;
$fields['user_email'] = $fields['email'];
unset( $fields['email'] );



2- After doing this, you need to check the list of published fileds for the Shipping From Form. 

http://virtuemart.net/documentation/User_Manual/User_Registration_Fields.html

Make sure you include at least the following Mandatory Fields: (Country/State/Address1).  the most important filed here is the country: If you don't allow the user to specify the propper country, the default US gets populated in the DB and if yous store is not localized for US it won't list this new address even if it adds it on the DB.

To resolve this (My store is for CRI (Costa Rica))  I went to the DB and changed the default country Value to "CRI"


After this, I was able to add new users and get some of teh fields I wanted in the available addresses list.

3- In order to display the info I needed ( I want to display email address in the list), I went to list_shipto_addresses.tpl.php  and changed one of the fields that I don't need to the one I wanted:

e.g. $db->f("address_1") is now: $db->f("user_email") ...

I'm still working on it...

--
Eduardo Chongkan - Likan Development

SodaJim

  • Jr. Member
  • **
  • Posts: 115
Re: Error: Something went wrong while adding the new address.
« Reply #18 on: February 28, 2011, 15:33:36 pm »
Additionally, my environment has a slightly different secure URL than the Site URL so all I had to do was include "account" selection in the "Shop areas which must use https"
Once this selection was saved, additional shipping addresses could be saved.

Chi Chi

  • Beginner
  • *
  • Posts: 30
Re: Error: Something went wrong while adding the new address.
« Reply #19 on: April 17, 2011, 21:01:45 pm »
Hi, Did you ever get this fixed? I'm having the same problem. I'm using vm 1.1.3 and just discoved all this time no one was able to ship to a different address. I was able to get the error off by changing the email setting in the Manage Users section however after doing so I then discoved I was not receving any orders in my email! So it's something to do with the user/emails. Any easy fix for this without changing code and just making changes in the Manage Users section? I need to get this fixed asap...thanks!

Chi Chi

  • Beginner
  • *
  • Posts: 30
Re: Error: Something went wrong while adding the new address.
« Reply #20 on: April 18, 2011, 19:07:18 pm »
Hi Did you ever get this fixed? I would like to fix this as I can't use it as is. Thanks.

SodaJim

  • Jr. Member
  • **
  • Posts: 115
Re: Error: Something went wrong while adding the new address.
« Reply #21 on: April 21, 2011, 04:03:58 am »
I did get my configuration to work; however, my issue was easily resolved! See above...

innov8t

  • Beginner
  • *
  • Posts: 34
Re: Error: Something went wrong while adding the new address.
« Reply #22 on: May 20, 2011, 11:46:07 am »
Hi All,

I have just updated from:

Joomla 1.5.21 to 1.5.23
Virtuemart 1.1.5 to 1.1.8

I am having the same issue, when a user checks out & tries to update their country address (in account maintenance), it doesnt throw an error, but it doesnt update either!

When a user tries to add a new shipping address, the error "Error: Something went wrong while adding the new address." appears.

Has anyone got a definitive fix/patch for this?
I though updating to VM 1.1.8 would solve it, but it doesnt!

Many thanks

innov8t

  • Beginner
  • *
  • Posts: 34
Re: Error: Something went wrong while adding the new address.
« Reply #23 on: May 24, 2011, 11:41:25 am »
Seesm to have resolved itself :-)

Sonjoshuaz

  • Beginner
  • *
  • Posts: 3
Re: Error: Something went wrong while adding the new address.
« Reply #24 on: December 30, 2011, 02:25:08 am »
I think i Found the Solution to the problem it is the vm_extra_field_1 is enabled I just disabled this Field and it works :)