Awesome Support Documentation

Admin: Metadata

This document is a work in progress!  Not all data is accurate at this time.

This portion of the documentation contains the METADATA items that are stored for The Paid Support extension.

Meta Data Items Stored For The WooCommerce Product Post Type

subscription_as_is_valid

This is used to determine if the current product is usable by the Paid Support add-on.

Location: WooCommerce Product

Format: Text

Sample: yes, no

subscription_as_limit_type

This is used only for Paid Support re-occurring subscription product types. It will hold the type of Paid Support subscription that the product represents.  There are three types:

  • unlimited_number: Used to flag subscriptions that offer an unlimited amount of tickets or time per billing period.
  • limit_to_hour: Used to flag subscriptions that offer a limited amount of time per billing period.
  • limit_to_number: Used to flag subscriptions that offer a limited number of tickets per billing period.

Location: WooCommerce Product

Format: text

Sample: unlimited_number, limit_to_hour,  limit_to_number

subscription_as_type_value

This contains the number of hours or tickets associated with a product and will be used for limiting the number of ticket submissions.

Location: WooCommerce Product

Format: integer/hour format

Sample: 10, 01:00

subscription_as_redirection

This holds the URL that the user will be redirected to if they purchase the product and it is the only product in their cart. It is valid for both one-time and subscription based Paid Support products.  

Location: WooCommerce Product

Format: URL

Meta Data Items Stored For The Awesome Support Ticket Post Type

_wc_order_id

This holds the WooCommerce order id associated with the ticket. 

Location: Ticket

Format: Integer

Example: 1, 2, 3

_wc_order_id_archive

This metakey will be stored once the main _wc_order_id has been deleted. This serves as backup only.

The _wc_order_id metadata item described in the section above will be deleted when admin decides to flag the ticket to prevent it from being counted against the subscription. It is necessary to keep the data because reports and Paid Support in general relies on _wc_order_id for statistic calculation of the specific ticket availability under certain order. Once _wc_order_id have been deleted, the ID will be stored in _wc_order_id_archive instead

Location: Ticket

Format: Integer

Example: 1, 2, 3

_wc_subscription_id

This metakey will store the subscription ID under which the current ticket was opened.

Location: Ticket

Format: Integer

Example: 1, 2, 3

_wc_subscription_type

The subscription type for the subscription under which the current ticket was opened

Location: Ticket

Format: String

Example: limit_to_number, limit_to_hour, unlimited

_wc_subscription_limit_total

The total limit of the subscription under which the current ticket was opened. Only good for limit to hours and number of ticket type of subscriptions. Unlimited and one time subscriptions do not use or store this meta.

Location: Ticket

Format: Integer

Example: 1, 2, 3

_wc_product_id

The WooCommerce product ID  under which the current ticket was opened.

Location: Ticket

Format: Integer

Example: 1, 2, 3

_wc_subscription_product_id

The only difference between _wc_product_id and this meta is that this one is only being stored if the current ticket has subscription.

Location: Ticket

Format: Integer

Example: 1, 2, 3

_paid_support_credited

This meta item is used to indicate whether or not a ticket is to be counted against a subscription. A checkbox is shown in the ticket detail admin screen to set/unset this item.

Depending on the type of product, it will determine which meta values are used for certain calculations.  The value of _paid_support_used is taken into account in certain calculations.  ( If single purchase of One Time support; value of _paid_support_good_for_left is the one considered if the ticket is part of of a Subscriptions product.

If the ticket has “_paid_support_credited” and the value is 1, the ticket will not be used for calculating the number of tickets remaining that the user can submit.

E.g. User currently subscribed to Daily Blocks: 3 Tickets and submitted 2 tickets, he will then be able to submit only 1 ticket before the plugin restrict the submission. However, the admin decided that one of 2 submitted tickets should not be credited( by flagging the ticket ). The user can submit 2 tickets instead of 1. This calculation relies on _paid_support_credited metadata. This can be found on ticket post type.

This only accepts integer either 1 or 0.

Location: Ticket

Format: Integer

Sample: 1, 0

_paid_support_wc_product_type

This value comes from ticket submissions where we store the type of Awesome Support WC product that this ticket has been submitted from. Values can either be subscription or one-time.

Location: Ticket

Format: String

Example: subscription, one-time

Other Meta Data Items (Mostly Associated With The WC Order Post Type)

_paid_support_product_id

An array containing the products that the user purchased at the time this ticket was opened. It contains the WooCommerce subscription ID, the WooCommerce product ID, product name, product type, subscription type, limit, value and status. 

Location: WooCommerce Order

Format: Array

Sample Data:

array (

0 => 

array (

'subscription_id' => 66,

'product_id' => 42,

'product_name' => 'Daily Blocks - 3 Tickets ( <strong>Total of 1 item</strong> )',

'type' => 'subscription',

'subscription_type' => 'limit_to_number',

'subscription_limit' => 3,

'subscription_limit_left' => 3,

'status' => 'open',

),

)

_paid_support_product_id_total

This meta key holds the total count of how many Paid Support related products have been purchased in single order. E.g. User A purchases a 1 one time support and another one for “limit by number of tickets” subscription. This metadata will have the value of 2.

Location: WooCommerce Order

Format: Integer

Example: 1, 2, 3

_paid_support_used

This meta key will be used for checking the validity of the order before ticket has been saved to database. The value will be either “yes” or “no”. If the value is “yes”, this means that the parent product/order post cannot be used again and will force the user re-purchase a new paid support product. 

Location: WooCommerce Order

Format: String

Sample data: yes, no or used_up

_paid_support_{product_id}_used

This metadata works similarly with _paid_support_used except it depends on the ‘status’ value from _paid_support_product_id.  

Location: WooCommerce Order

Format: String

Sample data: yes, no or empty

_paid_support_ticket_id

It’s an array of ticket ids in which the current order has been credited. This is important for later usage especially when deleting or ticket flagging.

Location: WooCommerce Order

Format: array

Sample Data:
array(
‘12’, ‘24’
)

_paid_support_limit_to_number_{product_id}_ticket_id

This is synonymous with the _paid_support_ticket_id as well but only stores ticket ids on this particular subscription type and product id it belongs to.

Location: WooCommerce Order

Format: Integer

Example: 1, 2, 3

 

 

_paid_support_limit_to_number_{product_id}_total

This is the total of Awesome Support one-time product purchased in a single order.  i.e.: it contains the number of single-use tickets the user has purchased on this particular order.

Location: WooCommerce Order

Format: Integer

Example: 1, 2, 3

_paid_support_limit_to_number_{product_id}_left

How many times this order can be used left? On each one-time support submission, we decrement by one on each ticket successful submission. Final value will be “used_up”. This will fix the empty() we use later on. NOTE: This metabox item is only used on Subscriptions that are based on a limited number (such as limited hours or limited tickets). 

Location: WooCommerce Order

Format: Integer/String

Example: 1, 2, 3 or used_up

User A purchased “limit to number” subscription named Daily Block: 10 tickets. The total submission allowed is 10. When User A submits a ticket, this metadata holds the difference between the total submission allowed vs total submitted tickets. In this example, this meta data value is 9. If User A submitted all 10 ticket, the value will be “used_up” instead of 0.

 

_paid_support_one-time_{product_id}_type

The one time product type. The value stored is either “one-time” or multi (which means the user purchased multiple one-time support tickets in a single order ). 

Location: WooCommerce Order

Format: String

Example: single, multi

_paid_support_one-time_{product_id}_total

The total one-time / one-off support that this order is good for. 

Location: WooCommerce Order

Format: Integer

Example: 1, 2, 3

_paid_support_one-time_{product_id}_good_for_left

The one time support left for this order. If single purchase, this will automatically turn to 0 once user submit a ticket.  This is similar to _paid_support_limit_to_number_{product_id}_left but only when user has purchased multiple one-time tickets in a single order.

This is valid for One Time support ticket and how much submission can the user use left. E.G. User purchase 3 One Time product in single order. He then submit 1 ticket and this metadata will have value of 2.

Location: WooCommerce Order

Format: Integer

Example: 1, 2, 3

_paid_support_limit_to_hour_{product_id}_total

The total hours allowed when the subscription type is a LIMIT of hours. This value is taken from the Limit Value data on product setup if the Limit Type is hourly.

Location: WooCommerce Order

Format: Integer

Example: 60, 120

_paid_support_limit_to_hour_{product_id}_time_spent_total

This metadata only applies when the subscription type is for an hourly limit. This is total hours allowed for the subscription. This value is synonymous with subscription_as_type_value from the Product settings. 

Location: WooCommerce Order

Format: Integer

Example: 60, 120

_paid_support_limit_to_hour_{product_id}_time_left

This metadata only applies when the subscription type is for an hourly limit. This is the usable time remaining for submitting new ticket. If this value exceeds the _paid_support_limit_to_hour_{product_id}_time_spent_total, it will then force the user to re-subscribe or buy another premium level. It is attached to the WooCommerce Order post type.

Location: WooCommerce Order

Format: Integer

Example: 60, 120

_paid_support_limit_to_hour_{product_id}_time_billable

This metadata only applies when the subscription type is for an hourly limit (aka limit to hour product/ticket types). This is the total time spent per order in minutes. Example: User A purchased 1 hour subscription, he then submitted a ticket. On the WPAS Time Tracking feature, the agent will record 10 minutes time spent on the ticket support. This metadata will have the value of 10.

Location: WooCommerce Order

Format: Integer

Example: 60, 120

_paid_support_limit_to_hour_{product_id}_ticket_id

This is synonymous with _paid_support_ticket_id, however, this only stores the ticket ids in this particular subscription and product id. This data will be needed when re-calculating hourly support statistics. 

Location: WooCommerce Order

Format: Integer

Example: 60, 120