The shipping plugin allows you to display shipping options with calculated price (during checkout) and add the possibility to track the shipment
Firstly you must create a class that implements IShippingRateCalculationProvider :
you can find a description of how the methods are used.
– enum that has two values, Off and Real. Real indicate real-time calculation
- return ShippingOptions that will be available in checkout. This method is significant
because you can, for example, send request to your shipping provider and
calculate the rate base on package size, address etc.
– calculate the shipping rate. If the Shipping rate
method allows it and the rate can be calculated before checkout
- indicate when hiding shipping method. For example, if customer address is not
supported then return true.
– you can return the name of the component that will be rendered (in checkout ->
shipping), you can use it when you method required pass additional data by
customer, for select shipping point, etc.. . Return empty string if you want omit it.
ValidateShippingForm – form validation, associated with view component.
If you want to add the possibility to track shipment you must assign ShipmentTracker property by the class that implements IShipmentTracker.
IsMatch – True if the tracker can track, otherwise false.
– should return URL for a page to show tracking info (third party tracking
page). Usually, shipping providers allow you to create a URL by add to the base URL
query string with a tracking number.
GetShipmentEvents – get all shipment events by tracking number.
If you want to understand more, you should analyze our free shipping plugin : Shipping.ByWeight that calculated shipping fee based on the weight of products.