Skip to main content

Coupon

For loop type woo_coupon, here are the query parameters and fields.

Query parameters

  • post_type -

  • type -

Fields

  • amount - Get coupon amount

  • code - Get coupon code

  • date_created - Get date_created

  • date_expires - Get coupon expiration date

  • date_modified - Get date_modified

  • description - Get coupon description

  • discount_type - Get discount type

  • email_restrictions - Get emails to check customer usage restrictions

  • exclude_sale_items - If this coupon should exclude items on sale

  • excluded_product_categories - Get product categories this coupon cannot not apply to. Returns a Loop

  • excluded_products - Get product IDs that this coupon should not apply to. Returns a Loop

  • free_shipping - If this coupon grants free shipping or not

  • id - ID

  • individual_use - Get the "individual use" checkbox status

  • is_valid - Check if a coupon is valid for the cart

  • limit_usage_to_x_items - Usage limited to certain amount of items

  • maximum_amount - Get maximum spend amount

  • minimum_amount - Get minimum spend amount

  • product_categories - Get product categories this coupon can apply to. Returns a Loop

  • products - Get product IDs this coupon can apply to. Returns a Loop

  • usage_count - Get coupon usage count

  • usage_limit - Get coupon usage limit

  • usage_limit_per_user - Get coupon usage limit per customer (for a single customer)

  • used_by - Get records of all users who have used the current coupon. Returns a Loop

  • virtual - If the filter is added through the woocommerce_get_shop_coupon_data filter, it's virtual and not in the DB