Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Simon Dingley 1474 posts 3431 karma points c-trib
    May 31, 2012 @ 21:19
    Simon Dingley
    0

    No Customer Addresses Being Retrieved

    Having a logged in customer place an order on the site and complete the order process, when they return and I output the contents of <xsl:copy-of select="CommerceLibrary:GetCurrentCustomer()"/> I don't get any addresses returned.

    Is there something I am missing? All I am getting back is an empty addresses node.

  • Søren Spelling Lund 1797 posts 2786 karma points
    May 31, 2012 @ 21:31
    Søren Spelling Lund
    0

    Have you saved any customer addresses or just order addresses? They're two distinct entities.

    If you're using XSLT you can use CommerceLibrary:EditCustomerAddress.

    With Razor you new up a new Address object and attach it to the customer.

    Hope this helps.

  • Simon Dingley 1474 posts 3431 karma points c-trib
    May 31, 2012 @ 21:36
    Simon Dingley
    0

    Ah ok I didn't know that - is it possible to pull back previous order addresses a customer has used also?

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jun 01, 2012 @ 00:54
    Søren Spelling Lund
    0

    Sure. Just find any orders she placed in the past and grab the order addreses from them:

    PurchaseOrder.All().Where(x => x.Customer == myCustomer).SelectMany(x => x.OrderAddresses).Distinct();
  • Simon Dingley 1474 posts 3431 karma points c-trib
    Jun 01, 2012 @ 10:50
    Simon Dingley
    0

    Is that also possible in XSLT OOTB?

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jun 01, 2012 @ 14:14
    Søren Spelling Lund
    1

    If you've got a member logged in you can use

    CommerceLibrary:GetMemberOrderHistory()

    There's no XSLT API If you just have the customer. Sorry.

  • Simon Dingley 1474 posts 3431 karma points c-trib
    Jul 02, 2012 @ 12:34
    Simon Dingley
    0

    If on my development site I go into the database and manually update addresses to be related to a customer I can get the desired output however I am still struggling to get orders or order addresses to be linked to the logged in customer. Placing orders even when logged in do not appear in the Order History for the logged in customer and the addresses are also not being linked to the customer - am I still missing a step? Is there additional work involved to wire up orders and addresses for the logged in customer?

    I think there really needs to be better documentation on this as I expect it is a very common requirement. If there is already documentation on the subject matter I apologise and it's just not easy to find.

    Thanks, Simon

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jul 02, 2012 @ 14:09
    Søren Spelling Lund
    0

    Remember to turn on "Create members for customers" on your store. uCommerce will relate the two during checkout when enabled.

  • Simon Dingley 1474 posts 3431 karma points c-trib
    Jul 03, 2012 @ 10:59
    Simon Dingley
    0

    Since you have identified that there is an issue in UCommerce that is contributing to this can you advise if there is a way to associate previous orders back to corresponding members, perhaps based on email address?

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jul 05, 2012 @ 09:54
    Søren Spelling Lund
    0

    The address stuff can be a little confusing as we're dealing with two separate types: A customer address and an order address. The two are stored in separate tables and are used a little differently.

    The reason we have separate addresses for orders is to ensure that the order remains constant even if customers update their addresses on their profile.

    Addresses linked to a customer are typically used to prepopulate order addresses during checkout - you can modify or set up new ones with:

    CommerceLibrary:EditCustomerAddress()

    If you wish to modify the customer profile itself you can use:

    CommerceLibrary:EditCustomer()

    Order addresses linked to an order are typically used for either billing or shipping and you can add as many as you want without assigning them to shipping or billing:

    CommerceLibrary:EditOrderAddress()

    And finally billing address is edited with

    CommerceLibrary:EditBillingInformation()

    This last one does the same as EditOrderAddress but also sets the address as the billing address on the current basket.

    Similarly there's an extension to edit shipping info on the default shipment on the order - this works like the EditBillingInformation in that it adds/edits the address and assigns to the default shipment on the order:

    CommerceLibrary:EditShipmentInformation()

     

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jul 05, 2012 @ 11:31
    Søren Spelling Lund
    0

    I spoke too soon on the issue. Further tests show that member are being created as expected and logged in members are associated with the customer profiles as well. Something else is going on here.

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jul 18, 2012 @ 12:11
    Søren Spelling Lund
    0

    Turns out that uCommerce is working as expected. It's just that the process of linking customers and members can be a little tricky so here's how the process works:

    • To get uCommerce to link customers to members the store profile needs to have "Create members for customers" checked in the backend.
    • This will do one of two things:
    • A) Create a new member for the customer using the billing e-mail address as login if the customer is not logged in and link it to the customer
    • or B) if the customer is logged in that member will be linked to the customer.

    Now the trick is that the customer profile created during checkout uses the supplied billing e-mail address to create or find an existing customer (not to be confused with the member profile).

    If a customer uses "[email protected]" as billing e-mail and logs in with "[email protected]" we'll end up in a situation where the customer e-profile mail is "[email protected]" and the member profile it's linked to has e-mail address "[email protected]".

    This might be a little confusing if the customer logs in with "[email protected]" and sees order history for "[email protected]", but it's alright because the link was created because the customer was logged in with "[email protected]" and thus the customer profile was linked to this member.

    Hope it makes sense :)

Please Sign in or register to post replies

Write your reply to:

Draft