OrderLineItems
Add, update and view the line items for an order.
Table Specific Information
Select
WooCommerce allows only a small subset of columns to be used in the WHERE clause of a SELECT query. Following columns are supported server side, all other columns are processed client side. If the 'OrderId' filter is not specified, the server will fetch a list of all the orders and perform a request for each order in the list.
- OrderId supports the '=,IN,NOT IN,ORDER BY' operators.
SELECT * FROM OrderLineItems WHERE OrderId = 13 SELECT * FROM OrderLineItems WHERE OrderId IN (13,14) SELECT * FROM OrderLineItems WHERE OrderId NOT IN (13,14) SELECT * FROM OrderLineItems ORDER BY OrderId
Insert
The following attribute is required when performing an insert: OrderId.
INSERT INTO OrderLineItems (Productid, Quantity, OrderId) VALUES (28, 9, 35)
Update
The following attribute is required when performing an update: OrderId.
UPDATE OrderLineItems SET Quantity = 12 WHERE Id = 4 AND OrderId = 35
Columns
| Name | Type | ReadOnly | References | Description |
| Id [KEY] | Long | False |
Item ID. | |
| Name | String | False |
Product name. | |
| ProductId | Long | False |
Product ID. | |
| VariationId | Long | False |
Variation ID, if applicable. | |
| Quantity | Integer | False |
Quantity ordered. | |
| TaxClass | String | False |
Tax class of product. | |
| Subtotal | String | False |
Line subtotal (before discounts). | |
| SubtotalTax | String | True |
Line subtotal tax (before discounts). | |
| Total | String | False |
Line total (after discounts). | |
| TotalTax | String | True |
Line total tax (after discounts). | |
| Taxes | String | True |
Line taxes. See Order - Taxes properties read-only | |
| MetaData | String | False |
Meta data. See Order - Meta data properties | |
| Sku | String | True |
Product SKU. | |
| Price | String | True |
Product price. | |
| OrderId [KEY] | String | True |
Orders.Id |
Id of the order. |
Pseudo-Columns
Pseudo column fields are used in the WHERE clause of SELECT statements and offer a more granular control over the tuples that are returned from the data source.
| Name | Type | Description |
| ReferenceNumber | String |
This column will be used in Bulk operations to get specific values from the Temp tables. |