'type' => 'cartLineItemProductStates',
'rule_id' =>
$idRule,
'parent_id' =>
$idCondition,
'value' =>
sprintf('{"operator": "=", "productState": "%s"}', State::IS_DOWNLOAD
),
'position' => 0,
'custom_fields' => null,
'created_at'
=> (new \
DateTime())->
format(Defaults::STORAGE_DATE_TIME_FORMAT
),
'updated_at' => null,
] );
$this->
registerIndexer($connection, 'Swag.RulePayloadIndexer'
);
return $idRule;
} private function createFlow(Connection
$connection, string
$ruleId, ?string
$mailTemplateId): void
{ $flowId =
$connection->
fetchOne('SELECT id FROM flow WHERE name = :name',
['name' => 'Deliver ordered product downloads'
]);
if ($flowId) { return;
}