رجوع

VibeFox Australia Post for Adobe Commerce — المساعدة

Requirements

Magento: Magento Open Source or Adobe Commerce 2.4.6 to 2.4.9, on your own server or hosting, on premises or on Adobe Commerce on cloud infrastructure. The module does not work with Adobe Commerce as a Cloud Service (the SaaS edition), which does not accept PHP modules.

PHP: 8.1 to 8.4, with the cURL and JSON extensions.

Australia Post PAC API key (for live rates only): live rates use the Australia Post Postage Assessment Calculator (PAC) API. The key is free: register for a PAC API key on the Australia Post Developer Centre (developers.auspost.com.au/apis/pacpcs-registration, as the settings page says). You also need the 4-digit Australian postcode you ship from. If you only use fixed prices per country, you do not need an API key.

VibeFox license key: bought on vibefox.net. One key works on one domain.

Installation

The module is one ZIP file. It is a Composer package and can also be copied into app/code. Run the commands in the Magento root folder as the user that owns the Magento files.

1. With Composer: put the ZIP file into a folder that your project uses as a Composer "artifact" repository and run composer require vibefox/module-australia-post-shipping. Without Composer: unpack the ZIP file into app/code/Vibefox/AustraliaPostShipping/, so that registration.php is directly in that folder.

2. Run bin/magento module:enable Vibefox_AustraliaPostShipping and bin/magento setup:upgrade. In production mode also run bin/magento setup:di:compile and bin/magento setup:static-content:deploy, then bin/magento cache:flush.

3. In the Admin go to Stores > Configuration > Sales > Delivery Methods and open VibeFox Australia Post. Paste your VibeFox license key into License key in the license block, the first row of the group, and click Activate (see License key).

4. Choose the Rate source. For fixed prices, add the prices per country in Country prices. For live rates, enter the PAC API key, your ship-from postcode and, if the base currency of your store is not AUD, the AUD conversion rate (see Configuration). Set Enable Australia Post to Yes and click Save Config.

The module adds the Australia Post shipping method to Magento. Customers see it as Australia Post - Parcel delivery (method title and method name). It is off after installation (Enable Australia Post = No).

Configuration

All settings are in Stores > Configuration > Sales > Delivery Methods > VibeFox Australia Post, in the standard Magento configuration form. Like other Magento settings, they can be changed for a website with the Scope switcher at the top of the page; Method title and Method name also for a store view. Save Config saves the whole page and clears the cached Australia Post rates. Number fields accept a point or a comma as the decimal separator, for example "9.99" or "9,99".

If one of these values is wrong, Magento shows an error and nothing on the page is saved: a Method title longer than 64 characters, an empty Method name or one longer than 64 characters, a Sort order that is not a whole number.

Other wrong values do not stop the save. A number field with a value that is not a number or is negative, or an AUD conversion rate of 0, is not saved: a warning names the field, and the previous value is kept. If Min cart weight (kg) is greater than Max cart weight (kg), the method would never be shown: a warning appears and both weights keep their previous values. An empty Method title, or one with the characters < > ; = # { }, is replaced with Australia Post, with a warning.

While Enable Australia Post is Yes and a live rate source is chosen, warnings after saving remind you of what is missing: the PAC API key, the 4-digit ship-from postcode, or the AUD conversion rate when the base currency is not AUD. Each warning also says what happens until you fix it: the method is hidden at checkout, or the fixed country prices are used in the fallback mode. The warnings are shown only while the method is enabled, because the Delivery Methods page is shared by all shipping methods.

General

Enable Australia Post: shows or hides Australia Post at checkout. Default: No.

Method title: the shipping method name shown to the customer in the cart and at checkout (the carrier title in Magento). Default: Australia Post. At most 64 characters.

Method name: shown after the method title, as "Method title - Method name". Default: Parcel delivery. Required, at most 64 characters.

Rate source: how the price is calculated.

Fixed prices (Country prices table): the price comes from the Country prices table. No API key needed. This is the default.
Live rates from Australia Post API: the price is requested from Australia Post for each cart. If the API gives no rate (API down, invalid postcode, parcel over the limits), the method is hidden for that cart.
Live rates, fixed price if the API gives no rate: the price is requested from Australia Post. If the API gives no rate, the fixed price for the country is used.

Error details go to the debug log, never to the customer.

Sort order: the position among the shipping methods at checkout. A whole number, negative numbers are allowed.

Australia Post API (live rates) (not needed for fixed prices)

PAC API key: your free Australia Post PAC API key. It is sent to Australia Post in the AUTH-KEY header. Magento stores it encrypted and shows only a mask after saving. Leave the mask as it is to keep the saved key, type a new value to change it. To delete the saved key, clear the field and click Save Config. Live rates then stop.

Ship-from postcode: the 4-digit Australian postcode the parcels are sent from, for example 2000.

Domestic service: used for deliveries within Australia (up to 22 kg, 105 cm per side): Parcel Post (default) or Express Post.

International service: used for deliveries outside Australia (up to 20 kg): International Standard (default), International Express or International Courier.

Remove GST: divides domestic API prices by 1.1. Domestic Australia Post prices include 10% GST. Set it to Yes when Magento adds tax on shipping itself (a tax class in Stores > Configuration > Sales > Tax > Tax Classes > Tax Class for Shipping), so GST is not charged twice. International postage is GST-free and is never changed. Default: No.

AUD conversion rate: Australia Post prices are in AUD. If the base currency of the website is not AUD, enter how many units of the base currency one AUD is worth, for example 0.61. The rate must be greater than 0. Without it, live rates are not used. If the base currency is AUD, leave the field empty.

Parcel for live rates

The cart is sent as one parcel. Product weights are converted to kg from the weight unit of your store (Stores > Configuration > General > General > Locale Options > Weight Unit, lbs or kgs). Magento products have no standard dimensions, so the parcel size below is always used and volumetric weight is not calculated.

Default product weight (kg): used for each product that has no weight, in the Australia Post request and in the Min cart weight (kg) / Max cart weight (kg) check. Default: 1.

Default parcel length (cm): the length of the parcel. Default: 22.

Default parcel width (cm): the width of the parcel. Default: 16.

Default parcel height (cm): the height of the parcel. Default: 8.

Fixed prices (used with Fixed prices and as the fallback of Live rates, fixed price if the API gives no rate)

Country prices: a table of countries and prices in the base currency of your store, tax excluded. Click Add country to add a row, choose the country and enter the price; click Delete to remove a row. Choose * All other countries for every country without its own row. A country without a price (and without a * row) gets no fixed rate, so the method is hidden for it. Rows without a valid price are dropped on save. If a country is listed twice, the last row is kept. The table is empty until you add prices.

Fixed price per: Order (default) charges the price once. Item (price × quantity) multiplies it by the number of items in the cart. This applies to fixed prices only. Live rates are always calculated for the whole parcel.

Conditions

Min cart weight (kg): hide the method below this cart weight. 0 means no limit.

Max cart weight (kg): hide the method above this cart weight. Default: 22. 0 means no limit, an empty field means 22 kg. Australia Post parcels: 22 kg domestic, 20 kg international.

Minimum order amount: show the method only when the subtotal of the products that need shipping (after discounts, tax excluded, in the base currency) reaches this amount. Leave it empty to always show it.

Free shipping: set to Yes to turn on free shipping from the amount below. Default: No.

Free shipping from: the subtotal of the products that need shipping (after discounts, tax excluded, in the base currency) from which shipping is free. No API request is made in that case. Used only when Free shipping is Yes.

Ship to Applicable Countries: All Allowed Countries offers Australia Post for every country your store allows, Specific Countries only for the countries below.

Ship to Specific Countries: the destination countries for Specific Countries.

Advanced

Debug log: writes rate calculations to var/log/vfd_ap_debug.log.php in the Magento folder. The file cannot be opened from the web. API errors are always logged, even when this is off. The API key and customer postcodes are not logged. Turn the log off when you are done.

Log: shows the size and the latest entries of the log. Click Clear log to empty it.

Remove data on uninstall: when Yes, uninstalling the module with its data deletes the Australia Post settings and the log (see Uninstall). It is read from the Default Config only. When No, they are kept for a re-install. The license key and the cached rates are always removed.

How it works at checkout

At the shipping step Magento asks the module for the Australia Post price. Only products that need shipping count: virtual and downloadable products add no weight and are not included in the order amount. The module first checks the countries, the cart weight and Minimum order amount. If free shipping applies, the price is 0 and no request goes to Australia Post. A Magento cart price rule with free shipping also makes the price 0.

In the fixed mode the price is taken from the table. In the live modes the module sends Australia Post the parcel weight and, for deliveries within Australia, the ship-from and delivery postcodes and the parcel size; for international deliveries, the destination country. A domestic live rate is requested only when the delivery address has a 4-digit postcode. No request is sent when the parcel is over the Australia Post limits (22 kg or 105 cm domestic, 20 kg international). The AUD price is converted to your base currency with your rate, and GST is removed from domestic prices if Remove GST is Yes. Magento then shows the price in the customer's currency and adds tax on shipping if your store charges it.

Each successful answer is cached for 1 hour, so the same cart does not trigger a new request. A failed request is cached for 10 minutes, so the checkout does not wait for Australia Post on every refresh. The API timeout is 10 seconds. API errors are never shown to the customer: the method is hidden, or the fixed price is used in the fallback mode. The reason is written to the log.

The module calculates rates only. It does not create shipping labels, eParcel or MyPost Business shipments or manifests, track parcels or let customers choose parcel lockers or Post Offices. The cart is always priced as one parcel. Letters, satchels and contract (eParcel) rates are not included.

License key

The module works with a VibeFox license key from vibefox.net. The license block License — VibeFox Australia Post is the first row of the VibeFox Australia Post group in Stores > Configuration > Sales > Delivery Methods, above the settings. Paste the key into License key and click Activate. After that the block shows the key masked, the status (for example the date the license is active until and your domain) and the buttons Check now to check the status again, Change key to enter another key and Remove key to remove the key from this store. Below them are the line Product: magento-shipping-australia-post and the link Manage licenses and domains in your account, which opens your vibefox.net account. Only Admin users whose role allows the Delivery Methods configuration section can change the key. The texts of the block follow the Admin interface locale (English and Russian are included).

If the key is not accepted, the block says why, for example Key not found, This key belongs to another product, Domain limit reached or License expired on a date. After the store address changes, or after you free a domain slot in your account, click Check now. If the license server cannot be reached, the module keeps working on the last known status.

One key works on one domain: the domain of the default store view, also when the installation has several websites or stores. Removing the key from the store does not free its domain slot. Free the slot in your vibefox.net account.

Without an active key, the Australia Post method is not shown to customers at checkout and no rate is calculated. The Magento storefront does not know that you are logged in to the Admin, so the method is hidden for you too: you can set up the module before you buy a key, but not test it at checkout. A reminder appears in the System Messages of the Admin, with the links Enter the license key and Dismiss, which hides it for 7 days. Existing orders are not affected.

When a license expires, the module keeps working, but updates and support need a renewal. The status is checked again automatically: once a day for the first 14 days after the key is entered, then once a week, by the Magento cron and while you work in the Admin. Uninstalling the module with its data always removes the license key and license status.

Troubleshooting

Australia Post does not appear at checkout: check that the license is active and Enable Australia Post is Yes for the website of the store. Check Ship to Applicable Countries and Ship to Specific Countries, the cart weight limits and Minimum order amount. In the fixed mode, check that the country or * All other countries has a price.

Live rates do not appear: turn on Debug log, reload the checkout and look at the Log field in the Advanced section. It shows the reason: no API key or ship-from postcode, no 4-digit delivery postcode yet, a parcel over the limits, no AUD conversion rate, or the Australia Post error message. With Live rates, fixed price if the API gives no rate customers still get the fixed price while you fix the problem.

My store is not in AUD: enter the conversion rate (how many units of your base currency one AUD is worth) in the AUD conversion rate field. Fixed prices are always in your base currency.

GST is charged twice on shipping: domestic Australia Post prices include 10% GST. If your store taxes shipping (Tax Class for Shipping), set Remove GST to Yes, or do not tax shipping.

The price is too high or too low: check the product weights, the weight unit of your store and the values in Parcel for live rates. With Item (price × quantity) fixed prices are multiplied by the number of items.

Rates look outdated after a change: click Save Config on the Delivery Methods page. This clears the cached Australia Post rates.

The settings page or the checkout looks unchanged after installing or updating: run bin/magento setup:upgrade and bin/magento cache:flush; in production mode also setup:di:compile and setup:static-content:deploy.

Uninstall

Deleting the module code alone removes nothing from the database: the license key and the settings stay. To remove the data, uninstall the module with the Magento command:

Installed with Composer: run bin/magento module:uninstall --remove-data Vibefox_AustraliaPostShipping. It removes the data and the code.

Installed in app/code: run bin/magento module:uninstall --non-composer Vibefox_AustraliaPostShipping to remove the data, then bin/magento module:disable Vibefox_AustraliaPostShipping, delete the folder app/code/Vibefox/AustraliaPostShipping and run bin/magento setup:upgrade.

The license key, the license status and the cached rates are always removed. If Remove data on uninstall is Yes, the Australia Post settings and the log are removed too. If it is No, the settings are kept for a re-install. Existing orders are not affected.

Australia Post is a trademark of its respective owner. This module is not affiliated with or endorsed by Australia Post.