How would you set the "custom_fields" via javascript?

RyuheiRyuhei Member
Hi guys,
More questions. How do you set the custom_fields using the client side javascript library?
I see that you can do something like this for the cart:

FC
.client
.request('https://'+FC.settings.storedomain+'/cart?name=My+Product&price=20')
.done(function(data) {

});
Can you do something like that with the custom fields? (it would be awesome to be able to do it for the multi-ship custom fields too).
I looked through below link, but couldn't find anything on the custom fields.
https://wiki.foxycart.com/v/2.0/javascript

Thanks,
Ryuhei
Comments
  • fc_adamfc_adam FoxyCart Team
    @Ryuhei,

    Could you clarify what you're looking to set up? I'd love to understand the use-case before recommending approaches.
  • RyuheiRyuhei Member
    edited May 2015
    Hey @fc_adam,
    We meet again! Same use-case as the other post, I figured this deserved another post since its for a different part of the problem. The client wants to be able to reset the address information from the review screen (that is of our custom order system). I can easily send the right REST request to our application with updated information. I have to do the same for the FoxyCart setup. It would be used to fill in the address information on the foxycart checkout (for multiship).

    Let me know if that makes sense. I was hoping to just encode and stringify my JSON and attach it in the custom field for later use.
  • fc_adamfc_adam FoxyCart Team
    @Ryuhei,

    When you say reset, do you mean update the saved address for their FoxyCart user to match the updated information they're providing in your form? If so, you'll want to send off an API request server-side to update the address information for the user. You could do that as part of the SSO endpoint script I detailed in your other thread.
  • RyuheiRyuhei Member
    @fc_adam, I just realized that I replied to you in the other post. I'm sorry!
    Here's a link: https://forum.foxycart.com/discussion/9395/best-way-to-pass-customer-session-info-from-javascript-api-to-php-api#latest
Sign In or Register to comment.