Offer shipping rates from the NZ Mainfreight API.
Last Updated
2023-10-22
Version
1.3.0
Automatically calculate shipping rate estimation for New Zealand orders.
Please Note: This plugin is the product of OkRogerThat NZ Limited and is not associated with Mainfreight or WooCommerce. Mainfreight and WooCommerce cannot assist with any support or inquires regarding this product. Any plugin service requests must be directed at OkRogerThat NZ Limited.
The “Shipping with Mainfreight in WooCommerce” plugin extends WooCommerce’s default shipping options to include a new shipping option “Mainfreight Shipping”.
Mainfreight provide their customers with a NZ Shipping estimation API. This plugin lets you offer shipping fees based on the API estimations to your customers, which are pulled directly from the Mainfreight NZ Shipping API.
When a customer enters the shipping destination address, the orders shipping is calculated using the ordered products weight and shipping dimensions, and the estimate provided by the Mainfreight NZ Shipping API.
Mainfreight specifies the Mainfreight FAF (Fuel Adjustment Fee) is subject to change.
Calculate domestic shipping rates for NZ shipments.
Refer to your Mainfreight account for conditions and limitations of the Mainfreight transport API.
New Zealand based shipping source and destinations if region is set to NZ.
Australia based shipping source and destinations if region is set to AU.
Requirements:
- All products must be given valid shipping dimensions in WooCommerce. (height x length x width)
- You need to be a Mainfreight customer and request a Mainfreight Account Code and a Mainfreight API Key – available from Mainfreight – Domestic Freight Estimates API.
Recommended:
- All WooCommerce products be given a valid shipping weight value in WooCommerce.
- Testing this plugin in a testing development site prior to use on a production site.
Add a price adjustment (%).
Mainfreight specifies the Mainfreight FAF (Fuel Adjustment Fee) is subject to change. The actual FAF at shipment date may be different to the estimation. The plugin provides the option to add a percentage markup to the shipping rate.
Adjust the shipment calculation based on WooCommerce Shipping Class.
The plugin supports WooCommerce Shipping Classes and allows simple customisation based on the product shipping class.
Current options include:
- include products with this shipping class in all calculations (default).
- Include products with this shipping class if other non-combine-only classes in shipment in calculations. (This allows you to disable the Mainfreight shipping method calculation if all items in the cart are better sent using another shipping method. e.g. small add on item products).
- ignore products with this shipping class. (Calculation will proceed, but the items in this shipping class will not be included in the shipment volume/weight calculation).
- disable this shipping method if products with this shipping class are included. (This allows you to not offer Mainfreight estimation if specified product shipping classes are included in the cart).
Version History
1.3.0
Release date 22 October 2023
- Fix: PHP 8.2 compatibility
- Added: WooCommerce HPOS compatibility
- Updated: Freemius SDK to 2.5.12
- Tested up to WordPress 6.4.RC1, WooCommerce 8.2.1, PHP 8.2
1.2.2
Release date 23 July 2023
- Fix: Corrected cart weight and volume values rounding.
- Tested up to WooCommerce 7.9.0, WordPress 6.2.2, PHP 8.1
1.2.1
Release date 5 July 2023
- Updated: Freemius SDK to 2.5.10
- Tested: up to WordPress 6.2.2
1.2.0
Release date 28 March 2023
- New: Disables shipping method if a product in cart does not have valid shipping dimensions or cart is 0 volume.
- Added: Shipping Class settings option – “Allow empty/zero product dimensions” to allow items without volume to be included in shipment if product is in the shipping class.
- Fix: Remove PHP error on systems using PHP 8.1+ and products with no shipping dimensions set.
- Tested: up to WordPress 6.2.RC4 and WooCommerce 7.5.1, PHP 8.1
1.1.0
Release date 22 March 2023
- Added support for WooCommerce store measurements dimensions-units m, cm, mm, in, yd and weight-units kg, g, lbs, oz.
- Updated Freemius SDK to 2.5.5
- Tested to WordPress 6.1.1 and WooCommerce 7.5.0
1.0.9
Release date 17 September 2022
- Changed plugin folder name and text domain.
- Tested up to WordPress 6.0.2 and WooCommerce 6.9.2
- Add Freemius distribution management SDK.
1.0.8
Release date 7 August 2022
- Initial release.
Documentation
Shipping with Mainfreight in WooCommerce plugin documentation
Please Note: This plugin is the product of OkRogerThat NZ Limited and is not associated with Mainfreight or WooCommerce. Mainfreight and WooCommerce cannot assist with any support or inquires regarding this product. Any plugin service requests must be directed at OkRogerThat NZ Limited.
Shipping with Mainfreight in WooCommerce is a premium shipping method which allows you to provide shipping rates based on the estimation provided by the NZ Mainfreight Shipping API.
1. Installation
Note: This plugin requires WooCommerce to be installed to work.
- Log into your website wp-admin area and select the ‘Plugins‘ menu item.
- Click on the “Add New” button. The “Add Plugins” page displays.
- Click on the “Upload Plugin” button and click on the “Choose file” button.
- Select your downloaded plugin zip file (e.g. okrtwcmainfreightshipping-latest.zip) and click “Install now“. The plugin will be uploaded into the ‘wp-content/plugins/’ folder of your website.
- In the ‘Plugins’ > ‘Installed Plugins’, activate the plugin “Shipping with Mainfreight in WooCommerce”. On activation, the welcome and license activation page displays.
- Enter your License key. Your license key is emailed to you when you purchase the plugin license. Check your spam folder if you do not see it.
- Thats it – you can now configure the plugin. Dismiss the notification of successful activation.
2. Configuration
We recommend testing the plugin and its configuration on a development site before use in production or your live store.
2.1. Mainfreight Shipping Settings and API Account Details
You need to be a Mainfreight customer and request a Mainfreight Account Code and a Mainfreight API Key – available from Mainfreight – Domestic Freight Estimates API.
- After installing and activating the plugin go to
wp-admin > WooCommerce > Settings > Shipping > Mainfreight Shipping.
The Mainfreight Shipping settings page displays. The settings in this page are applied to all shipping zone Mainfreight Shipping shipping methods in your store. - (Optional) Adjust the Title of the shipping method displayed in the checkout.
- Enter your Mainfreight Account code, also known as the Mainfreight Account Number. e.g. MYSTORE12345
- Enter your Mainfreight API Key. This is the Mainfreight Shipping API Key assigned to you be Mainfreight. See Mainfreight – Domestic Freight Estimates API.
- (Optional) To apply a Markup Percentage on the estimate value the API returns to cover any variations in costs. e.g. a Markup Precentage value of 5 will mean if a value of $NZ50 is provided by the API, the amount displayed to customers will be $NZ52.50 (Calculation is $NZ50 + (5% x 50) = $NZ52.50)
- For normal use we suggest Debugging be turned off. If you experience problems during testing or setup you can enable logging by ticking the logging tick box.
2.2 Check store Tax settings and Shipping Tax
- To check your Tax settings on Shipment calculations go to
wp-admin > WooCommerce > Settings > Tax - In “Shipping tax class” select “Standard”
- Save Changes.
- Go to Tax > Standard Rates and specify the NZ Tax rate of 15.00% for GST.
- Tick the Shipping check box to ensure GST Tax is added to the shipping amount.
2.3 Setup or check your WooCommerce Shipping Zones and Shipping Classes
If you haven’t yet set up WooCommerce Shipping refer to WooCommerce Shipping Documentation. Our plugin documentation assumes you have configured WooCommerce Shipping, Shipping Zones, and Product Shipping Classes.
2.4 Check all Products have Shipping Dimensions, Shipping Weight, and Shipping Class
The plugin uses the checkout cart items to calculate the estimated shipping volume and weight to send to the Mainfreight API. All products that can be shipped must have valid shipping dimensions. See WooCommerce Documentation at https://woocommerce.com/document/adding-dimensions-and-weights-to-products-for-shipping/
2.5 Add Mainfreight Shipping method to each Product Shipping Zone
- Go to wp-admin > WooCommerce > Settings > Shipping. The Shipping Zones tab will display.
- Click on the Name of the Shipping Zone you would like to offer Mainfreight Shipping method to customers. The Shipping Zone details page displays.
- Click on “Add Shipping Method“. The Add Shipping dialog displays.
- Select Mainfreight Shipping from the drop down selector and click the “Add shipping method” button. “Mainfreight Shipping” will be listed in the Shipping Zone’s Shipping methods list.
- Click on the “Mainfreight Shipping” method title to configure it. The Mainfreight Shipping Settings dialog window will display.
- Make sure Enable is ticked to enable this shipping method for the Shipping Zone.
- Adjust the Shipping method title displayed at checkout if required.
- Select the Mainfreight Region. Note: currently only NZ is supported by Mainfreight and this plugin.
- Select the Mainfreight Service Level you will be using for this shipping method. The correct selection is required by the Mainfreight API.
- Select the Mainfreight Package Type you will be using for this shipping method. The correct selection is required by the Mainfreight API.
- If you would like to send a minimum weight for all shipments to the API, enter the minimum weight in Mainfreight Calculation Minimum Package Weight (kg)
- By default, all products in the cart will be included in the volume calculation sent to the Mainfreight API. If you would like to customise this the plugin provides the Shipping class customisation options.
Current options include:- “Include this class in all shipping calculations”
- This is the default behaviour. All volume of products with this shipping class will be included in all calculations if the shipping dimensions for the product are set.
- “Include this class if other non-combine-only classes in shipment”
- This behaviour will only include products in this shipping class if another product is in the cart which is in a shipping class assigned to “include this class in all shipping calculations”. This allows you to disable the Mainfreight shipping method calculation if all items in the cart are better sent using another shipping method. e.g. small add on item products that you have configured another shipping method to handle, when they cant be included in a Mainfreight shipment.
- “Ignore this class in all shipping calculations”
- Calculation will proceed for any other products in the cart, but any products in this shipping class will not be included in the shipment volume/weight calculation.
- “Disables this shipping method if in shipment”
- This allows you to not offer Mainfreight estimation (ie. disable it) in the checkout if specified product shipping classes are included in the cart.
- “Include this class in all shipping calculations”
- Click the “Save changes” button to save any changes made. If you do not want to save changes, click on the close dialog x in the top right corner.
2.6 Test your Store and the Mainfreight Shipping calculation.
Visit your store, add some products to the cart, and walk through the checkout process to check if the Shipping calculations are as expected and match actual shipping costs expected.
3.0 Frequently Asked Questions
Send us your questions through our Support. We will add FAQs here.
4.0 Troubleshooting
- Do you have a valid Mainfreight API account?
- Do all your products have shipping dimensions and weight? (Length x Width x Height)
- Have you set the correct store shipping dimension unit in WooCommerce ( wp-admin > WooCommerce > Settings > Products > Dimension Unit )
- Are you using a NZ store address and NZ destination address?
- Go to wp-admin > WooCommerce > Settings > Shipping > Mainfreight Shipping
- Check your Mainfreight Shipping settings are correct.
- Under the setting Debug Log, tick Enable Logging
- Click Save Settings
- Go to wp-admin > WooCommerce > Settings > Shipping Zones
- For each of your shipping Zones, Go into the Zone by clicking on the Zone name
- For each shipping zone click on “Mainfreight Shipping”.
- If you have customised the name select the customised name.
- Check the settings are correct and save if required.
- Go to your store front and add products and the quantity to test to your cart. Proceed to checkout.
- Enter a destination delivery address and check if the checkout displays the Mainfreight shipping option you have configured.
- Go back to wp-admin > WooCommerce > Settings > Shipping > Mainfreight Shipping and click on “View Log”. The WooCommerce Logs page displays.
- Select the log from the drop down for the current date and click the view button.
- Check the log says “okrt – calculate_shipping”. You can now view or copy and paste this log into a support email and send it to us if further help is needed.
$79.50
USD Annually.
Sold and delivered via Freemius
What’s included
- 1-year plugin updates
- 1-year plugin support
- 30-day money-back guarantee
Support
Current Version
Version:
1.3.0
Last Updated:
2023-10-22
Countries:
New Zealand