Understanding and configuring conditional actions
Conditional actions is an Ubercart core module, and is required to create shipping quotes and tax rules. It's also used to update order status automatically, when a payment is received, and to send automated notifications. When you ship products to different regions of the world, or you have different shipping charges, depending on the total weight, you need to implement some business logic in your store. Then, the store can automatically decide what happens when you ship X products to Y region with Z weight.
A conditional action has three elements: a trigger, the conditions, and the actions. This combination is called a predicate.
A trigger is actually an event and it's usually enabled when the customer completes an operation in the store. During the second step, the system checks the conditions and, depending on them, decides what action it has to perform. In the final step, the system completes one or more action, and gives feedback to the customer or the administrator about the results.
For example, let's consider that we create the following conditional action: for orders over $100, shipping is free, but for orders under $100, shipping rate is $10. The trigger is enabled when the customer decides to complete the order and goes to the checkout page. Then, the store checks the conditions: is the order over or under $100? Depending on the conditions, our system automatically makes the right decision, and makes the right action. It calculates the shipping rate and informs the customer about the order total.
The main advantage of conditional actions is that you can build all the logic without writing even a single line of code. You just have to spend some time getting used to the user interface. If you go to Administer | Store administration | Conditional actions, you can see an overview of all the default predicates, which are created during Ubercart installations.
Home ยป Administer > Store administration
Conditional actions
J By class
Add a predicate Convert configurations
Trigger: A payment gets entered for an order
Class Status Weight Operations
Trigger: A payment gets entered for an order
Class Status Weight Operations
|
Update order status on fuit payment |
payment |
Enabled |
0 |
edit |
|
Trigger: Customer completes checkout | ||||
|
Title |
Class |
Status |
Weight |
Operations |
|
Decrement stock upon order submission |
uc^stock |
Enabled |
0 |
edit |
|
E-mait admin checkout notification |
notification |
Enabled |
0 |
edit |
|
E-mait customer checkout notification |
notification |
Enabled |
0 |
edit |
|
Update order status upon checkout completion with fui! payment |
payment |
Enabled |
1 |
edit |
|
Trigger: E-mait for granted files | ||||
|
Title |
Class |
Status |
Weight |
Operations |
|
Notify customer when a file is granted |
notification |
Enabled |
0 |
edit |
Trigger: E-mail for granted roles
Trigger: E-mail for granted roles
You can edit them to change the basic information, the trigger, the conditions, and the actions, or you can create a new predicate.
Average user rating: 5 stars out of 1 votes
Post a comment