DK WC Purchase Type Docs

DK WC Purchase Type assigns a configurable Purchase Type to each WooCommerce order line item. Use this guide to configure Purchase Types, update orders, and safely manage types that are already in use. If you still need help or would like to request a feature or enhancement, please email me.

What the Plugin Does

The plugin assigns the configured default Purchase Type when WooCommerce creates product line items during checkout. Administrators can view or change that value from the order edit screen. The value is internal order-item metadata and is hidden from customer-facing order details and emails.

Requirements and Initial Setup

Requirements: WordPress 6.0 or later, PHP 8.0 or later, WooCommerce 8.0 or later, and an installed and activated DK Base Plugin.

  1. Install and activate DK WC Purchase Type through DK Plugins.
  2. Open DK Plugins → Purchase Types. This page requires permission to manage site settings.
  3. Review the initial types and add labels that match your workflow.
  4. Choose an active value under Default Purchase Type and click Save Default.
  5. Open a WooCommerce order to view or change its product line items' Purchase Types.

A new installation starts with these active types: Author, Bad, Proof, Sold, Sold Kindle, Sold MP3, Sold Audiobook, and Donation. Sold is the initial default.

Deactivation and Uninstall

Deactivating the plugin keeps its Purchase Type settings and order-item data. Uninstalling it removes the configured type list and default setting. Purchase Type values already stored on WooCommerce order items are retained.

Managing Purchase Types

The Existing Purchase Types table shows whether each type is active, whether it is the default, and how many stored Purchase Type values currently use that label. The Used count is not an order total: an order can contain multiple items with the same type.

  • Add: Enter a unique, non-empty label. New types are active immediately. Labels are compared without regard to capitalization when checking for duplicates.
  • Rename: Enter a new label beside the type and click Rename. Renaming the default type also updates the default setting.
  • Delete: A type can be deleted only when it is active, is not the default, is not the last remaining type, and is not currently used by any order item.
  • Deactivate: A non-default active type can be deactivated once it is used by at least one order item. This preserves its historical use while preventing it from being selected for other order items.
  • Activate: An inactive type that is still used by at least one order item can be reactivated and made available in order-item dropdowns again.

Historical-data warning: Renaming a type changes the configured label and does not rewrite that label on existing order items. If historical orders must keep reporting under the same label, avoid renaming a type after it has been used; add a new type and deactivate the old one instead.

Choosing the Default

Select a type under Default Purchase Type and click Save Default. The default is assigned to each new checkout line item and is also used by the normalization tool. Keep the selected default active so it remains available when editing orders. The default type cannot be deleted or deactivated.

Editing an Order Item

  1. Open an order in WooCommerce and locate its line items.
  2. Select an active value from the Purchase Type dropdown for each item you need to change.
  3. Save or update the order using the normal WooCommerce order controls.

If an order item already uses an inactive type, that historical value remains visible and is marked inactive. It cannot be selected for a different item unless the type is reactivated.

Normalizing Existing Orders

Normalize Missing Purchase Types scans WooCommerce orders across registered order statuses and assigns the current default to product line items with missing or empty Purchase Type values. Existing nonempty values are left unchanged. It supports WooCommerce High-Performance Order Storage (HPOS).

  1. Verify the current Default Purchase Type. Save any change to the default before normalizing.
  2. Click Normalize Missing Purchase Types.
  3. Review the confirmation and choose Confirm to proceed or Cancel to leave the orders unchanged.
  4. Wait for the request to finish. When items were updated, the settings page shows the number normalized.

The operation processes the entire order history in one request. On a large store, run it during a quiet period and wait for the request to finish rather than refreshing or submitting again. If there were no missing values to fill, a positive update-count notice will not appear.

What Normalization Does Not Change

Normalization does not replace an existing label, migrate renamed types, or reactivate inactive types. Changing the default affects future assignments and missing values filled by this tool; it does not reclassify previously labeled items.

Troubleshooting

  • Delete is unavailable: The type is the default, is the last remaining type, is inactive, or is used by at least one order item.
  • Deactivate is unavailable: The type is the default, is already inactive, or has not yet been used. Delete an unused non-default type instead.
  • A type is missing from an order dropdown: Only active types can be selected. Reactivate the type from the settings page.
  • An older order has no value: Run Normalize Missing Purchase Types after verifying the default.
  • Activate is unavailable: Reactivation requires an inactive type that is still used by an order item. Renaming a used type can separate the new configured label from its historical usage.
  • Add or Rename does not change the list: Use a nonempty label that does not duplicate another configured label. Duplicate checks ignore capitalization.
  • A renamed type has a different Used count: Historical items retain their old labels. Renaming the list entry does not migrate those items.
  • An order change did not persist: Use the order's Update control after selecting the Purchase Type. Reopen the order to check the saved value; selecting the dropdown alone does not save it.