Coupons Feed Meta

Introduction

The Feed Object meta for the Coupons add-on is an associative array containing the properties which determine the type of coupon and discount available.

$feed['meta'] = array(
	'gravityForm'      => 0,
	'couponName'       => 'test100',
	'couponCode'       => 'TEST100',
	'couponAmountType' => 'percentage',
	'couponAmount'     => 100,
	'startDate'        => '',
	'endDate'          => '',
	'usageLimit'       => 20,
	'isStackable'      => false,
	'usageCount'       => 2,
);

Usage

We recommend accessing the $feed meta using the rgar() or rgars() functions, e.g.:

$couponCode = rgars( $feed, 'meta/couponCode' );

Properties

  • gravityForm string

    The form ID this coupon was created for. An ID of 0 indicates the coupon can be used with ALL forms.

  • couponName string

    The coupon name.

  • couponCode string

    The the value users should enter to apply this coupon to the form total.

  • couponAmountType string

    The coupon amount type. Possible values: flat or percentage.

  • couponAmount string

    The coupon amount.

  • startDate string

    The date when the coupon should start.

  • endDate string

    The date when the coupon should expire.

  • usageLimit integer

    The number of times the coupon can be used.

  • isStackable boolean

    Can this coupon be used in conjunction with another coupon? Default is false.

  • usageCount integer

    The number of times this coupon has been used since the count was last reset.