Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Adding Billing and Shipping Address when adding New Customers

  1. #1
    Join Date
    Apr 2009
    Posts
    90

    Default Adding Billing and Shipping Address when adding New Customers

    Below is the example I got from the manual. How do you set which address is the billing or shipping address when creating a new customer?

    <AspDotNetStorefrontImport Verbose="false">
    <Customer Action="Add">
    <CustomerLevelID>0</CustomerLevelID>
    <RegisterDate>5/15/2009</RegisterDate>
    <EMail>email@somthing.com</EMail>
    <Password>test123</Password>
    <FirstName>Name</FirstName>
    <LastName>Name</LastName>
    <Phone>111-111-1111</Phone>
    <OkToEMail>1</OkToEMail>
    <IsAdmin>0</IsAdmin>
    <BillingAddress />
    <ShippingAddress />
    <Over13Checked>1</Over13Checked>
    <StoreCCInDB>1</StoreCCInDB>
    <AdminCanViewCC>1</AdminCanViewCC>
    <IsRegistered>0</IsRegistered>
    <PwdChangeRequired>0</PwdChangeRequired>
    <Active>1</Active>
    <Addresses AutoCleanup="false">
    <Address Action="Add">
    <FirstName>Name</FirstName>
    <LastName>Name</LastName>
    <Company>Company Name</Company>
    <Address1>123 Shipping Address St</Address1>
    <Address2>
    </Address2>
    <Suite>
    </Suite>
    <City>San Francisco</City>
    <State>CA</State>
    <Zip>55555</Zip>
    <Country>United States</Country>
    <ResidenceType>0</ResidenceType>
    <Phone>111-111-1111</Phone>
    <Email>email@something.com</Email>
    </Address>
    <Address Action="Add">
    <FirstName>Name</FirstName>
    <LastName>Name</LastName>
    <Company>Company Name</Company>
    <Address1>123 Billing Address St</Address1>
    <Address2>
    </Address2>
    <Suite>
    </Suite>
    <City>San Francisco</City>
    <State>CA</State>
    <Zip>55555</Zip>
    <Country>United States</Country>
    <ResidenceType>0</ResidenceType>
    <Phone>111-111-1111</Phone>
    <Email>email@something.com</Email>
    </Address>
    </Addresses>
    </Customer>
    </AspDotNetStorefrontImport>
    ...AllStar

  2. #2
    Join Date
    Aug 2004
    Posts
    3,037

    Default

    I'm sure we support that. I have to go check the syntax
    Last edited by Rob; 05-15-2009 at 05:22 PM.
    AspDotNetStorefront
    Shopping Cart

  3. #3
    Join Date
    Apr 2009
    Posts
    90

    Default

    Any update yet?
    ...AllStar

  4. #4
    Join Date
    Apr 2009
    Posts
    90

    Default

    Is there an attribute that I can add to the node <address>? This should be listed in the manual...
    ...AllStar

  5. #5
    Join Date
    Nov 2007
    Posts
    2,244

    Default

    In the customer table, there are fields named ShippingAddressId and BillingAddressId, the value of these should be the AddressID from the Address table. If the customer has two different addresses (shipping/billing), you should place the corresponding addressid in ShippingAddressId/BillingAddressId node.

    e.g.
    Code:
    <ShippingAddressID>125<ShippingAddressID>
    <BillingAddressID>127<BillingAddressID>

  6. #6
    Join Date
    Apr 2009
    Posts
    90

    Default

    Alfred, what you're specifying are addresses that already exist in the address table. I understand that much from reading the manual.

    Perhaps you misunderstood me. I'm asking how do you set which address is the billing or shipping address when CREATING a new customer? To clarify things, in the example I gave above, is there an attribute that I can add to the node <address> to specify which address is the billing/shipping?
    Last edited by allstar; 05-20-2009 at 02:21 PM.
    ...AllStar

  7. #7
    Join Date
    Aug 2004
    Posts
    3,037

    Default

    Need G1 to chime in here. I think this is something WSI doesn't do, but could...You could do it as a 2 step process via WSI now, but I agree, it should be able to be done/added in one pass.
    AspDotNetStorefront
    Shopping Cart

  8. #8
    Join Date
    Apr 2009
    Posts
    90

    Default

    Would be a good feature to have.
    ...AllStar

  9. #9
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    The only way to do this at the same time that you are adding the customer is to specify unique identifiers for the addresses when you create them. You can then reference those unique identifiers in the BillingAddress and ShippingAddress nodes of the customer node. For example:
    Code:
    <Customer Action="Add">
      <EMail>email@address.com</EMail>
      <Password>password</Password>
      <FirstName>First Name</FirstName>
      <LastName>Last Name</LastName>
      <BillingAddress GUID="f98fe683-4efa-4ce6-909e-1d5e7a4a8531"/>
      <ShippingAddress GUID="e86c1be1-abca-4be0-a6e1-b0735c19d4a9"/>
      <Addresses>
        <Address Action="Add" GUID="f98fe683-4efa-4ce6-909e-1d5e7a4a8531">
          <FirstName>First Name</FirstName>
          <LastName>Last Name</LastName>
          <Address1>123 Main St.</Address1>
          <City>City</City>
          <State>OH</State>
          <Country>United States</Country>
          <Zip>44145</Zip>
          <Phone>1234567890</Phone>
          <EMail>email@address.com</EMail>
        </Address>
        <Address Action="Add" GUID="e86c1be1-abca-4be0-a6e1-b0735c19d4a9">
          <FirstName>Shipping Address First Name</FirstName>
          <LastName>Shipping Address Last Name</LastName>
          <Address1>123 Main St.</Address1>
          <City>Shipping Address City</City>
          <State>OH</State>
          <Country>United States</Country>
          <Zip>44145</Zip>
          <Phone>1234567890</Phone>
          <EMail>email@address.com</EMail>
        </Address>
      </Addresses>
    </Customer>
    The flow here is that the customer is created, then the addresses are created with an AddressGUID that is the one specified in the Address nodes, and then the customer record is updated with the AddressIDs that WSI finds based on the GUID you are passing in BillingAddress and ShippingAddress. When I run this, I get
    Code:
    <?xml version="1.0" encoding="utf-8"?>
    <AspDotNetStorefrontImportResult Version="" DateTime="5/21/2009 3:44:37 PM">
      <Item NodeType="Customer" Name="" GUID="0D9C8742-A97C-4126-BD30-6DC681D93C1D" ID="58748" ActionTaken="Add" Status="OK" Message="" />
      <Item NodeType="Address" Name="" GUID="f98fe683-4efa-4ce6-909e-1d5e7a4a8531" ID="124" ActionTaken="Add" Status="OK" Message="" />
      <Item NodeType="Address" Name="" GUID="e86c1be1-abca-4be0-a6e1-b0735c19d4a9" ID="125" ActionTaken="Add" Status="OK" Message="" />
    </AspDotNetStorefrontImportResult>
    so my addresses were created with IDs 124 and 125. If you go and take a look at the customer record after running this, you'll see that the BillingAddressID is correctly set to 124 and the ShippingAddressID is correctly set to 125
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  10. #10
    Join Date
    Apr 2009
    Posts
    90

    Default

    George, your example did work. However, aren't these unique identifiers generated on the storefront side? How can I get these unique identifiers when the addresses don't exist in the DB yet? Are the unique identifiers you specified in your examples defaults?
    Last edited by allstar; 05-21-2009 at 01:14 PM.
    ...AllStar

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •