Installation and setup
Requirements
Section titled “Requirements”- CS-Cart and Multi-Vendor 4.17.2 or later.
- Administrator access to the store’s admin panel.
- A Melhor Envio account. You register an application in your own account (Integracoes > Area Dev > Seus aplicativos) and get its Client ID and secret; the sandbox (a separate environment with a fictitious balance, Correios and Jadlog only) needs its own account and application.
- Brazil, the real (BRL) as a store currency (it can be a secondary currency: prices are converted) and CEPs on the shipping and sender addresses.
- A cron job on your server (see step 8).
Install the add-on
Section titled “Install the add-on”- Download the
kv_melhor_envio-<version>.zippackage from your Kavio Labs or CS-Cart Marketplace account. - In the admin panel, open Add-ons > Manage add-ons.
- Click the gear button and choose Manual installation, then upload the archive.
- Find Melhor Envio Shipping & Labels in the list and make sure its status is Active.
- Enter your license key under Settings > License (Kavio Labs downloads) and click Check now.
Connect Melhor Envio
Section titled “Connect Melhor Envio”- Open Orders > Melhor Envio labels and the Connection tab.
- Enter the technical contact e-mail: Melhor Envio requires an application name and an e-mail in the User-Agent of every request.
- In Melhor Envio create an application (sandbox first), set its callback to the address shown on the Connection page (copy it exactly), then paste the Client ID and Client secret into the sandbox fields and press Save.
- Fill in the sender (your name or company, CPF or CNPJ, address and CEP). The CEP is also the origin of the checkout quotes.
- Press Connect to Melhor Envio. Melhor Envio asks you to approve the application; you come back to the Connection page with “Authorized”. Test connection reads the services list.
- The webhook is optional: in Melhor Envio press Novo Webhook in your application and enter the webhook address shown on the Connection page. Without it the cron run reads the tracking every few hours.
- Open Administration > Shipping & taxes > Shipping methods and add a method for every service you want to offer: choose the shipping service Correios PAC, Correios SEDEX, Jadlog .Package, Jadlog .Com or Correios Mini Envios, rate calculation Real-time, and set the price rules on the Configure tab. Refresh services on the Connection page adds the other services of your account (for example other carriers).
- Add the cron job from the settings page (Cron section), every minute is fine. Overlapping runs are prevented.
- Switch to Live, enter the production application, connect again and test, when the sandbox works.
Multi-Vendor
Section titled “Multi-Vendor”By default the marketplace owner connects one Melhor Envio account for all vendors (Marketplace owner mode on): vendors can see and print the labels of their orders and follow the tracking, but only the marketplace administrator can create, pay or cancel them. Switch the mode off to let each vendor connect their own application and Melhor Envio account in the vendor panel (Connection tab): each vendor then pays their own labels, with their own sender address.
Update
Section titled “Update”- Upload the new package over the installed add-on the same way. Do not uninstall first. Your settings, credentials and data are kept.
- The add-on adds missing tables and settings by itself on the first request after the update.
See CHANGELOG for what changed in each version.
Uninstall
Section titled “Uninstall”Open Add-ons > Manage add-ons, click the add-on’s gear button and choose Uninstall.
By default uninstalling keeps your data (version 1.0.1 and later). Kept in the database: your connection (credentials), labels and tracking numbers, the pickup points your customers chose, the job queue, the log and your settings, licence key included. The shipping services of the add-on stay too. Your shipping methods of this add-on are only switched off (status Disabled), so customers no longer see them at checkout. When you install the add-on again (the same or a newer version), the methods are linked to the same services and get their old status back, and labels, connection and settings are as you left them. CS-Cart shows a notice after the uninstall that says what was kept.
To remove everything, open Add-ons > Manage add-ons > Melhor Envio Shipping & Labels > Settings, tick Delete all data on uninstall, save, then uninstall. This permanently deletes the tables (connection, labels, pickup points, log, jobs), the shipping methods and the shipping services of the add-on. It cannot be undone.
Uninstalling is not the way to update: upload the new package over the installed add-on. If you run an older version, update by upload first; the uninstall of an older version still deletes the data.