Shipping Suite

Introduction

It's widely reported that high shipping costs are the #1 reason why people abandon shopping carts. Hence, optimizing this aspect is vitally important for every eCommerce store.

Out of the box, Magento only allows you to restrict shipping methods for specific countries. Changing the default shipping rates and costs, offering free shipping or using promotional rates are not available in the default version of the platform.

Magento 2 Shipping Suite extension not only has the above-mentioned functionality, but also significantly expands it.

To better understand the key features of the extension, it is important to define several shipping-related terms.

Shipping Carrier

Generally, a shipping carrier is a company that delivers customers' orders by air, land, sea, etc. For example, popular shipping carriers are DHL, UPS, FedEx and others. Some of them available in Magento 2 out of the box (one can find them in STORES ⟶ Configuration ⟶ SALES ⟶ Shipping Methods)

Mageworx Shipping Carrier

Others can be setup with the help of third-party extensions.

Note that all carriers are connected with shipping methods. As you may see, the configuration page has the name (Shipping Methods not the Shipping Carriers). This is because the list of the carriers includes the setup of all shipping methods. Also, in order to create a new method, one has to specify a carrier that will be associated with it.

Shipping Method

A shipping method is a way to fulfill the delivery to customers via a shipping carrier.

Shipping methods can vary according to different criteria, such as a warehouse location, country, shipment sizes, weights, the desired delivery time. Some examples of the Shipping Methods are USPS Express Mail, DHL Flat Rate Box Shipping, UPS two-day, DHL Jetline etc.

One can find all the list of the shipping methods available in the Magento 2 installation by checking the shipping methods condition section in e.g. MARKETING⟶Promotions⟶Cart Price Rules.

Mageworx Shipping Metod

Here, you can see the list of the methods arranged in the groups of the corresponding carriers.

Shipping Rates

Shipping rate is a price at which a certain order is delivered from point A (merchant's warehouse or store) to point B (the customer).

With the extension, shipping rates can be defined for each new/existing shipping method.

Rates are set by the shipping carrier. Their amount depends on various factors, such as the mode of transport (truck, train, ship, aircraft), the weight of the ordered goods, product dimension and the distance to the delivery destination.

The default Magento allows importing a CSV list of the table rates for only one method of one carrier.

Mageworx Shipping Rate

So to sum up, the full structure of our extension supposes such use mechanism :

  1. Manage Shipping Carrier

  2. Add Shipping Methods for this carrier

  3. Create or adjust the method’s Shipping Rates

Location Groups

This notion refers to the geographical area that you want to ship to. It may be useful when separate areas of the countries/group of countries share some mutual shipping costs (like EU region)

Requirements and Installation

Shipping Suite supports both Community and Enterprise edition of Magento starting from version 2.1. The current version of the Magento installed on your website can be found in the lower right corner of any backend page.

Magento 2 Version

Shipping Suite has 2 separate ways of installation: via Composer or by copying the code.

Installation Via Composer

  1. Create a folder anywhere on your server (preferably not in the Magento installation directory). Put the zip archive into this folder.

  2. Use any SSH client to connect to your server. Navigate to the root Magento folder. Bear in mind that the user should write permissions to this folder and its subfolders.

  3. Add the folder with the extension's archive as a repository. For this, run the Composer command:

    composer config repositories.mageworx artifact {/ABSOLUTE/PATH/TO/FOLDER}
    

    like:

    composer config repositories.mageworx artifact /mageworx/extensions/zip
    

    This command will add these lines to your composer.json file:

    "mageworx": {
        "type": "artifact",
        "url": "/mageworx/extensions/zip"
    }
    
  4. Perform the command:

    composer require mageworx/module-shippingrulesmeta
    
  5. Clear the compiled code and the cache:

    php bin/magento setup:upgrade
    
  6. To update the extension via composer, perform the command:

    composer update mageworx/module-shippingrulesmeta
    

Installation by copying the code

  1. Download the extension's package from your customer account, unzip it.

  2. Use any SSH client to connect to your server. Bear in mind that the user should write permissions to this folder and its subfolders.

  3. Upload all the files and folders from the extension's package to the root Magento folder.

  4. Via SSH, navigate to the root Magento folder and perform the command:

    php bin/magento module:enable MageWorx_ShippingRules MageWorx_GeoIP
    
  5. Clear the compiled code and cache:

    php bin/magento setup:upgrade
    php bin/magento cache:flush
    php bin/magento setup:static-content:deploy
    

Extension Configuration

To start the setup, we'll go through the full aforementioned algorithm: Carriers-Methods-Rates. After this initial setup is ready, we'll check the Shipping Zones configuration and how Shipping Rules and Restrictions are working.

Shipping Carriers

Log into the Magento Admin panel and go to STORES ⟶ MageWorx Shipping Suite ⟶ Shipping Carriers.

Mageworx Shipping Carrier

Please note that during the initial setup this grid will be empty.

The columns can be sorted alphabetically by clicking the column title.

To create a new carrier click the Add New Carrier button.

The initial setup of the carrier consists of the 2 tabs.

1. Carrier settings

Mageworx Shipping Carrier Settings

Default Title. A name of the Shipping Carrier. The customer will see it during checkout.

Is Active. The toggle that lets you enable/disable the carrier to be visible on the website.

System Name. That is the name of the carrier made for your reference. This information won't be visible on the frontend.

Carrier Code. The system code for the carrier name. This information won't be visible on the frontend.

2. Labels

Mageworx Shipping Carrier Labels

Labels Section is designed for different frontend names of the carrier on different store views. Some carriers may need to be translated and, for this matter, this section allows specifying the appropriate name. Please note that if the string is empty, the initial Title specified in the Carier's configuration will be used

Once you hit the Save button, the Method Settings appear. Here, you can tweak the Shipping Methods for this Carrier.

Mageworx Shipping Carrier Settings

Clicking the Add Method opens Shipping Method configuration settings. Actually, these are the same settings as the main Shipping Methods configuration with the only difference: if you specify the Shipping Method from the scratch, you need to select the carrier of this message while if you open it via the carrier this information is redundant and, therefore, hidden.

Mageworx Shipping Carrier or Method

Shipping Methods

To configure Shipping Method, go to STORES ⟶ MageWorx Shipping Suite ⟶ Shipping Methods.

Mageworx Shipping Method

Please note that during the initial setup this grid will be empty.

The columns can be sorted alphabetically by clicking the column title.

To create a new carrier, click the Add New Method button.

The initial setup of the method consists of the 2 tabs.

1. Method Information

Mageworx Shipping Method Configuration

Carrier. In the dropdown, you can select the desired carrier created in the STORES ⟶ MageWorx Shipping Suite ⟶ Shipping Carriers

Title. The name of the shipping method title. The customer will see it during the checkout.

Code. The system code for the method name. This won't be visible on the frontend.

Active. The toggle that enables/disables the carrier on the website.

Hide a method if there are no valid rates. In case the shipping method doesn't contain any rates and this setting is enabled, the method will be hidden.

Allow to replace a method title if rate was applied. If the rate has it own title, enabling this setting will replace the original method title with the rate's one.

Mageworx Shipping Method Configuration

Price. The initial price of the shipping method for the customer. If no rates are applied, this will be regarded as the method's price.

Min-Max Price Threshold. If multiple rates can be applied for some cart, the price can be changed significantly, so it is highly recommended to define the lowest and the highest possible price.

Cost. The initial price of the shipping method for the merchant. If no rates are applied, this will be regarded as the method's cost.

Multiple rates price calculation. This setting manages the method price calculation if multiple rates can be applied for some cart. Can be the rate with the min or max price, the rates can sum up or the rate with the highest priority only to be selected.

Free Shipping Allowed. The store owner may the Cart Price Rules specified in MARKETING⟶Promotions⟶Cart Price Rules

Mageworx Shipping Method Free Shipping nfiguration

Alternatively, this can be some setting in the third-party extension. Our methods will rewrite this original rule but if the store owners wish it to be accomplished, they may enable the Free Shipping Allowed toggle.



Mageworx Shipping Method Configuration

The method configuration provides the possibility to specify the delivery time. It can be taken globally for the method or specified directly for any rate.

Display the Estimated Delivery Time on front-end enables or disables this feature.

If Allow to replace Estimated Delivery Time setting is enabled, then the rates ETA will replace the original one.

Estimated delivery time min and max specify the delivery time range. These values can used in the description using the {{min_days}} {{min_hours}} / {{max_days}} {{max_hours}} variables as the template in the Delivery Time Message field.

Estimated Delivery Time Display Type can be either days or hours.

2. Labels

Mageworx Shipping Method Labels

Labels Section is designed for different frontend names of the method on different store views. Some methods may need to be translated and for this matter this section allows specifying the appropriate name. Please note that if the string is empty, the initial Title specified in the methods configuration will be used.

You can also specify the delivery text for separate store views as well

Mageworx Shipping Method Labels

Once you hit the Save button, the Rates Settings appears. It has the grid with the Shipping Rates for this Method.

Press the Add New Rate button to specify shipping rates for this method.

Shipping Rates

Shipping Rates configuration consists of 3 tabs.

1. Rate Information

Mageworx Shipping Rates Configuration

Title. If populated, this would replace the initial name of the corresponding shipping method.

Active. The toggle that allows enabling/disabling the rate itself.

Priority. The bigger the number the higher the priority. Includes both positive and negative numbers.

Price Calculation Method. Allows either to overwrite the initial price of the method or to sum this value to the initial one.

2. Conditions

Mageworx Shipping Rates Conditions

The first four (Country, Region, Zip From, Zip To) represent the geographic location of the customer entered on the checkout.

Total Price From and Total Price To stand for the price of all the customer's products.

Total Qty From and Total Qty To stand for the quantity of all the customer's products.

Total Weight From and Total Weight To stand for the total weight of the customer's products.

3. Rate Pricing

Mageworx Shipping Rates Pricing

Rate Pricing provides the price calculation for the rate. Depending on the configuration of the first tab, this setting either rewrites the initial value or adds up to it.

Total Price. Specifies the price of the method.

Price Per Each Product. If the cart consists of 5 units of product A and 3 units of product B, this value will be multiplied by 2 (per each product).

Price Per Each Item. If the cart consists of 5 units of product A and 3 units of product B, this value will be multiplied by 8 (per each item).

The difference between Per Product and Per Items

The "per Item" action uses each row in the cart as multiplier (5 same products in one row and 3 same items in another one is 2 items), the "per Product" action uses an each valid product as multiplier (5 same products in one row and 3 same items in another row = 8 qty).

Price Per Each Product (% of the method price). This depends on the initial price of the method. Assuming the initial price is $ 10. We still have 5 units of product A and 3 units of product B. The value in this field is 10%. Then we multiply 10% * 2 products. This is 20%. 20% from the initial price ($ 10) is $2.

Price Per Each Item (% of the method price). This depends on the initial price of the method. Assuming the initial price is $ 10. We still have 5 units of product A and 3 units of product B. The value in this field is 10%. Then we multiply 10% * 8 items. This is 80%. 80% from the initial price ($ 10) is $8.

Price Per Each Item (% of the item price). This depends on the price of the cart. Assuming we have 5 units of product A ($ 20 each) and 3 units of product B ($ 30 each). The value in this field is 10%. The full price in the cart is 5*20+3*30=190. 10% of the cart is $19.

Price Per 1 Unit of Weight. Depends on the weight units of the product. The unit of measurement defined for your locale in the configuration (can be pounds, grams etc).

Shipping Rules and Restrictions

Extension provides a range of highly-customizable shipping options and restrictions that can be personalized in various ways. To configure Shipping Rules, go to STORES ⟶ MageWorx Shipping SuiteShipping Rules and Restrictions.

Mageworx Shipping Rules

Please note that during the initial setup this grid will be empty.

The columns can be sorted alphabetically by clicking the column title.

To create a new rule, click the Add New Rule button.

Rule configuration consists of 4 tabs.

1. Rule Information

Mageworx Shipping Rules

Rule Name and Description allow the store owner to locate a rule whenever it is needed. This information is shown in Shipping Rules and Restrictions grid.

Status can be changed to Inactive if the rule is currently not needed.

Priority The bigger the number, the higher the priority. Сan include both positive and negative numbers. The rule with the highest priority will be the first one to be executed.

Mageworx Shipping Rules

The store owner can assign the rule to some particular store view and the clients' customer group.

Mageworx Shipping Rules

Further, it is possible to manage time interval specification/settings. From here, you can set the days of the week, as well as the time rage when your shipping rule gets applied to orders. Enabling the Use Time checkbox shows the extra settings to specify the hours range when the rule is active or not.

2. Conditions

Mageworx Shipping Rules Conditions

The statement has two bold links (ALL and TRUE - see above), which, when clicked on, suggest the list of options for the chosen statement part.

Tap the ALL link, to choose between ALL or ANY.

Tap the TRUE link and choose either TRUE or FALSE.

If you save the condition without making additional selections, the rule applies to all products.

Tap the Add button at the beginning of the next line and select the desired part

Mageworx Shipping Rules Conditions

The selected condition appears in the statement, followed by two more bold links.

Mageworx Shipping Rules Conditions

Click is to select the desired condition and the ellipsis (three dots) to specify the end of the condition.

To add another line to the statement, tap the Add button one more time and repeat the process until the condition is complete.

If at any time you want to delete a part of the statement, tap the Delete button at the end of the line.

3. Actions

Mageworx Shipping Rules Actions

Actions provide the exact consequence that the store owner wishes to achieve if the condition has been triggered.

Stop Further Processing. This feature allows the store owner to block all the other rules when this one is triggered. If disabled, then the matching rules with a lower priority will be fulfilled one after another till the one with the lowest priority or with the enabled option for this setting.

The Type field consists of 2 checkboxes:

The store owner can select either or both of them.

Hide Shipping Methods

Mageworx Shipping Rules Hide Method

This table shows all the methods (including the default Magento ones like UPS, DHL etc) that can be disabled at the checkout. To select several methods, hold the Ctrl key and click the items one by one. To select a group, hold the Shift key and select the first and the last option.

Modify Shipping Cost

Mageworx Shipping Rules Modify Method

The Method implements the variety of changes to the methods selected in the Apply to Shipping Methods box.

The full list of the Modifications:

Shipping Cost Shipping Surcharge Shipping Discount
Shipping Cost per Qty of Item Shipping Surcharge per Qty of Item Shipping Discount per Qty of Item
Shipping Cost Per Item Shipping Surcharge per Item Shipping Discount per Item
Shipping Cost Per 1 Unit of Weight Shipping Surcharge per 1 Unit of Weight Shipping Discount per 1 Unit of Weight

We've divided all the modifications into 3 groups: Shipping Cost, Shipping Surcharge and Shipping Discount.

Shipping Cost totally replaces the initial price of this method. Shipping Surcharge adds the specified price to the initial price of the method. Shipping Discount deducts the specified price from the initial one.

  1. In all 3 groups first option represents the exact number that will replace/sum up with/deducted from the initial shipping method price.

  2. ...per Qty of Item. If the cart consists of 5 units of product A and 3 units of product B, the specified value will be multiplied by 8.

  3. ...per Item. If the cart consists of 5 units of product A and 3 units of product B, the specified value will be multiplied by 2.

  4. ...per 1 unit of weight. Depends on the weight units of the product. The unit of measurement defined for your locale in the configuration (can be pounds, grams etc).

All they have the possibility to modify the shipping either by fixed amount or by percent.

Mageworx Shipping Rules Modify Method

To select several methods, hold the Ctrl key and click the items one by one.

To select a group, hold the Shift key and select the first and the last option.

The Sort Order setting allows you to sort the modifications according to the specified pattern.

Mageworx Shipping Rules Modify Method

If several rules have the same sort order (eg, 0), the rule that comes first on the multi select list will be applied first.

4. Apply to Items.

It lets you apply the rule to certain products in the cart using their various attributes. By default, the extension uses the rules for the whole cart. If you need to apply some rules to some particular products in the cart, you need to specify them in the apply to button tab.

Note that these rules are made only to filter the applying products. Therefore, you cannot disable some method, it just modifies the price/weight/quantity to be counted.

Mageworx Shipping Rules Modify Method

In this example, only the products with XS size will be counted.

Locations Groups

Location Groups refer to the geographical area that you want to ship to.

That may be important, for instance, to differentiate between the continental and non-continental part of the USA or in case you need to provide free shipping within the EU, you can create a custom shipping zone for that.

These zones can be later selected in the Condition Section of the Shipping Rules and Restrictions.

Mageworx Shipping Locations Groups

To configure the Location Group go to STORES ⟶ MageWorx Shipping SuiteShipping Zones.

Mageworx Shipping Locations Groups

Please note that during the initial setup this grid will be empty.

The columns can be sorted alphabetically by clicking the column title.

To create a new location group, click the Add New Location Group button.

Location Group configuration consists of 2 tabs.

1. Location Group Information

Mageworx Shipping Locations Groups

Location Group Name and Description allows the store owner to surface, sort out a certain group when it is needed.

Status can be changed to Inactive if the group is currently not needed.

Priority The bigger the number the higher the priority. Includes both positive and negative numbers.

The store owner can assign the group to some particular store view.

2. Conditions

Mageworx Shipping Locations Groups Conditions

The conditions section shares the same logic and pattern as the one described in the Condition Section of the Shipping Rules and Restrictions.

Pop-up Zones

Frontend Experience

In the frontend, the extension adds the location block on the upper side of the website.

Mageworx Shipping Popup Zones

Clicking it opens the popup to specify the customer location.

Mageworx Shipping Popup Zones

First of all, the customer can select the desired zone. It contains the list of the countries that are configured as part of this zone

Mageworx Shipping Popup Zones

And the state/province as well

Mageworx Shipping Popup Zones

No more than 3 shipping zones are shown on the popup (less amount for mobile views). To select another zones the customer can use the buttons on the left/right corners or slide in case the device has the touchscreen.

Mageworx Shipping Popup Zones

To select the desired country and state, the user should click the Save Changes button. The X button is used to close the popup without saving.

Selecting the regions will allow to estimate the possible shipping costs in the product cart

Mageworx Shipping Popup Zones Cart

Backend Experience

To configure Pop-up Zones, go to STORES ⟶ MageWorx Shipping Suite ⟶ Pop-up Zones.

Mageworx Shipping Popup Zones Backend

Please note that during the initial setup this grid will be empty.

The columns can be sorted alphabetically by clicking the column title.

To create a new zone, click the Add New Zone button.

Zones configuration area consists of 2 tabs.

Pop-up Zone Information

Mageworx Shipping Popup Zones Backend

Name. You can specify the name of the zone. It will be visible on frontend and on the backend in the grid in STORES ⟶ MageWorx Shipping Suite ⟶ Pop-up Zones..

Description. This information will be visible on the backend only.

Image. Uploading the image here will show it in the frontend. Not a required field

Mageworx Shipping Popup Zones Backend

Active toggle enables/disables this zone. If disabled, it won't be visible on the frontend.

Priority. The bigger the number the higher the priority. Includes both positive and negative.

Country. Select as many countries here as needed.

Store View. The zones can be enabled for a selected store view(-s) only.

Country Regions

Magento has the ability to select the states/provinces for the country.This comes important at the checkout step.

Unfortunately, in the default functionality, this feature is not available for all the countries (including such popular shipping destinations as the Netherlands or Italy).

Mageworx Shipping Country Regions

The necessity to add the regions manually can cause many problems for the website visitors. The Country Regions option allows adding new regions and editing those provided out of the box.

Backend Configuration

To configure Country Regions, go to STORES ⟶ MageWorx Shipping Suite ⟶ Country Regions.

Mageworx Shipping Country Regions

The regions that are provided out of the box can be edited. For this click the Edit link.

To create a new region, click the Add New Region button.

Mageworx Shipping Country Regions

Country specifies the country for the region.

Code provides the technical code for the region.

Is active toggle enables or disables this region, the Is Custom toggle is made to quickly filter the custom regions on the Regions grid on STORES ⟶ MageWorx Shipping Suite ⟶ Country Regions.

The Name field provides the name of the region. In most cases, the Default Name should be the same.

Extension's Configuration

Extension's configuration can be found in STORES ⟶ Configuration ⟶ MAGEWORX ⟶ Shipping Suite. The configuration itself consists of 3 tabs.

Shipping Suite Configuration

Mageworx Shipping Configuration

Multiple rates price calculation provides the same feature as the methods configuration setting but globally. This setting lets you manage the method price calculation if multiple rates can be applied for some cart. It can be the rate with the min or max price, the rates can sum up or the rate with the highest priority only to be selected.

Mageworx Shipping Popup Configuration

Display Shipping Zones Popup If disabled, the popup will not be shown on the frontend.

Mageworx Shipping Popup Configuration

Display Only Country & Region Fields If disabled, the region image won't be shown.

Countries by Region Configuration

Mageworx Shipping Countries by Region

The Rates Configuration section includes the possibility to select the Country. For the store owner it may be useful to select the whole cluster of countries which is especially useful for the overseas shipping. The Magento uses the standard continents names like Africa or Europe. Unfortunately, out of the box these regions are not populated with the corresponding countries. These regions are supported for the Rates configuration as they can be found in the Country tab there.

Mageworx Shipping Countries by Region

In the Countries by Region Configuration tab the store owner can change the default countries for this feature.

Mageworx Shipping Countries by Region

More to come!

Though currently this is provided only for the Rates configuration, we have plans to extend functionality to other settings as well.

Default Shipping Method

The extension provides the ability to introduce dozens of Shipping Carriers and hundreds of Shipping Methods. However, it may be useful to do some tests before adding all this stuff.

For this the extension provides the default Shipping Method that can be edited in STORES ⟶ Configuration ⟶ SALES ⟶ Shipping Method. It has the default price that can be modified by means of Shipping Rules and Restrictions.

Mageworx Shipping Method Default

It shares the same settings as the Shipping Method setup.

GeoIP Extension

GeoIP Extension is used for the Pop-up zones. After the installation of the extension it should be set up.

Mageworx Shipping Method Default

Database Type includes the IPs for the countries or for the cities. If needed, you can Create backup before upgrading of the IP database. To gather the IP info click Update Database button.

For developers

Logger usage

Notes

  1. The best way to solve this is to use the logger both on the cart and the checkout page, where the devivery costs are changed quite often. On the regular pages, such as a product grid or a product page, the possible changes may not be visible.

  2. The logger is initialized through requireJS. For this reason, it may not be available in the first seconds when page is being loaded. The logger is loaded from:

/pub/static/frontend/{theme_vendor}/{theme}/{locale}/MageWorx_ShippingRules/js/shippingRulesLogger.js
  1. To access the logger, one should perform this command from the browser console
require('uiRegistry').get('shippingRulesLogger')

Entities

  1. Story - array, iterations of calculations occur on the server side as soon as available, stores the Info

  2. Info - an object, an iteration of calculations on the server side, contains the shipping Method

  3. Method - an object, its key is the method code carrier_method, contains the list of all the rules that can be applied to this method (valid in terms of the store and the customer group). If the required rule is not found in the list, one should first check whether the rule in question is enabled for this store and the customer matches the appropriate customer group.

  4. Rule - an object, its key is the rule_id. Contains the rule info. Possible properties and the values:

    • index (int) - the rule application precedence. The first applied rule has 0.

    • rule_id (string|int) - the id of the corresponding rule, same as the key.

    • sort_order (string|int) - the rule priority order, provided in the rule configuration.

    • valid (boolean) - checks whether rule validation has successfully passed. If the value is false, the rule was not applied.

    • processed (boolean) - checks whether the rule could edit some shiiping method (disable, modify its cost, etc)

    • disabled (boolean) - checks whether the rule has disabled the method

    • cost_overwrote (boolean) - checks whether the rule has modified the method's cost

    • invalid_shipping_method (boolean) - specifies whether the current method is adjusted or not

    • input_data (object) - the method data on the input (before applying the rule, should be the same as the output_data of the previous rule)

      • availability (boolean) - checks whether the method is enabled (false for disabled)

      • price (decimal) - method cost

    • output_data (object) - the method data on the output (after applying the rule, should be the same as the input_data of the next rule)

      • availability (boolean) - checks whether the method is enabled (false for disabled)

      • price (decimal) - method cost

      • detailed_actions (object) - the list of the actions applied to this rule with the details.

Methods

  1. Get all the history:
    require('uiRegistry').get('shippingRulesLogger').getStory() 
    
  2. Get the latest iteration of calculations:
    require('uiRegistry').get('shippingRulesLogger').getInfo()
    
  3. Get the exact iteration of calculations (this example shows the first and the third iterations):
    require('uiRegistry').get('shippingRulesLogger').getInfo(0)
    require('uiRegistry').get('shippingRulesLogger').getInfo(2)
    
  4. Forced history refresh (request to the server):
    require('uiRegistry').get('shippingRulesLogger').refreshStory()
    
  5. Check what was the first rule to disable the method (this example shows the methods flatrate and length19testcarrier_firstclassdelivery):
    require('uiRegistry').get('shippingRulesLogger').whenIsDisabled('flatrate_flatrate')
    require('uiRegistry').get('shippingRulesLogger').whenIsDisabled('length19testcarrier_firstclassdelivery')
    
    where flatrate and length19testcarrier are the carriers codes while flatrate и firstclassdelivery are the methods codes, so the structure is ('carriercode_methodcode').
  6. Check what was the first rule to disable the method for some Info (info_id is the number):
    require('uiRegistry').get('shippingRulesLogger').whenIsDisabled('flatrate_flatrate', 1)
    require('uiRegistry').get('shippingRulesLogger').whenIsDisabled('length19testcarrier_firstclassdelivery', 5)
    
    where 1 and 5 are the info_ids. It can be specified by using the command getStory()
  7. Get the information for some method (by default it uses the last Info, if it is not specially provided in the end):
    require('uiRegistry').get('shippingRulesLogger').getMethodInfoByCode('length19testcarrier_firstclassdelivery')
    require('uiRegistry').get('shippingRulesLogger').getMethodInfoByCode('flatrate_flatrate', 1)
    
    second request checks the info_id 1.
  8. Forced history refresh (request to the server):

    require('uiRegistry').get('shippingRulesLogger').refreshStory()
    

  9. Get the amount difference for some method that is modifyed by some rules:

    require('uiRegistry').get('shippingRulesLogger').showDiff('flatrate_flatrate', 21, 24)
    
    where 21 and 24 are the rule_id s.

  10. It is also possible to use the Info parameter (by default it uses the last Info, if it is not specially provided in the end):

    require('uiRegistry').get('shippingRulesLogger').showDiff('flatrate_flatrate', 21, 24, 4)
    
    where 21 and 24 are the rule_id s, 4 is the info_id

Got Questions?

MageWorx offers FREE lifetime support and updates for any extension developed for Magento. Need help with the extensions? Feel free submit a ticket from http://www.mageworx.com/support/ 



MageWorx offers outstanding services developing custom tailored solutions for Magento platform to attain your eCommerce objectives. Our professional impassioned team provides profound and custom oriented development of your project in a short timeframe.