Skip Navigation

[Resolved] How can I add a custom field for items in cart?

This support ticket is created 3 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Author
Posts
#2077793

How can I add a custom field for items in woo cart?

#2078417

Hello, Toolset Types can add custom fields to any public post type or to WooCommerce Products. However, WooCommerce does not create separate posts for each Order Item, so there's no easy way for Toolset to add custom fields that apply to each item in an Order. You could add custom fields to the Product post type, but those fields would apply to the Product itself and are not specific to each Order. If I understand what you want to achieve with these fields, I might be able to provide some guidance. Can you provide additional details?

#2078519

Hi,
Thank for your reply, I Need a custom field where in frontend the client can add a number and after the client can see that field in the cart and in the order, and the cart and the order are sort by that number.
I am creating an itinerary sort for crono day
I hope all is more clear
Thanks a lot for your worth help

#2078617

Okay thanks, that clarifies things a bit. Unfortunately Toolset does not provide the features you need to add this type of custom field information to order items in WooCommerce. It sounds like you also need the ability to manipulate the product lists in the Cart and Checkout screens, but Toolset does not provide any hooks or filters specifically for manipulating those WooCommerce lists. I believe you'll need a different 3rd-party plugin or custom programming to achieve exactly what you're looking for here.

Additional information about adding custom fields to order items using custom code:
https://wisdmlabs.com/blog/add-custom-data-woocommerce-order/
https://stackoverflow.com/questions/54402176/save-order-item-custom-field-in-woocommerce-admin-order-pages
https://www.ibenic.com/manage-order-item-meta-woocommerce/
https://ecommerce.grazitti.com/topic/how-to-add-custom-data-to-woocommerce-order/

Additional information about sorting the cart and order items by custom field:
https://kartechify.com/product/sort-woocommerce-products-in-cart-and-order/

#2078899

My issue is resolved now. Thank you!