Mar 04, 2026 · A blog about WooCommerce from Iconic. Get tips, news, code snippets, and tutorials on all things WooCommerce . fullscreen, multiple images per variation, and customisable layout options for your product imagery. (255) $79 . View Checkout, Shipping. WooCommerce Delivery Slots . Choose a delivery date and time for each order. Add a limit to the . WooCommerce Blog
The app relies on the Backbone.js stack in order to maintain its internal state and update its views. . string get_selected_variation() Returns the ID of the selected variation. . The extension allows you to customize the way active scenarios are matched using the woocommerce_composite_scenario_action_settings filter. JavaScript API Reference
Managing Orders An order also has a Status. Order statuses let you know how far along the order is, starting with “Pending payment” and ending with “Completed.” The following order statuses are used: 1. Pending payment— Order received, no payment initiated. Awaiting payment (unpaid). 2. Failed — Payment failed or was declined (unpaid) or requires authentication (SCA). Note that this status may not show immediately and instead show as Pendinguntil verified (e.g., PayPal). 3. Processing — Payment received (paid) and stoc…
Aug 06, 2026 · [is_variation] => 0 [is_taxonomy] => 1 I know that there is a value because it is shown in the attribute section, but I just can't find a way to get it displayed with my custom code. woocommerce Get custom product attributes in Woocommerce
Sep 14, 2026 · Thanks for the great post. I suggest one minor change. To display the item in the cart, it’s better to use the hook ‘woocommerce_get_item_data’ (instead of ‘woocommerce_cart_item_name’ as you have done). With this, the field will automatically display … Add Custom Cart Item Data in WooCommerce
WC_Product_Variable::get_available_variations Get an array of available variations for the current product. woocommerce WC_Product_Variable::get_available_variations()
When a WooCommerce customer is logged in, you might want to show the list of purchased products, for example in a custom “My Account” tab.. I decided to code this as a shortcode, so that you can use the snippet anywhere in your WooCommerce templates, as long as the user is logged in and as long as it has processing or completed orders. Enjoy! WooCommerce: Display All Products Purchased by User
Get the WC_Order object. The correct WC_Order_Item_Product method to get WC_order object is: get_order () Get and unprotecting the data and meta data using WC_Data methods: get_data () get_meta_data () Get The WC_Product object from the order item ID: $order_item_id = 15; $item = new WC_Order_Item_Product ($order_item_id); // The product ID $product_id = $item->get_product_id (); // The variation ID $product_id = $item->get_variation_id (); // The WC_Product object $product = $item->get . Get Order items and WC_Order_Item_Product in WooCommerce 3 .
Apr 04, 2026 · In this quick tutorial I will show you how to add a link to the order edit page on the WooCommerce New Order email notifications, to the store administrator.It is a very simple, yet useful link to have since you can just click on it and go to the order, right from within your email. Add a Link Back to the Order in WooCommerce New Order .
If you have access to the product ID (once again, usually the do_action or apply_filters will make this possible to you), you have to get the product object first. Then, do the exact same things as above. $product = wc_get_product ($product_id); WooCommerce: Get Product Info (ID, SKU, $) From $product .
WooCommerce 2.6 added support for REST API endpoints based on the WordPress REST API infrastructure.. Product Bundles extends the /products/ and /orders/ endpoint responses with 2 new properties: bundled_by and bundled_items.. In product context, bundled_by lists all product bundle IDs that a product has been added to, while bundled_items lists the bundled item data associated with a … REST API Reference
Jun 06, 2026 · The woocommerce_order_items has a reference to the Order ID with the order_id field, but thewoocommerce_order_itemmeta has a Product ID in the meta_value as a string. Joining these two tables will allow us to grab the Order ID, but since the Product ID is stored in the meta_value field, a dynamic column will have to be created to evaluate . Get All Orders For A Product In WooCommerce
To update the existing order items you can use wc_update_order_item ( $item_id, $args), where $args is the array with the same parameters wc_add_order_item () accepts and wc_update_order_item_meta ( $item_id, $key, $value, $prev_value ). If you want to reattach an … Order Items in WooCommerce
Once you have the order items list, all of them will have a get_product_id () method, items with a variation will also return a value for get_variation_id (). Here is an example of how you can use them: https://wordpress.stackexchange.com/questions/97176/get-product-id-from-order-id-in-woocommerce… WC Item Variation Value
Add custom fields for Product orders for WooCommerce v3.0 and above. Product fields can be customized as required. Data is displayed on Order and Cart Page. We have previously seen how we can add custom data to a WooCommerce order in 6 simple steps. That approach comprised of the addition of data to a custom sessi How to Add Custom Data to WooCommerce Order
Jun 29, 2026 · Updating Order Item Meta wc_update_order_item_meta( $item_id, $meta_key, $meta_value, $prev_value = '' ) This function will also return true or false. Getting Order Item Meta wc_get_order_item_meta( $item_id, $key, $single = true ) This function will return the meta. The difference here is that you’ll get a single result by default. How to manage Order Item Meta in WooCommerce
Mar 01, 2026 · Get Order ID in WooCommerce Using Plugin To get the product or order IDs quickly from your WordPress dashboard you can use a plugin like Reveal IDs WordPress plugin. When you install this plugin you can see the IDs for WooCommerce products or Order ID from the dashboard as shown on the image below: How to Get Order ID in WooCommerce Code How to Get Order ID In Woocommerce [ 3 Options ] » NJENGAH
get_order_items: Modifies bundle parent/child order items depending on their shipping setup. Used to reconstruct an accurate physical representation of a bundle, typically as a callback conditionally attached to the woocommerce_order_get_items filter when exporting order data to external fulfillment, shipping or inventory management services. Functions Reference
Add the custom field to REST API orders function get_product_order_custom_field( $response, $object, $request ) { // Check if response has data if(empty( $response->data )) { return $response; } // Loop through all line items (products) foreach ($response->data['line_items'] as $line_item_key => $line_item_value) { // Get the Product ID (PID) $order_pid = $response->data['line_items'][$line_item_key]['product_id']; // Get the variation ID (VID) $order_vid = $response->data['line_items . WooCommerce: Add Custom Field to Product Variations
Once a customer places an order, you might want to know if such order contains a given product ID. you can use this for tracking purposes, redirect to a custom thank you page or run your custom functions. Either way, checking this is quite simple thanks to the “woocommerce_thankyou” hook which runs on the order received page. Enjoy! WooCommerce: Check if Product ID is in the Order
Whether the variation is a downloadable item or not. yes/no: no: virtual: Whether your item’s variation is a non-physical object or not. yes/no: no: regular_price: Required for all variations. Normal price of your variation. Float (Decimal number) 99.99: sale_price: Sale price of your variation, if it’s on sale. Float (Decimal number) 69.99 . Column Header Reference
Oct 10, 2026 · add_filter( 'woocommerce_add_cart_item_data', 'add_cart_item_data', 10, 3 ); function add_cart_item_data( $cart_item_data, $product_id, $variation_id ) { // get product id & price $product = wc_get_product( $product_id ); $price = $product->get_price(); // extra pack checkbox if( ! empty( $_POST['extra_pack'] ) ) { $cart_item_data['new_price'] = $price + 15; } return $cart_item_data; } How to update product price programmatically in WooCommerce
Apr 12, 2026 · As I am creating sellable custom post type via WooCommerce I stumbled on the following problem. When a post is ordered, it is a WC_Order_Item_Product object. The problem with that class is that there is a check in the set_product_id method if the post type is product.. I see that the create_order_line_items method of the WC_Checkout class is responsible for the object saving. Saving an item in a different object than "WC_Order_Item .
Sep 20, 2026 · WooCommerce 3.x or above. WooCommerce 2.6.x or below. Okay now, how do I use it? First add getOrderDetailById() to your active theme functions.php or to any active plugin PHP file. Then call getOrderDetailById() from anywhere in your app by passing the Order ID like below. Using WooCommerce Shipment Tracking and want’s to add that as well? WooCommerce
Export WooCommerce Orders: Order ID, Number, Status, Dated, Time, Currency, Payment method, you name it, and the plugin will include it in your report. Export WooCommerce Orders Items: Customized report for order items (other than Order report) that includes +40 to select from. Products & Order Export for WooCommerce – WordPress plugin .
This will display a list of orders items IDs for this variation ID with some data (for example). $items_ids = get_all_orders_items_from_a_product_variation ( 41 ); // Iterating through each order item foreach ( $items_ids as $item_id ) { // Getting some data (the color value here) $item_color = wc_get_order_item_meta ( $item_id, 'pa_color', true ); // Displaying some data related to the current order item echo 'Item ID: '. $item_id … php Code sample
function get_all_orders_and_item_ids_that_have_a_product_variation( $variation_id ){
global $wpdb;
$results = $wpdb->get_results( $wpdb->prepare( "
SELECT items.order_id, items.order_item_id AS item_id
FROM {$wpdb->prefix}woocommerce_order_items AS items...
If you have access to the order ID (once again, usually the do_action or apply_filters might give you this), you have to get the order object first. Then do the exact same things as above. $order = wc_get_order ($order_id); if ($order) { WooCommerce: Get Order Info (total, items, etc) From .
Jun 01, 2026 · Product Attribute/Variation Sort Order Type. To change the attribute or variation sort order type alphabetically, by term ID, or a custom sort order: In the left-hand menu, click Products and then click Attributes. On the WooCommerce Attributes page, hover over the attribute you want to change (in this example Size) and click Edit. How to Change WooCommerce Variations and Attributes Sort Order
Introduction. WooCommerce (WC) 2.6+ is fully integrated with the WordPress REST API. This allows WC data to be created, read, updated, and deleted using requests in JSON format and using WordPress REST API Authentication methods and standard HTTP verbs which are understood by most HTTP clients. WooCommerce REST API Documentation
Description. This plugin lets you set custom order numbers in WooCommerce.. Main Features. WooCommerce order numbers can be sequential, random or by order ID.; Sequential counter can be set to automatically reset on daily, monthly or yearly basis.; Custom numbers will be assigned to new orders automatically.; There is also a tool to renumerate (i.e. recount) existing orders. Custom Order Numbers for WooCommerce
Last week we posted an introduction to the WooCommerce REST API, which detailed basic request/responses and authentication.In this article, we’ll go in-depth with a hands-on look at the Orders endpoint. You’ll learn all the different ways order information can be fetched from the API, as well as how to update the status of an order via the API. Using the WooCommerce REST API – Orders Endpoint – SkyVerge
Jun 29, 2026 · I work with WooCommerce plugin and I work on customizing it. The one thing I have observed on various discussions forums and Q&A; forums repeatedly is that adding custom data to the WooCommerce order is always a point of contention.. However, these discussions are so specific to a certain step in the process that the entire picture is never made clear to the readers. How to Add Custom Data to WooCommerce Order
Dec 23, 2025 · Add a custom WooCommerce form to your product pages. Create your WordPress form however you would like, add a calculation to generate the total, and select your form in the sidebar box on the WooCommerce page. The product price used in your WooCommerce cart comes from the last calculation field in your form. Add custom WooCommerce forms to products
As WooCommerce developer, every day I repeat many coding operations that make me waste time. One of them is: “How to get ____ if I have the $order How to get WooCommerce Order Information?
The third argument $variation is a post object which has the id, ex $variation->ID. Other wise the $variation_data array also do have the id $variation_data['variation_post_id'] . And for updating the values into meta, you can use woocommerce_save_product_variation hook, which comes with two argument $$variation_id , $i (index key/number) – Shazzad Jan 15 '14 at 21:57 php
Nov 21, 2026 · ONLY FOR WOOCOMMERCE VERSIONS 2.5.x AND 2.6.x. For WOOCOMMERCE VERSION 3.0+ see THIS UPDATE. Here is a custom function I have made, to make the things clear for you, related to get the data of an order ID. How to get WooCommerce order details
WooCommerce lets you add your own custom cart item data. This article is your ultimate guide to two filters – woocommerce_add_cart_item_data and woocommerce_add_to_cart_validation – and how you can use them to validate custom fields then add the data to the cart and the order. How to add WooCommerce custom cart item data Add custom cart item data in WooCommerce
$order = wc_get_order( 65 ); $order_items = $order->get_items(); foreach( $order_items as $item_id => $item ){ // methods of WC_Order_Item class // The element ID can be obtained from an array key or from: $item_id = $item->get_id(); // methods of WC_Order_Item_Product class $item_name = $item->get_name(); // Name of the product $item_type = $item->get_type(); // Type of the order item … wc_get_order() – Gets the data of the specified order in .
Dec 11, 2025 · If you ever wonder how to change the product price while adding to cart.? Now WC Fields Factory support this feature, it has advanced configuration to override the Product Pricing. You can also add custom Fee too. First, why would you ever wanted to do that.? good question. Woocommerce
WC_API_Orders::get_order Get the order for the given ID woocommerce WC_API_Orders::get_order()