Shipping Rules Calculator

Rule Structure and Shipping Option Rules

The rule structure is a flexible framework that generates results by applying 'and', 'or', and 'not' logic operations on specially crafted sets of rules, where an unlimited number of nested sub-rules can be written. While 'or' and 'and' rules should have a 'children' field, the 'not' rule should have a 'child' field. Each special rule also has different fields that it needs to have.

{
   "children": [
    {
      ...(rule1)
    },
    {
      "children": [
        {
          "child": {
            ...(rule2)
          },
          "name": "Not Rule",
          "slug": "not-rule"
        },
        {
          "child": {
            ...(rule3)
          },
          "name": "Not Rule",
          "slug": "not-rule"
        }
      ],
      "name": "And Rule",
      "slug": "and-rule"
    }
  ],
  "name": "Or Rule",
  "slug": "or-rule"
}

The logical equivalent of the above rule structure can be expressed as:

This means the shipping option with this rule structure will be shown if either rule1 is satisfied or both rule2 and rule3 are not satisfied simultaneously.

WeightRule

A rule that checks if the individual weights of all items in the cart are less than or equal to the specified maximum value.

HeightRule

A rule that ensures the individual lengths of all items in the cart are less than or equal to the specified maximum value.

CityRule

Allows for the creation of a rule based on the city information of the shipping address. If shipping is desired to specific cities listed in the 'cities' field, the 'exclude' field can be removed from the rule. If this field is set to True, shipping will be done to cities outside the specified city list. The IDs correspond to the city IDs in the database.

CountryRule

Enables the creation of a rule based on the country information of the shipping address. If shipping is desired to specific countries listed in the 'countries' field, the 'exclude' field can be removed from the rule. If this field is set to True, shipping will be done to countries outside the specified country list. The IDs correspond to the country IDs in the database.

TownshipRule

Facilitates the creation of a rule based on the district information of the shipping address. If shipping is desired to specific districts listed in the 'townships' field, the 'exclude' field can be removed from the rule. If this field is set to True, shipping will be done to districts outside the specified district list. The IDs correspond to the district IDs in the database.

DistrictRule

Allows for the creation of a rule based on the neighborhood information of the shipping address. If shipping is desired to specific neighborhoods listed in the 'districts' field, the 'exclude' field can be removed from the rule. If this field is set to True, shipping will be done to neighborhoods outside the specified neighborhood list. The IDs correspond to the neighborhood IDs in the database.

TimeRule

Enables the determination of the time interval during which the shipping option will be available.

DayOfWeekRule

Allows for the determination of the days on which the shipping option will be visible. Days should be entered in English in the 'days' field.

BasketAmountRule

Enables the creation of a rule based on the discounted basket amount. If the discounted basket amount is greater than or equal to the specified 'max_total_amount' value, the shipping option will be displayed.

TotalProductAmountRule

Allows for the creation of a rule based on the undiscounted total basket amount. If the undiscounted total basket amount is greater than or equal to the specified 'max_total_amount' value, the shipping option will be displayed.

ProductAttributeRule

Enables the creation of a rule based on product attributes. It checks whether all or any of the products in the cart have a certain value for the selected attribute. If 'any' is selected, at least one product must have the specified value for the selected attribute. If 'all' is selected, all products must comply with this rule. According to the following rule, if the value of the 'attribute_1' attribute for all products in the cart is 'value_1', the relevant shipping option is displayed.

RetailStoreRule

This rule ensures that the shipping option only appears when the option for delivery from the retail store is selected.

Calculators for Determining Fees for Shipping Options

FixedPriceCalculator

Enables setting a fixed shipping fee for all purchases. It applies only to the shipping option for which the calculator is entered. When entered in this way, shipping promotions are not considered.

AmountBasedCalculator

Enables the determination of shipping fees based on the basket total. If the basket total is less than the specified upper limit, it provides the fixed shipping fee; otherwise, it provides the discounted price. When entered in this way, shipping promotions are not considered.

DiscountBasedCalculator

Enables the calculation of shipping fees considering shipping promotions. If the shipping discount condition is met, the shipping fee will be as determined in the campaign; otherwise, the shipping fee generated by the calculator entered with 'base_shipping' is shown.

RemoteCostCalculator

Shipping calculator for according to the shipping_price information from the url given to Omnitron. Use;

Last updated

Was this helpful?