In this article, we will explain different ways of using the Rule Builder using some example rules.
If certain products are shipped by a forwarding agent and you want to use your own shipping method, you can solve this by using the tags on the product.
First, create a tag for the desired products, e.g. with the title "shipping company". You can find more information about the tags on products here.
You can integrate these tags in the Rule Builder via the condition Position with tag.
In our example the rule is as shown below:
Position with tag | All | Is one of | Forwarding
You can now select this rule in the desired shipping method in the item availability rule.
If you want to block other existing shipping methods if there is at least one product with the tag "Forwarder" in the shopping cart, you can add the rules used for the other shipping methods.
Add an AND link and enter the following in the now additionally available condition
Position with tag | At least one | Is none of | Forwarder
If you want to use the cash on delivery service of DHL or another shipping service provider, it is not sufficient to have a cash on delivery shipping method. Since payment is also processed via this cash on delivery service and a payment method and a shipping method are always required for an order, it is necessary to create both a new payment method and a new shipping method.
First, you create a payment method and a shipping method for cash on delivery. These can be called, for example, both cash on delivery or DHL cash on delivery.
You then create a new rule for the availability rule in the Rule Builder:
You can now select this rule in the desired Cash on Demand shipping method in the availability rule item.
You then add the additional charges for Cash on Demand shipping to the price matrix of the shipping method.
If you want to allow or deny shipping for certain zip codes, you can implement this with the Rule Builder.
First, you create a shipping type for the postal code shipping. This could be called, e.g., postal code.
Then you create a new rule for the availability rule in the Rule Builder:
In our example, the rule looks like this:
Name: Postal code
Priority: 1 (if you want a prioritization when using multiple shipping methods, please adjust the value accordingly)
Type (optional): Shipping type (should you wish to use the rule in other areas as well, you can add more types or leave the selection blank).
Conditions:
Shipping address: Zip code | Alphanumeric | Is one of | Postcode (The zip code of the delivery address)
You can now select this rule in the desired shipping type Postal code in the item availability rule.
You would like to send some products by default shipping and some of them are marked in an additional field with an active special shipping checkbox because they require a different shipping method (e.g. by forwarding agent, courier, hazardous goods, etc.). If the cart only contains unchecked products, default shipping is used. As soon as a product is added to the cart with the special shipping checkbox ticked, the default shipping costs are omitted, but the shipping costs are calculated for each labelled item.
For this example, we need an additional field set with an additional checkbox field. The name special dispatch is used in the example. You can find out more about editing custom fields here.
First of all, you need a rule that ensures that default shipping is not available if the goods contain at least one product with special shipping ticked. To be able to check this, you need the technical name of the checkbox in order to make the selection. Create the rule for deactivating standard shipping in the Rule Builder:
Name: No default shipping
Priority: 1 (if you wish to prioritise when using multiple shipping methods, please adjust the value accordingly)
Type (optional): Shipping method (if you also want to use the rule in other areas, you can add further types or leave the selection empty)
Conditions:
Position with custom field | All | Special shipping (enter technical name) | is equal to | (checkbox empty)
If you have entered the correct field via the technical name, the name that you have assigned for the display in the admin is usually displayed. You set this rule as an availability rule in default shipping.
You need a second rule to activate the special shipping:
Name: special shipping
Priority: 2 (the priority must always be higher than for default shipping)
Type (optional): Shipping method (if you also want to use the rule in other areas, you can add further types or leave the selection empty)
Conditions:
Position with custom field | All | Special shipping (enter technical name) | is equal to | (checkbox ticked)
You enter this rule as an availability rule in the special shipping method.
If you now add products to the cart, the correct shipping method will be selected. But the amount of the shipping costs does not change or is incorrect, regardless of whether you have one, two or three products with the special shipping checkbox ticked in the cart. Why is that?
The price matrix must be created accordingly so that only the special shipping products are taken into account to calculate the shipping costs. A rule is required that specifies when which amount is to be charged. The following rule must be created with the adjustments in the quantity as often as you need quantities in your shipping price matrix:
Name: Special shipping quantity 1 (2,3,4,5 ...)
Priority: 1 (please check whether the prioritisation for the price matrix needs to be adjusted)
Type (optional): Shipping method (if you also want to use the rule in other areas, you can add further types or leave the selection empty)
Conditions:
Total number of all products | Is equal to (for the last quantity, use greater than or equal to) | 1 (2, 3, 4, 5, ...) Filter position with custom field | Special shipping (enter technical name) | Is equal to | (Checkbox checked)
Then open your shipping method for special shipping products to enter a Price matrix by rules. Click on Add price matrix. In Create a price matrix based on predefined cart properties and/or custom built rules. Please choose: select the rule "Special shipping quantity 1" in the Choose a custom rule combo box. Then, add the other quantities and the respective shipping costs.
After making fundamental changes to the configuration such as this, it is advisable to clear the cache before testing the functionality in the storefront.
If you want to release a certain payment method only for a certain customer group, you can create a rule with the condition Customer group.
In our example the rule is as shown below:
You can now select the rule in the desired payment method in the item availability rule.
It is also conceivable to add a further condition to the rule above, e.g. to make the payment method additionally possible only from a certain purchase value (e.g. 250€).
In this case, add another condition using the AND link and insert the following in the second condition
If you want your customers to receive a discount from a certain shopping cart value, you can use a condition of the type Cart amount or Goods price. The difference between the two conditions is that the shopping basket value is calculated including shipping costs and less any discounts and the price of the goods in the basket is the sum of the prices of all the products in the basket.
The rule could be as shown below:
or
You can now select the rule in the desired discount action in the tab Preconditions in the item Baskets.
If you want your customers to receive free shipping when the shopping cart value is above a certain amount, you can set the following discount rule.
Saleschannel: Define in which channels the discount should be set.
Shoppingcart-rules: Set a rule with the following definitions:
Total > Is greater than/ equal to > shopping cart amount e.g. 50
If you want, you can define several discounts in response to the shopping cart value.
For example: above 25 EUR/$/£ > 50% discount and above 100 EUR/$/£ > 100% discount on shipping costs.
Important: When serveral discounts are set, set the condition "Do not combine with" regarding to the discount amount and the highest discount with the highest priority.