PLEASE NOTE: These forums are no longer utilized and are provided as an archive for informational purposes only. All support issues will be handled via email using our support ticket system. For more detailed information on this change, please see this blog post.

Pre-populating Address from WPEC

  1. Hello!

    Trying to pre-populate the address information from a users WP E-commerce (WPEC) saved shipping and billing details. They are saved under a the table wp_usermeta, in a single row wpshpcrt_usr_profile.

    I'm assuming the information is being stored as an array? See the values at bottom of my post, any idea how I can populate this into a gravity form field/fields. The form that saves the information has the following fields:

    Your billing/contact details:

    First Name *
    Last Name *
    Address *
    City *
    Country *
    Postal Code/Zip Code
    Phone *
    Email *

    Shipping Address:

    First Name
    Last Name
    Address
    City
    Country
    Postal Code/Zip Code

    The value appears as follows:

    a:14:{i:9;s:19:"harry@401company.com";i:2;s:6:"Harry";i:3;s:8:"Williams";i:4;s:19:"180 Innisville Rd";i:5;s:7:"Toronto";i:7;a:2:{i:0;s:2:"CA";i:1;s:1:"9";}i:8;s:7:"M4L 3C4";i:18;s:12:"416 570-3623";i:11;s:6:"Harry";i:12;s:8:"Williams";i:13;s:19:"180 Innisville Rd";i:14;s:7:"Toronto";i:16;a:2:{i:0;s:2:"CA";i:1;s:1:"9";}i:17;s:7:"M4L 3C4";}

    Posted 13 years ago on Monday January 23, 2012 | Permalink
  2. Hi, Jay,

    The data you have listed is actually serialized data. You can use the unserialize function to put this into an array that you can work with. Set your form fields so that they can be dynamically populated. Then use the "gform_field_value_$parameter_name" hook (http://www.gravityhelp.com/documentation/page/Gform_field_value_$parameter_name) to populate the form fields with the data you pulled from the database by selecting it out of the array. I hope this points you in the right direction.

    Posted 13 years ago on Monday February 6, 2012 | Permalink

This topic has been resolved and has been closed to new replies.