1

I've been trying to add action Page Redirect to my rule (after a coupon code is applied to an order)enter image description here, and it doesn't work in any scenario? I did a bit of digging and it seems this is common - anyone know why it's happening/what the fix is?

1 Answer 1

1

First things first: a page redirect from "current page" to "current page" is what seems to be your very last Rules Action, is that what you actually want? If that's not your issue, then read on about a possible approach to find out what else might be wrong.

Basic debugging

Rules is great, but sometimes also tough to debug if things don't work as you'd expect. There are some typical facilities to do such debugging, but my Keep-It-Super-Simple technique I often use is my BINGO-trick. A sample of such rule can be found in my answer to "Which Rules condition can be used to email a user when an admin updates their profile?". Stupid, but simple and efficient (I think).

Also, since you have 2 Rules Conditions in a single rule (both must be satisfied for your Rules Actions to execute), you should try to see what happens (if you get a "bingo") for each of the individual Rules Conditions. This by simply (temporary) removing 1 out of the 2 Rules Conditions you are using, and verify if they each result in the Rules Action you'd expect (also just a simple Bingo-message should be sufficient).

Advanced debugging

Something else that will help you find the answer to your question, is to have a look at Rules debugging ... Within the Rules settings, experiment a bit with the debugging facilities that come with the rules module. At least have a look at the "Rules Evaluation Log" (to check that the Rules logic being executed, actually matches what you expect that logic to be).

Depending on what the result of that type of debugging is, you may also want to (temporary) enable the Devel module, so that you can (temporary) add a Rules Action like "Display a value" (in your case of your node:comments).

For way more details about these 2 variations, refer to Rules debugging, as explained in the answer to "How can I display the value of a variable inside a condition?".

1
  • Re your first sentence - from current page to current page is correct; I simply want the page to refresh after a coupon is added. Will dive into the above suggestions shortly :)
    – Brittany
    Commented Apr 4, 2018 at 15:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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