Retour

VibeFox Estafeta for Adobe Commerce — Aide

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.

DrEnvio account (for live rates only): live Estafeta rates come from DrEnvio, an Estafeta partner in Mexico. Create an account at drenvio.com, enable Estafeta, set up your pickup address there and copy the API key from your DrEnvio panel. It is the same key the official DrEnvio plugin uses. If you only use your own prices, you do not need a DrEnvio account.

Products: products need a weight for live rates.

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-estafeta-shipping. Without Composer: unpack the ZIP file into app/code/Vibefox/EstafetaShipping/, so that registration.php is directly in that folder.

2. Run bin/magento module:enable Vibefox_EstafetaShipping 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 Estafeta. 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. Enter the DrEnvio API key and, optionally, the Origin postcode. If the base currency of your store is not MXN, enter the MXN exchange rate. Set a country price for MX or a Fallback cost if the method should stay visible when DrEnvio has no rate. Set Enable to Yes and click Save Config.

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

Configuration

All settings are in Stores > Configuration > Sales > Delivery Methods > VibeFox Estafeta, 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 DrEnvio rates. Number fields accept a decimal point or comma, for example "9.99" or "9,99".

A wrong value does not stop the rest of the page from being saved. A warning that starts with Estafeta: tells you what happened to the field: an empty Method title or Method name, one longer than 64 characters or with one of the characters < > ; = # { } keeps its previous value; a Sort order that is not a whole number keeps its previous value; an Origin country that is not two letters is replaced with MX; an Origin postcode that does not have 5 digits is cleared; a number field with a negative number or text is cleared, and an MXN exchange rate of 0 is cleared too; when Minimum weight (kg) is greater than Maximum weight (kg), both weights keep their previous values.

While Enable is Yes, warnings after saving remind you of settings that change what customers see: no DrEnvio API key (country prices or the fallback cost are used), a base currency other than MXN without an exchange rate (live rates are not used), and no country price for MX and no fallback cost (without a live rate the method is hidden, or never shown without an API key). The warnings are shown only while the method is enabled, because the Delivery Methods page is shared by all shipping methods.

General

Enable: shows or hides Estafeta at checkout. Default: No.

Method title: the carrier name shown in the cart and at checkout. Default: Estafeta. Required, at most 64 characters.

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

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

Live rates (DrEnvio API)

The cheapest Estafeta service for the address is offered. Without a key the prices in the next section are used.

DrEnvio API key: the API key from your DrEnvio panel. 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. Then only Country prices and the Fallback cost are used.

Origin country: the two-letter country code of the pickup address. Default: MX. Sent only together with the origin postcode.

Origin postcode: the 5-digit postcode of the pickup address. Spaces are removed. Leave it empty to use the pickup address saved in your DrEnvio account.

MXN exchange rate: DrEnvio quotes in Mexican pesos. Only needed if your base currency is not MXN: the value of 1 MXN in your base currency, for example 0.05. It must be greater than 0. Without it live rates are not used.

Prices without a live rate

Used when there is no API key or DrEnvio returns no Estafeta rate (API down, unknown postcode, no postcode entered yet). Prices are in the base currency of your store, tax excluded.

Country prices: one destination country per line in the format CC:PRICE, for example MX:150. Use a decimal point or comma, no thousands separator. Parts in another format are dropped on save, and a warning tells you so.

Fallback cost: the price when there is no live rate and no country price. Leave it empty to hide the method; 0 means free shipping.

Calculation type: Per order charges the price once. Per item (price x number of items) multiplies it by the number of items in the cart. This applies to Country prices and Fallback cost only. A live DrEnvio rate is always the price of the whole parcel.

Conditions and countries

Free shipping from: shipping is free when the cart subtotal (products that need shipping, after discounts, before tax, in the base currency) reaches this amount. No DrEnvio request is made then. Leave it empty to never give free shipping.

Minimum subtotal: show the method only when the cart subtotal (after discounts, before tax) is at least this amount. Leave it empty to always show it.

Minimum weight (kg): the minimum cart weight for the method to appear. 0 means no limit.

Maximum weight (kg): the method is hidden if the cart is heavier. Default: 30. 0 or an empty field means no limit.

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 volumetric weight is not calculated: the actual cart weight is used.

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

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

The module has no tax field. Whether DrEnvio prices include IVA depends on your DrEnvio account. Magento adds tax on shipping only if your store taxes shipping (Stores > Configuration > Sales > Tax > Tax Classes > Tax Class for Shipping). If the DrEnvio prices already include IVA, do not tax shipping there.

Advanced

Debug log: writes API requests and rate calculations to var/log/vfd_est_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 addresses are never logged. Turn the log off when you are done.

Remove data on uninstall: when Yes, uninstalling the module with its data deletes the Estafeta settings and the log (see Uninstall). Set it in the Default Config scope: the uninstall reads only that value. Order history is retained.

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

How it works at checkout

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

Otherwise the module sends DrEnvio the destination country and postcode, the cart weight, the number of items and the subtotal in MXN, and the origin country and postcode if you set a postcode. Mexican postcodes must have 5 digits; until the customer enters a delivery address with one, no request is made. DrEnvio returns quotes of all carriers of your account. The module uses only Estafeta quotes, ignores zero prices, picks the cheapest one and converts it to your base currency. Magento then shows the price in the customer's currency.

Each answer is cached for 1 hour. A failed request or a route without an Estafeta rate is remembered for 5 minutes, so a slow or broken API never stalls every checkout update. The API timeout is 12 seconds. In these cases the customer sees no error: the country price or the fallback cost is used, or the method is hidden if neither is set. The reason is written to the log.

The module calculates rates only. It does not create shipments, print labels (guías) or track parcels; create the shipment in your DrEnvio or Estafeta account. The customer cannot choose a specific Estafeta service or an Estafeta office, and exchange rates are not updated automatically.

Orders

When an order with Estafeta is placed, the module stores the rate the customer was offered at checkout with the order. On the admin order page (Sales > Orders > View, Information tab) an Estafeta block shows:

Estafeta service: the Estafeta service of the DrEnvio quote and its delivery time. Shown only for live rates.

Price source: Live DrEnvio rate, Country price (no live rate), Fallback cost (no live rate) or Free shipping.

Calculated price (excl. tax): the shipping price in the base currency.

The block also works for older orders and when the module is switched off.

License key

The module works with a VibeFox license key from vibefox.net. The license block License — VibeFox Estafeta is the first row of the VibeFox Estafeta 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-estafeta 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 Estafeta 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

Estafeta does not appear at checkout: check that the license is active and Enable is Yes for the website of the store. Check Ship to Applicable Countries and Ship to Specific Countries, the weight limits and Minimum subtotal, and read the warnings after Save Config. Without an API key or when DrEnvio has no Estafeta rate, the method needs a country price for the destination or a Fallback cost.

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, no exchange rate for a store whose base currency is not MXN, a missing or invalid postcode, a rejected API key (DrEnvio HTTP 401 or 403, check the API key), no Estafeta rate for the route (the log lists the carriers DrEnvio returned), or a rate in a currency other than MXN.

Does the price include IVA? That depends on your DrEnvio account. If the DrEnvio prices already include IVA, do not tax shipping in Tax Class for Shipping.

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

The order page has no Estafeta block: the block is shown only for orders placed with Estafeta while the module was installed.

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_EstafetaShipping. It removes the data and the code.

Installed in app/code: run bin/magento module:uninstall --non-composer Vibefox_EstafetaShipping to remove the data, then bin/magento module:disable Vibefox_EstafetaShipping, delete the folder app/code/Vibefox/EstafetaShipping 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 Estafeta settings and the log are removed too. If it is No, the settings are kept for a re-install. The Estafeta services saved with orders are never deleted.

Estafeta and DrEnvio are trademarks of their respective owners. This module is not affiliated with or endorsed by Estafeta or DrEnvio.