Coding Ninja Forms for different outcomes

0  comments

Tips from Tech Support

Background

Actions in Ninja Forms fire in accordance with timing and priority rules that are set within the plugin files, and while it is possible to change those rules, at this time we have not yet implemented a user-friendly way to visualize the rules. This is something that is on our development roadmap, but because it affects a large number of plugins and could be overwhelming to many customers, and most importantly because making certain timing changes could result in unintended effects, we don't want to rush it.

The default timing and priority rules attempt to anticipate the most common combinations of actions, but there are certainly use cases that demand more precise control.

In order to cause the Create Post action to fire after the payment action, you can change the timing to ensure the payment action has to fire first.

To implement this change, you can manually change one line in the Post Creation plugin code for the Create Post action to delay until after payment processing has completed (note that this will not prevent the submission data from being recorded if payment is not completed -- only the post creation).

The line to change is line 21 in the file: /ninja-forms-post-creation/includes/Actions/CreatePost.php

This change should prevent the post creation from happening until and unless payment has been completed.

Change the timing from 'normal' to 'late'.

So:

protected $_timing = 'normal';

becomes

protected $_timing = 'late';

Then update the file, and test to ensure that the behavior is functioning as intended.

If the issue persists after implementing the change, please let us know. Also, of course let us know if you have any other questions or if there is anything else we can help you with.

About the author 

Mark Rauterkus

Mark Rauterkus, is the webmaster for ISCA. Also a swim, SKWIM and water polo coach in Pittsburgh, PA, USA.
Cell: 412-298-3432

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
>