0

I want to add an option to the node add form so that the user who creates the node can choose if the node will be " promoted " or not. If the promoted option is selected, then I want to redirect the user to a payment page, so that the option charges can be payed.

Any suggestions about how to do so?

1

Step 1a: Optional redirect to payment page

Add a Boolean field to each content type for which you want to offer such "Promoted" option, say its allowed options are Yes or No.

Then use the Rules module like so:

  • Event: After saving a node

  • Condition: (both conditions must be true)

    1. Entity has field "Promoted"

    2. Data Comparison "Promoted" = "Yes"

  • Action: Perform a page Redirect to your Payment Page

Step 1b: Limit node access while payment is not completed

To wait for the payment to be completed (and not "submit" the node yet), you could use the Content Access module, and the Content Access Rules Integrations module.

So that "After saving content" (= Event), you "Give 'authenticated user' the permission to 'view own content' for the specific node" (= Action). This additional "Action" can be added is a 2nd action to the same rumle suggested above.

This would be a variation of what is explained in this article also (within "Access Control Customized for Your Needs").

Step 2: Promote the node (after payment)

After the payment is received, you could use that "Event" to trigger another rule, which basically consists of these actions:

  • Mark the node as "Promoted".
  • Remove the node access restriction, so that all appropriate roles can view the node.

Step 3: Stop the promotion of the node

If at some point in the future the "Promoted" node no longer should be promoted, then you could use the Rules Scheduler ( a sub-module of the Rules scheduler) to trigger a rule to no longer mark the node as "Promoted.

Note: If you're not familiar (enough/yet) with Rules, the checkout the 32 (!!!) great, and free, video tutorials Learn the Rules framework.

2
  • thank you so much, but i want not to submit the node till the payment is made Aug 16 '15 at 21:25
  • I updated my answer as per your most recent comment to my answer. Does this help? Aug 17 '15 at 10:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.