Introduction
The Feed Object meta for the Mollie Add-on is an associative array containing the properties which determine how the add-on should process the form submission.
$feed['meta'] = array(
'feedName' => 'Mollie Feed 1',
'transactionType' => 'product',
'paymentAmount' => 'form_total',
'feed_condition_conditional_logic_object' => array(
'conditionalLogic' => array(
'actionType' => 'show',
'logicType' => 'all',
'rules' => array(
0 => array(
'fieldId' => '1',
'operator' => 'isnot',
'value' => '',
),
),
),
),
'feed_condition_conditional_logic' => '1',
'billingInformation_first_name' => '',
'billingInformation_last_name' => '',
'billingInformation_email' => '',
'billingInformation_address' => '',
'billingInformation_address2' => '',
'billingInformation_city' => '',
'billingInformation_state' => '',
'billingInformation_zip' => '',
'billingInformation_country' => '',
'conditionalLogic' => '',
);
Usage
We recommend accessing the $feed meta using the rgar() or rgars() functions, e.g.:
$conditional_logic_enabled = rgars( $feed, 'meta/feedCondition' );
if ( $conditional_logic_enabled ) {
// Conditional logic is enabled for this feed.
$logic_rules = rgars( $feed, 'meta/feed_condition_conditional_logic_object/conditionalLogic/rules' );
foreach ( $logic_rules as $rule ) {
// Process each conditional logic rule.
$field_id = rgar( $rule, 'fieldId' );
$operator = rgar( $rule, 'operator' );
$value = rgar( $rule, 'value' );
// Example: Use $field_id, $operator, and $value in your logic.
}
}
Properties
Property | Type | Description |
---|---|---|
feedName | string | A unique name for the feed. |
transactionType | string | Specifies the type of transaction. |
paymentAmount | string | Defines the payment amount. Accepts form_total or Field ID. |
feed_condition_conditional_logic | boolean | Enables conditional logic to determine if the feed should run. |
feed_condition_conditional_logic_object | array | Stores the conditional logic rules for the feed. |
billingInformation_first_name | string | Specifies the field ID used to map the first name. |
billingInformation_last_name | string | Specifies the field ID used to map the last name. |
billingInformation_email | string | Specifies the field ID used to map the email address. |
billingInformation_address | string | Specifies the field ID used to map the address. |
billingInformation_address2 | string | Specifies the field ID used to map the second address line. |
billingInformation_city | string | Specifies the field ID used to map the city. |
billingInformation_state | string | Specifies the field ID used to map the state. |
billingInformation_zip | string | Specifies the field ID used to map the zip code. |
billingInformation_country | string | Specifies the field ID used to map the country. |
conditionalLogic | string | Specifies the condition to determine if the feed should run. |