1. Documentation /
  2. Order Tags

Order Tags

Installation

↑ Back to top

Download, install and activate the extension.

It is strongly recommended you initially use a staging/development environment and test the extension before use on a production website.

If you haven’t already, connect your store to your WooCommerce account. This ensures you get extension update notifications when available.

Quick start guide

↑ Back to top
  • Perform the installation steps above
  • Go to WooCommerce > Order Tags from your dashboard
  • Create an order tag
  • Click into the order tag you created
  • Populate colors and any specific rules required which assign the order tag
  • Save changes, this order tag will now be assigned to any future matching orders
  • You can also apply the order tag manually when adding/editing an order

Dashboard

↑ Back to top

Introduction

↑ Back to top

To access the dashboard go to WooCommerce > Order Tags.

Add order tag

↑ Back to top

To add an order tag from the dashboard, simply populate the settings on the left and click the add new order tag button.

Creating an order tag via the dashboard
  • Name
    • Name of the order tag which will be displayed.
  • Parent order tag
    • Allows you to define the order tag as a child of another order tag, this is purely for managing order tags hierarchically in the dashboard.
  • Description
    • The description entered will be displayed upon hovering over the order tag on an order.

Edit order tag

↑ Back to top

Once you have created an order tag, it will appear in the dashboard in the table list.

Click on the name of the order tag you wish to edit to reveal the order tag options, such as name, slug, assignment options.

Managing order tags via the dashboard

General options

↑ Back to top

There are some general options available, these are populated during the creation of the tag but can be edited if required.

Editing general options on an order tag
  • Name
    • Name of the order tag which will be displayed.
  • Slug
    • A unique reference used for the order tag internally, you can leave this alone, or if you have a specific reason to change the slug you can do so. It is generally recommended to leave this as the default.
  • Parent order tag
    • Allows you to define the order tag as a child of another order tag, this is purely for managing order tags hierarchically in the dashboard.
  • Description
    • The description entered will be displayed upon hovering over the order tag on an order.
  • Color background
    • Sets the background color of the tag, if empty defaults to #000000.
  • Color text
    • Sets the text color of the tag, if empty defaults to #ffffff.

Assignment options

↑ Back to top

Orders can be assigned automatically and/or manually.

Automatic assignment

↑ Back to top

“Set on” conditions

When editing an order tag you can apply one or more “set on” automatic assignment conditions.

Configuring “set on” assignment conditions
  • On order placed
    • Sets the tag when an order is placed via checkout or adding an order via dashboard. Some payment methods may also immediately update the order after it has been placed e.g. to change order status once payment confirmed.
  • On order update
    • Sets the tag when an order is updated. If a tag is attempted to be removed manually from an order this may cause it to be restored automatically upon update if the “Set If” conditions are met.
  • On order subscription renewal
    • Sets the tag when a subscription renewal order gets created. Requires WooCommerce Subscriptions, this option is only visible when the WooCommerce Subscriptions extension is active.

“Set if” conditions

Once you’ve set some “set on” conditions, you then need to set some “set if” assignment conditions, if the order matches these conditions the order tag will be automatically assigned upon the “set on” conditions.

Configuring “set if” assignment conditions
  • Coupon
    • Sets the tag if the order used coupon(s).
  • Customer
    • Sets the tag if the order is by a specific customer(s). By default customers are shown for selection here if they have the “customer” user role, use the wcot_order_tags_customer_roles filter hook to include customers with custom roles.
  • Customer order count
    • Sets the tag based on the amount of orders the customer has placed including the current order. For accuracy it is recommended this is only set on order placed as the customer order count may have increased by the time the order is updated.
  • Customer role
    • Sets the tag if the order is by a customer with a specific role(s).
  • Item count
    • Sets the tag based on the amount of items within the order, including multiple quantities of the same item.
  • Meta data
    • Sets the tag if the order has specific meta data(s). See the meta data reference section in this documentation for further details.
  • Order status
    • Sets the tag if the order has a specific order status(es). It is recommended this is used in conjunction with other “Set If” conditions than individually.
  • Order total
    • Sets the tag based on the order total.
  • Payment method
    • Sets the tag based on the payment method(s) used.
  • Product
    • Sets the tag if the order contains a specific product(s).
  • Product category
    • Sets the tag if the order contains a product from a specific category(s).
  • Product meta data
    • Sets the tag if the order contains a product which has specific meta data(s). See the meta data reference section in this documentation for further details.
  • Product tag
    • Sets the tag if the order contains a product with a specific tag(s).
  • Shipping method
    • Sets the tag based on the shipping method(s) used.
  • Shipping method instance
    • Sets the tag based on the shipping method instance(s) used.
  • Shipping zone
    • Sets the tag based on the shipping zone(s) used. Shipping zone(s) determined from the order’s shipping method instance when order placed/updated.
Operators

Some of the “set if” conditions allow you to specify an operator and a value, these are used where you want to perform a calculation or check the value contents, here is a list of what each operator does:

Operator Description
= Set the tag when the “set if” condition equals the value entered
!= Set the tag when the “set if” condition does not equal the value entered
>= Set the tag when the “set if” condition is greater than or equals the value entered
> Set the tag when the “set if” condition is greater than the value entered
<= Set the tag when the “set if” condition is less than or equals the value entered
< Set the tag when the “set if” condition is less than the value entered
contains* Set the tag when the meta data contains the value entered
not_contains* Set the tag when the meta data does not contain the value entered
starts_with* Set the tag when the meta data starts with the value entered
ends_with* Set the tag when the meta data ends with the value entered

*Only available for “set if meta data” and “set if product meta data” conditions.

“Set if” mode

  • All
    • If set to all then if all of the “Set If” conditions enabled are met it sets the tag.
  • Any
    • If set to any then if any of the “Set If” conditions enabled are met it sets the tag.

Manual assignment

↑ Back to top

To manually assign order tags to an order there a few options:

  • When editing an order you can manually apply any order tag by using the order tags meta box
  • On the orders list you can select a number of orders and use bulk actions to assign a specific order tag

If you have an automatic assignment rule on order update those rules may override the manual assignment you are applying e.g. if attempting to remove an order tag.

Manually assigning a tag to an order
Setting an order tag via bulk actions on the orders list

Order management

↑ Back to top

Orders list

↑ Back to top

From the orders list you can see the order tags on each order, filter the list by a specific order tag and perform bulk actions.

Order list row showing order tags
Filtering orders list by a specific order tag
Setting an order tag via bulk actions on the orders list

Order details

↑ Back to top

When viewing an individual order the order tags are shown in the general section.

Order details showing order tags

Bulk set or reset order tags

↑ Back to top

This information is for setting order tags on all your orders, if you simply want to select specific orders and bulk set order tags use bulk actions from the orders list instead.

There are 2 bulk order tag options, these allow you to set order tags on all orders in your store, this is useful if you want to set order tags on orders from before the Order Tags extension was installed or if you want to reset order tags on orders.

To use this functionality you must be logged into your WordPress dashboard and be a user who has the manage_woocommerce capability, which administrators and shop managers have.

  • Navigate to the order tags page (by clicking Order Tags from the dashboard menu)
  • In the address bar add &wcot_order_tags_set_tags_bulk=1 or &wcot_order_tags_set_tags_bulk=2 to the end of the URL e.g. https://yourwebsite.com/wp-admin/edit-tags.php?taxonomy=wcot_order_tag&wcot_order_tags_set_tags_bulk=1
    • &wcot_order_tags_set_tags_bulk=1 will set order tags where not previously set
    • &wcot_order_tags_set_tags_bulk=2 will remove all order tags from each order (including any manually added order tags) and then will set order tags where not previously set
  • Press enter (as if you have typed in a web address and pressing enter to load the page)
  • You will then see a notice that the order tags have been set
  • We recommend navigation away from the current page (such as by clicking back to the WordPress dashboard), this is just to ensure you don’t refresh the page while still on the wcot_order_tags_set_tags_bulk based URL which would trigger another bulk set/reset

If you have a large amount of orders then bulk set or reset order tags is not recommended due to potential time out issues due to the sheer amount of data.

It is not possible for some order tags to be set/reset on old subscription derived orders that were originally created automatically from subscriptions using the bulk set/reset functionality. This is because some of the data required to set the order tags is got from the parent subscription, however in this scenario that subscription may have since been updated with different data than was present at the time the old subscription derived order was placed, so if these order tags were set they might not be correct as the subscription has updated data, so some order tags on old subscription derived orders may not get applied where the data potentially may have been updated on the parent subscription.

It is recommended you take a backup before using this functionality and test on a staging/development environment before performing on a production website.

Export orders with order tags

↑ Back to top

Order tags aren’t saved as order meta, for more details on how order tags data is stored, see the order tags data storage section in this documentation.

Iif you wish to export order data including order tags it requires the export process to specifically find the order tag data.

A third party product, Advanced Order Export For WooCommerce by AlgolPlus, allows orders to be exported with order tags, however it requires a specific configuration applying.

Learn how to configure this product specifically for an order tags export in their documentation.

Note that we cannot offer support for this functionality as it is via a third party product.

Meta data reference

↑ Back to top

When using using automatic assignment you can use the “set if meta data” (for order meta) or “set if product meta data” (for product meta) to set a tag if the order, or product in an order, has specific meta data, which is the data in the database associated with an order/product.

There is standard meta that is included on all orders/products by WooCommerce, then potentially custom meta data coming from other products, like plugins.

Order meta data

↑ Back to top

Here is a list of standard WooCommerce order meta keys which might be useful when setting order meta data based automatic assignment rules:

  • _customer_user
  • _order_key
  • _order_currency
  • _billing_first_name
  • _billing_last_name
  • _billing_company
  • _billing_address_1
  • _billing_address_2
  • _billing_city
  • _billing_state
  • _billing_postcode
  • _billing_country
  • _billing_email
  • _billing_phone
  • _shipping_first_name
  • _shipping_last_name
  • _shipping_company
  • _shipping_address_1
  • _shipping_address_2
  • _shipping_city
  • _shipping_state
  • _shipping_postcode
  • _shipping_country
  • _shipping_phone
  • _completed_date
  • _paid_date
  • _edit_last
  • _cart_discount
  • _cart_discount_tax
  • _order_shipping
  • _order_shipping_tax
  • _order_tax
  • _order_total
  • _payment_method
  • _payment_method_title
  • _transaction_id
  • _customer_ip_address
  • _customer_user_agent
  • _created_via
  • _order_version
  • _prices_include_tax
  • _date_completed
  • _date_paid
  • _payment_tokens
  • _billing_address_index
  • _shipping_address_index
  • _recorded_sales
  • _recorded_coupon_usage_counts
  • _download_permissions_granted
  • _order_stock_reduced
  • _new_order_email_sent

Product meta data

↑ Back to top

Here is a list of standard WooCommerce product meta keys which might be useful when setting product meta data based automatic assignment rules:

  • _visibility
  • _sku
  • _price
  • _regular_price
  • _sale_price
  • _sale_price_dates_from
  • _sale_price_dates_to
  • total_sales
  • _tax_status
  • _tax_class
  • _manage_stock
  • _stock
  • _stock_status
  • _backorders
  • _low_stock_amount
  • _sold_individually
  • _weight
  • _length
  • _width
  • _height
  • _upsell_ids
  • _crosssell_ids
  • _purchase_note
  • _default_attributes
  • _product_attributes
  • _virtual
  • _downloadable
  • _download_limit
  • _download_expiry
  • _featured
  • _downloadable_files
  • _wc_rating_count
  • _wc_average_rating
  • _wc_review_count
  • _variation_description
  • _thumbnail_id
  • _file_paths
  • _product_image_gallery
  • _product_version
  • _wp_old_slug
  • _edit_last
  • _edit_lock

The associated values for these keys are sometimes in a specific format, however it isn’t feasible for us to provide details of every possible format in this documentation, consider reviewing the database data to understand the formats required.

These lists were taken from WooCommerce 8.9.0, future updates since then may mean these lists are outdated.

Order tags data storage

↑ Back to top

Order tags registers a taxonomy in WordPress with the key wcot_order_tag, on the shop_order post type, this also applies when High Performance Order Storage (HPOS) is enabled, HPOS doesn’t use the shop_order post type, but has compatibility with the shop_order post type in a register taxonomy context.

Each order tag is a term with a relationship to the wcot_order_tag taxonomy, order object, etc.

When order tags are created, set on an order, etc, the data is stored as per the native WordPress taxonomy data storage methods, data can be added to these database tables:

  • wp_termmeta
  • wp_terms
  • wp_term_relationships
  • wp_term_taxonomy

Retrieval, querying, etc of this data is as per the native WordPress taxonomy data storage methods. These native WordPress taxonomy data storage methods are the standard means of handling tag data in WordPress, it is the same storage mechansim used by WordPress itself to manage tag data on blog posts.

If your store receives a large amount of orders on a daily basis, before enabling order tags on a production website, we recommend you first use a staging/development environment to create some automatically assigned order tags, then use an order simulator plugin, like Order Simulator for WooCommerce to test order tags get set on orders, and there are no other issues for the approx number of orders you receive before using the extension on a production website, when simulating orders on a staging/development environment take precautions, e.g. disabling outbound emails.

Custom development

↑ Back to top

The following information is provided for custom development purposes for web developers, they are useful if you wish to add custom features or modify how the extension works. As per the WooCommerce support policy we cannot offer any support for your use of these custom development features.

Filter hooks

↑ Back to top
Filter hookDescription
wcot_order_tags_color_defaultDefault hex code background color used for order tags if empty
wcot_order_tags_color_text_defaultDefault hex code text color used for order tags if empty
wcot_order_tags_customer_rolesCustomer roles to include customers with custom roles in the set if customer field when adding/editing an order tag
wcot_order_tags_set_if_product_variationsAllows individual variations of a variable product to be selectable in the set if product order tag assignment field
wcot_order_tag_taxonomy_argsFilter the register_taxonomy arguments of the order tags taxonomy

Functions

↑ Back to top
FunctionReturn
wcot_order_tags_get_all_order_tagsArray of term objects
wcot_order_tags_get_order_tagsArray of term objects
wcot_order_tags_get_order_tag_htmlHTML string for specific order tag
wcot_order_tags_set_order_tagArray, false or error

BETA functionality

↑ Back to top

We may occasionally include BETA functionality, this is highlighted with a (BETA) label. Functionality with this label should be used with caution and is only recommended to be tested on a staging/development environment. The functionality is included so users can test the functionality/provide feedback before it becomes stable, at which point the (BETA) label will be removed. Note that there may be occasions where BETA functionality is determined unsuitable for use and removed entirely.

Caching

↑ Back to top

If you are using any form of caching then it is recommended that the cache lifespan/expiry should be set to 10 hours or less. This is recommended by most major caching solutions to avoid potential issues with WordPress nonces.

Screen sizes

↑ Back to top
  • Frontend: Where elements may be displayed they will fit within the screen width
  • Backend: Where interfaces may be displayed it is recommended to use a desktop computer with a resolution of 1920×1080 or higher, for lower resolutions any interfaces will attempt to fit within the screen width but some elements may be close together and/or larger than the screen width

Translation

↑ Back to top

We generally recommend Loco Translate to translate and/or adapt text strings within this product.

Works with

↑ Back to top

Where we have explicitly stated this product works with another product, this should only be assumed accurate if you are using the version of the other product which was the latest at the time the latest version of this product was released. This is because, while usually unlikely, the other product may have changed functionality which effects this product.

FAQs

↑ Back to top

Is it compatible with a specific theme?

↑ Back to top

This extension will generally be compatible with most themes. There may be a small number of themes that are fully or partially incompatible due to clashes in functionality and/or if the theme has removed or adapted core WooCommerce functionality. If you would like to know if a specific theme will be compatible before purchase then please contact us and we can advise, it may not be possible for us to determine this e.g. if the theme requires a license and/or several configuration steps. In this scenario you are welcome to purchase and test this extension with the theme and if there is a a compatibility issue you can take advantage of the refund policy for this extension.

Is it compatible with a specific extension/plugin?

↑ Back to top

This extension will generally be compatible with most extensions/plugins. There may be a small number of extensions/plugins that are fully or partially incompatible due to clashes in functionality and/or if the extension/plugin has removed or adapted core WooCommerce functionality. If you would like to know if a specific extension/plugin will be compatible before purchase then please contact us and we can advise, it may not be possible for us to determine this e.g. if the extension/plugin requires a license and/or several configuration steps. In this scenario you are welcome to purchase and test this extension with the other extension/plugin and if there is a a compatibility issue you can take advantage of the refund policy for this extension.

Is it compatible with a specific page builder?

↑ Back to top

This extension will generally be compatible with most page builders. There may be a small number of page builders that are fully or partially incompatible due to clashes in functionality and/or if the page builder has removed or adapted core WooCommerce functionality. If you would like to know if a specific page builder will be compatible before purchase then please contact us and we can advise, it may not be possible for us to determine this e.g. if the page builder requires a license and/or several configuration steps. In this scenario you are welcome to purchase and test this extension with the page builder and if there is a a compatibility issue you can take advantage of the refund policy for this extension.

Support

↑ Back to top

If you need any further assistance with this extension please contact us. Please note that extension support does not include providing assistance with any custom development requirements as per the WooCommerce support policy.