Every online business must establish its unique set of operational guidelines to regulate the content and features of its e-commerce website. To facilitate this, we've created a robust framework for conditions (rules), seamlessly integrated into the majority of our plugins. With this framework, you can stipulate your specific conditions based on factors such as customers, categories, manufacturers, products, product specifications and dates. These conditions come into play when a customer explores a page on your online store. For instance, when a customer navigates to a product page, all relevant product conditions are assessed based on the current product. Following the evaluation, the conditions can yield two outcomes: True or False. If the condition evaluates to True, the associated entity will be visible on the current page; otherwise, it will remain invisible.
How to use Conditions
- Every plugin that supports Conditions has a Conditions tab in it's administration panel.
- In the Conditions tab you can define the conditions belonging to the specific entity.
On the picture below you can see the condition
- Active: Check, if you want to enable or disable the condition without deleting any of it's condition groups.
- Name: Here is the name of the condition. It is already defined and consists of two parts: 'Condition' and the name of the plugin using that condition.
-
Default: This is the default state of the condition. It could be Pass or Fail
- Pass: Means that if condition groups pass the rules, entity will be visible in the public store.
- Fail: Nothing will be visible no matter what.
Condition Groups
Each condition consists of condition groups. Every group is evaluated seperately and the result of all defined condition groups is combined with an OR operator.
Note!
If at least one condition group is evaluated to 'True' then the whole condition will be 'True' no matter how many groups and the result of them will be.
To add a condition group click on Add Condition Group button.
Condition Statements
Each condition group operates with condition statements. All statements are evaluated seperately and the result of them is combined with an AND operator.
Note!
If at least one condition statement is evaluated to 'False' then the whole condition group will be evaluated to 'False'.
To define a condition statement you need to click on Add Record and select the followings:
- Condition Type
- Condition Property
- Operator Type
- Value
Condition Statement Types
- Category - Evaluetes in the context of the current category.
- Customer - Evaluetes in the context of the current customer that is visiting the page.
- Date - Complies with the current date.
- Manufacturer - Evaluates in the context of the current manufacturer when visiting the manufacturer's page.
- Product - Evaluates in the context of the current product when visiting the product's page.
- Product Specification - Evaluates in the context of the current product when visiting the product's page.
- Topic - Evaluates in the context of the current topic when visiting the topic's page.
- Vendor - Evaluates in the context of the current vendor when visiting the vendor's page.
Add a condition statement
Now, let's create our own condition statement. Let's say we want a condition statement that runs only on odd days.
-
Condition Property: This is a dropdown menu, where you can choose the type of the condition statement. For instance, Date condition type has multiple choices:
- Odd Days
- Even Days
- Exact Day (Where you specify the exact activation day)
- From Monday to Friday
- And many more
-
Operator Type: Also dropdown menu with 2 possible choices.
- Equal To - Takes only the value that is specified in the Condition Property.
- Not Equal To - Takes any other option but not that is specified.
- From Time/To Time: Are specific only for the Date condition property, where you choose your time limitations. In our example, the statement will be visible throughout the whole day.
-
Value: Is either a dropdown or numeric textbox - depending on the choice of Condition Property. Here is an example of different condition statement.
Note!
The condition statement is valid only when there is a properly mapped widget zone, based on your condition type.
In the picture below you can see the final result with the condition group and it's condition statements that will be visible in the table.