Skip to main content

Checkout Custom Fields

Ripon Sarkar  Do you know how to add a custom field to the basic info section of the checkout?

N_Wanyagah

Ripon Sarkar is it possible to make the fields conditional as well? i.e a field will only appear if a certain product is in cart . We aim to have different extra fields for different products

Craig Grella

N_Wanyagah I got this working conditional upon main product and/or variation item in cart. I'll probaby publish my code to github later when I've got a chance. just shoot me a dm here so i remmeber to post it

N_Wanyagah

Craig Grella Any progress ?

Michael

Hello Shahjahan Jewel , is there a possibility to move this thread about "adding custom fields to the checkout form" to the feature request please?

The current solution is not user friendly and I would think that it has a risk of breaking with future updates.

Thank you.

Rafael Piton

Michael In my opinion, the checkout process is one of the most important things. The team that develops FluentCart should pay more attention to it.

James Blunt

Is this really the best and only way to add custom fields to FluentCart checkout? If so we need a better an easier method.

Craig Grella

James Blunt we definitely need and easier way. I created some code using basixs from the code above and from the dev docs on hooks and filters, but that code needs to be updated when I add items, products, etc. Which is a huge pain in the ass and requires maintenance every time I add products or items.

This is not sustainable in any way on any modern stores that have more than 2 or 3 products. And it requires a dev - which takes it out of reach from most people.

At the sametime, I get it - takes time to roll out features past an MVP. so hopefully they can get it right in the future as they add features to make it comparable to other ecommerce platforms that have had a decade or more to develop.

Craig Grella

Ripon Sarkar very helpful link. I've got this working with multiple custom checkout fields based on the quantify of product and items added to cart. So if someone orders 3 items that require custom fiekds, it will show drop downs on checkout with 3 sections of those fields saved as separate meta.

I've also got a snippet working to show custom checkout fields on the thank you page after order.
But for the life of me - I cannot get his code to work for Step#4 - saving it to customer profile or showing anything on the order screen in admin.

I created a custom admin page to show all the custom orders as a workaround, but I'd love to be able to show the custom meta on the order screen and in customer profile. but I can't get those hooks/filters to work. Do you know if they're still active in the code?

Craig Grella

Ripon Sarkar  very helpful link. I've got this working with multiple custom checkout fields based on the quantify of product and items added to cart. So if someone orders 3 items that require custom fiekds, it will show drop downs on checkout with 3 sections of those fields saved as separate meta.

I've also got a snippet working to show custom checkout fields on the thank you page after order.
But for the life of me - I cannot get his code to work for Step#4 - saving it to customer profile or showing anything on the order screen in admin.

I created a custom admin page to show all the custom orders as a workaround, but I'd love to be able to show the custom meta on the order screen and in customer profile. but I can't get those hooks/filters to work. Do you know if they're still active in the code?

Lovell Herbert

Hi,

I came across your post while working through a similar customization for FluentCart and thought I’d share what I’ve learned in case it’s helpful.

I was able to successfully add custom checkout fields, validate them, save them to FluentCart customer metadata, and prefill them on subsequent checkouts using:

  • fluent_cart/checkout/validate_data
  • fluent_cart/checkout/prepare_other_data
  • $customer->updateMeta()
  • $customer->getMeta()

One thing that initially tripped me up was that FluentCart customer metadata is stored in the fct_customer_meta table. I originally had a mismatch where I was saving to FluentCart customer meta but reading from WordPress wp_usermeta, which made it appear that values were not persisting correctly.

I also confirmed that custom customer metadata can be displayed in the FluentCart Admin Customer Details screen using:

add_filter('fluent_cart/widgets/customer', ...)

However, I have not yet found a way to expose those same fields within the frontend customer account/profile area (/store/account/profile). I tested both:

  • fluent_cart/widgets/customer
  • fluent_cart/widgets/single_customer

and neither appeared to affect the frontend profile screen, although fluent_cart/widgets/customer does work in the admin customer view.

I’m currently waiting on clarification from FluentCart support regarding the recommended approach for extending the frontend customer profile UI.

Were you ever able to find a workaround or supported method for displaying/editing custom customer metadata within the customer account area?

I’d be interested to hear what you discovered.

Thanks!