Prefilling Multi-ship Addresses

sparkwebsparkweb Member, Integration Developer, FoxyShop, Order Desk
in Help edited June 2011
I'm trying to a) preset the multiship country and b) have a drop-down with several addresses that will allow the customer to prefill each multi-ship as they like.

I've just about got it all working, the only problem I'm running into is that I don't think I am presetting the coutry name and state names properly. I gather that I should be using fc_ValidateLocationName("customer_country"); or rather fc_ValidateLocationName("shipto_0_country"); but every time I try to run this I get data array errors. I think this is because the country wasn't initialized properly. And when I run it on page initialization the fc_ValidateLocationName function can't be found.

Any ideas?

Code: http://pastie.org/private/3tsmavwxciugsbphojxpq
Store: camppaks
Version 0.7.1

PS: this is kind of niggling, but I couldn't set the fields names with jQuery because it seems like the field names might be changed after initialization or something because they simply wouldn't set like: $("shipto_" + current_id + "_company").val(camp_name[current_val]);
Comments
  • sparkwebsparkweb Member, Integration Developer, FoxyShop, Order Desk
    Giving this a little nudge... any ideas on how I can programatically validate a pre-filled Country and State?
  • brettbrett FoxyCart Team
    a) Prepopulating the country actually is a known bug that I think will be resolved in v0.7.2. For now... javascript.
    b) I'm not entirely clear on what you're after there... So you're wanting to populate custom fields, or populate the normal address fields?

    Oddly, I just created a ticket related to prepopulation, and in doing so realized that multiship doesn't support prepopulation.

    You want to whisper me a link to take a look at what you have so far?
  • lukeluke FoxyCart Team
    Hey Sparkweb. I haven't dug into this too deeply (yet) but this may help: the method you're looking for is FC.checkout.validateLocationName, not fc_validateLocationName. Does that help?
  • sparkwebsparkweb Member, Integration Developer, FoxyShop, Order Desk
    @Luke, that's exactly what I needed. I got it working now. Thank you.
  • lukeluke FoxyCart Team
    Woo hoo! :)
Sign In or Register to comment.