• Resolved mirceaburdusa

    (@mirceaburdusa)


    I have created a few custom checkout fields using the WooCommerce documentation available here: https://woocommerce.com/document/tutorial-customising-checkout-fields-using-actions-and-filters/

    My problem stems from the fact that these custom fields are saved on the order object. Because of this, when the client wants to make a new order, the custom fields are not populated.

    The obvious solution would be to save the custom field data on the $user object, not only on the $order object, like WooCommerce does by default for some of the fields like Billing Name, Billing country etc. But I do not know how to do this for a custom field. Is there a canonical way to accomplish this?

    I know I can get the current user, loop through his order history, take the latest order and get the values from there and populate the checkout field with them, but I was wondering if there is a proper way to do this, because it seems like a hack to me.

Viewing 1 replies (of 1 total)
  • Hi @mirceaburdusa

    Thanks for sharing the details.

    As this is a complex development related question, I’m going to leave it open for a bit to see if anyone is able to chime in to help you out here.

    We recommend the WooCommerce Developer Resources Portal for resources on developing for WooCommerce.

    You can also visit the WooCommerce Facebook group or the #developers channel of the WooCommerce Community Slack. We’re lucky to have a great community of open-source developers for WooCommerce, and many of our developers hang out there, as well.

    This specific forum is more focused on the default WooCommerce core features. You might get more insights by posting your question on the above channels for developers.

    If you’re not receiving input on this thread, we can recommend reaching out to one of the customization experts listed here: https://woocommerce.com/customizations/.

Viewing 1 replies (of 1 total)
  • The topic ‘Populate custom checkout fields with data from previous orders’ is closed to new replies.