1. What this module does

Show shipping costs and delivery times for each carrier right on the product page. Under the Add to cart button the module prints a small block "Shipping to [country]" with one line per carrier: its name, its delivery time and the shipping cost. The customer can pick another country in the list; the cost follows the quantity typed in the quantity field and the combination chosen on the page.

The cost is the one your checkout would show for a cart holding only this product in the chosen quantity, delivered to the chosen country, for this visitor's customer group, currency and tax display. The module computes it from your own carrier settings: it adds no shipping rule and no price of its own, and it never changes the visitor's cart.

Works with PrestaShop 1.7.8, 8.x and 9.x (PHP 7.2.5 or newer), with the Classic and Hummingbird themes and with multistore.

2. Installation

  1. Download the module from My account → Order history at addonspresta.com.
  2. In your Back Office, open Modules → Module Manager and click Upload a module.
  3. Drop the ap_shippingestimate_v1.0.0.zip file and wait for the confirmation.
  4. Click Configure on the module card.

If you have shell access, you can also unpack the zip into modules/ and run php bin/console prestashop:module install ap_shippingestimate from the shop folder.

The block appears right after the installation on the product pages of products that can be shipped, under the Add to cart button. There is nothing to set up first: the module uses the carriers, zones, ranges and prices you already have in Shipping → Carriers. To check what a visitor will see:

  1. Open Modules → Module Manager → Shipping Cost Estimator → Configure (in a multistore, first select one shop in the Back Office header).
  2. In Test a product, type the ID of a product, choose a country and click Show the estimate.
  3. You see the carriers a visitor who is not logged in gets, with their prices, and the reason for every carrier that is not listed.
  4. Open the product page in your shop: the block is under the Add to cart button.

3. How it works

What the customer sees

A block with the label "Shipping to" (or your own label) and a list of the countries you deliver to, followed by one line per carrier:

  • the carrier's name and, under it, its delivery time (the carrier's "Transit time" text);
  • on the right, the price as your checkout writes it: an amount (with "tax incl." or "tax excl." when your checkout shows that label for the country), "Free", or "Price shown in the cart" for a carrier whose module computes the price (see "Carriers priced by a module" below);
  • the carrier's logo in front of the line, when you switch logos on.

When there are more carriers than Rows before "Show all carriers" (5 by default), the others are behind a link "Show all carriers (7)" (with the number of all carriers) that opens them below the first ones.

Under the lines there is always the note "Estimate for this product alone; the final cost is shown in the cart." When no carrier delivers this product to the chosen country, the block says "We do not deliver this product to Australia." (with the name of the country) instead of the lines.

The block follows the page. When the customer types another quantity in the theme's quantity field, chooses another combination or picks another country, the lines are computed again; the old lines stay until the new ones arrive. If the answer cannot be loaded (the connection is lost, for example), the lines are replaced with "The estimate could not be loaded. The shipping cost is shown in the cart."

Without JavaScript the block still shows the lines for the country it starts with, the combination and the quantity of the page; the country list is then disabled.

What the number is

The cost of each carrier is the cost PrestaShop's checkout shows for a cart that holds only this product, in the quantity of the field, in the combination of the page, with a delivery address in the chosen country, for the visitor's customer groups, currency and price display (tax included or excluded). The module follows the same rules as your checkout, with your own settings:

  • the carriers of the shop that are active, deliver to the zone of the country, are open to one of the visitor's customer groups and, when the product is limited to some carriers, are among them;
  • the carrier's limits: maximum package width, height, depth and weight against the product's size and weight times the quantity;
  • the ranges of each carrier (by weight or by price, as the carrier is billed) with the prices of the zone; above the highest range or below the lowest the carrier's "Out-of-range behavior" applies — the cost of the highest range, or the carrier is not offered;
  • free carriers and your free shipping thresholds ("Free shipping starts at" in Shipping → Preferences, by price and by weight), compared with this product's total and weight;
  • handling charges of Shipping → Preferences for the carriers that use them, and the product's additional shipping costs times the quantity;
  • the product's price for this visitor (combination, quantity discounts, specific prices, customer group) when a carrier is billed by price or a threshold needs it;
  • the tax of the carrier for the chosen country, the visitor's currency and the rounding of your shop;
  • the order of the carriers of your checkout (or cheapest first, setting below).

Before the release, the module's results were compared with PrestaShop's own checkout on 2,268 carts on PrestaShop 1.7.8, 8.2 and 9.2 (carriers billed by weight and by price, with handling charges, free carriers, out-of-range rules, carriers limited to a group or a product, size and weight limits, free shipping thresholds, rounding and tax settings, quantities from 1 to 25, several countries and customer groups): the carriers, the amounts and the order were the same in every case, apart from the carriers priced by their own module, which the module does not compute.

What the estimate leaves out

The estimate is for this product alone, on purpose. It does not include, and so it can differ from the cart:

  • the other products in the visitor's cart: together they can reach another weight or price range, a free shipping threshold or a carrier's weight limit;
  • vouchers and cart rules, also automatic ones such as free shipping rules;
  • states and postcodes: the zone of the country is used. When a state of the country belongs to another zone (US states, for example), the cart of a customer in that state can show other carriers or prices;
  • gift wrapping;
  • a VAT number exemption: the estimate shows the tax of the country even to a business customer whose address exempts them from VAT in the checkout;
  • the warehouses of advanced stock management (PrestaShop 1.7.8 and 8), and the split of an order into several packages;
  • the prices and refusals of carriers priced by their own module, and the changes that other modules make to the cart's shipping cost.

This is why every block ends with the note "Estimate for this product alone; the final cost is shown in the cart." The binding shipping cost is the one the customer sees in the cart and the checkout before ordering, which the module does not change. Keep this note when your theme developer changes the module's templates (section "Templates" of README.md).

Carriers priced by a module

Some carriers are priced by their own module (parcel lockers, live rates from a carrier's API, for example). Such a module needs a real cart with an address to compute its price, so the estimate never asks it. The setting Carriers priced by their module decides what the visitor sees:

  • List them with "Price shown in the cart" (default): the carrier is listed with that text instead of an amount, when it passes the same rules as the others (zone, group, product, limits, ranges);
  • Do not list them: the carrier is left out.

The module cannot know whether the carrier's module will accept the order: a carrier listed with "Price shown in the cart" can still be missing in the cart, for example when its module refuses the address. A carrier module that only adds a carrier with your own ranges and prices (no price computed by the module) is computed like any other carrier. A module carrier without ranges that your checkout itself never offers is not listed either.

The country

The list holds the countries you deliver to: the active countries of the shop whose zone is active and has at least one active carrier of the shop, sorted by their name in the visitor's language. A country whose zone has no carrier is not in the list, so the customer never chooses a dead end. The list is the same for every visitor: it does not check the customer group. A country that only a carrier closed to the visitor's group serves (a carrier for professional customers, for example) is in the list, and the block then answers "We do not deliver this product to …" for that visitor.

The country the block starts with is the one PrestaShop itself has chosen for the visitor, when it is in the list:

  • the country of the delivery address of the visitor's cart, when there is one;
  • otherwise the country found by PrestaShop's geolocation (International → Localization → Geolocation), when you use it;
  • otherwise, when Set default country from browser language is on (International → Localization), the country of the browser's language — PrestaShop does this only on the first page a visitor opens;
  • otherwise your shop's default country.

When that country is not in the list, the block starts with your default country, or else with the first country of the list. The module has no geolocation service of its own and contacts no outside service to find the visitor's country.

The visitor's choice is remembered in the browser only. When the customer picks a country, the module's script keeps that country's ID in the browser's local storage (key ap_shippingestimate_country), and the block starts with it on the next product pages, as long as the country is in the list. Nothing else is stored: no cookie, nothing on the server, no personal data. If your privacy policy lists what the shop keeps in the visitor's browser, you can add this entry. Choosing a country in the block changes nothing else: not the visitor's cart, not the country or currency of the shop, not the address of the checkout.

Quantity and combination

The block starts with the quantity and the combination the page shows when it opens (the quantity is the product's minimum quantity). When the customer types another quantity, the block computes again a moment after the last key; when the customer chooses another combination, it uses that combination's weight and price. The quantity is used as typed, from 1 to 1,000,000: it is not raised to the minimum quantity, so a customer who types 1 sees the cost of one piece even when the product's minimum is 3.

Where the block is not shown

  • In quick view: the modal has no room for it.
  • When the shop is in catalogue mode, when the visitor's customer group does not see prices ("Show prices" off for the group), or when geolocation shows the catalogue only to the visitor's country.
  • For a product that is disabled, not available for order, or virtual (it is not shipped).
  • For a product the visitor cannot see because of the access of its categories to customer groups.
  • When no country is in the list (no carrier delivers to any zone of your active countries).
  • When Enable the estimate is off, or the module is disabled in the Module Manager.

A product with the visibility "Nowhere" still has its product page, and the block is shown there.

The place of the block

  • Under the Add to cart button (default) — in the product column, next to the pictures. Classic and Hummingbird print this place inside their add-to-cart form and replace it after every combination change, so the script moves the block once, right after the form, where it stays.
  • Below the product, across the full width — under the product's description, where the theme prints the displayFooterProduct place. The block is at most about 580 px wide there.
  • Only where the theme calls the widget — nothing is printed until a template of the product page contains {widget name='ap_shippingestimate'}, or until you attach the module to another place of the product page in Design → Positions (PrestaShop then prints the widget there).

The block is printed once per page, at the first place that prints it. A widget must not be put inside a part of the page that the theme replaces after a combination change (the prices, the combinations, the add-to-cart part, the pictures): it would disappear after the first change. The only exception is the part where the theme prints "Under the Add to cart button", which the script leaves. Details for the theme developer are in README.md.

The block takes the fonts, colours and fields of your theme; the module only adds spacing.

Other modules of your shop

  • Full-page cache. The block depends on the visitor's country, customer group, currency and tax display, like the prices of the product page. A cache module, a server cache or a CDN that stores whole product pages must keep a separate page per customer group and country (as it must for prices), or must not cache product pages. Otherwise a visitor can get the block another visitor saw: the carriers of another group, or the country of another visitor (the script corrects only the country, and only when the visitor has chosen one before).
  • Modules attached to PrestaShop's shipping hooks (actionDeliveryPriceByWeight, actionDeliveryPriceByPrice, and on PrestaShop 9 actionOverrideShippingFreePrice and actionOverrideShippingFreeWeight) are asked for every estimate, once per carrier, as on the cart page, also for visitors who have no cart. A module that fetches live rates there does so for each estimate, so every country or quantity change costs one such request.
  • Each estimate is an ordinary request to your shop: modules that run on every page (statistics, for example) also run for it.
  • Modules can remove a carrier from the estimate or set its price through the module's own hook (README.md). The carrier's name, delivery time and logo stay those of the carrier.

Personal data, connections, e-mails

The module stores no personal data: only your settings. Besides the country ID in the visitor's browser (above), it sets no cookie and keeps nothing about visitors. It makes no outgoing connection — no licence check, no statistics, nothing to addonspresta.com or any other server. It has no cron job, sends no e-mails, creates no database table and never changes a cart. Nothing is cached: every estimate is computed when it is asked for.

Failures. If the block cannot be shown or an estimate cannot be computed (because another module fails in a shipping hook, for example), the product page is shown without the block, or the block shows its failure sentence, and one line at most per hour is written to Advanced Parameters → Logs, starting with "Shipping Cost Estimator:".

4. Features and settings

Open Modules → Module Manager → Shipping Cost Estimator → Configure. The Help box at the top links this manual and the module page at addonspresta.com in the language of your Back Office, gives our support address and shows the installed version. Below it are the Settings and Test a product.

Settings

Saved for the shop or shop group selected in the Back Office header with Save; "Settings saved." confirms it. When a value is wrong, nothing is saved and the form shows the message above your values.

Enable the estimate

On after the installation. "Off: nothing is shown in the shop and no file of the module is loaded there." All settings stay.

Place of the block

"Under the Add to cart button" is the product column, next to the pictures. "Below the product" gives the block the whole width of the page. With "Only where the theme calls the widget" nothing is printed until a template of the product page contains {widget name='ap_shippingestimate'}.

  • Under the Add to cart button (default)
  • Below the product, across the full width
  • Only where the theme calls the widget

See "The place of the block" in section 3.

Carriers priced by their module

"Some carrier modules (parcel lockers, live rates) compute the cost themselves and need a real cart. The estimate never asks them: such a carrier is listed without an amount, or left out."

  • List them with "Price shown in the cart" (default)
  • Do not list them

Order of the carriers

  • As in the checkout (default) — "As in the checkout" follows Shipping > Preferences (by price or by position). Carriers without a known price ("Price shown in the cart") keep their place by position, and come last when your checkout sorts by price.
  • Cheapest first — by the amount the visitor sees: free carriers first, then the lowest amounts, "Price shown in the cart" last; carriers with the same price keep the checkout's order.

Show the delivery time

On after the installation. "The "Transit time" text of the carrier in the language of the visitor." It is set per carrier in Shipping → Carriers.

Show carrier logos

Off after the installation. "Only for carriers that have a logo. A carrier without one is listed without a picture." The logo is the one you upload for the carrier in Shipping → Carriers; it is shown in a small square in front of the line.

Rows before "Show all carriers"

"From 1 to 20. Further carriers open with "Show all carriers"." Default 5. A whole number from 1 to 20.

Label

One field per language, up to 60 characters of plain text (the characters < and > are refused; spaces at the start and the end are removed). "The text in front of the country list. Leave empty to show "Shipping to", translated into the language of the visitor."

Test a product

"The estimate a visitor who is not logged in gets, and the reason for every carrier that is not listed." Fill in:

  • Product ID;
  • Combination ID (empty = default) — the default combination when it is empty;
  • Quantity — 1 when it is empty, otherwise a whole number from 1 to 1,000,000 ("Enter a quantity from 1 to 1000000." otherwise);
  • Country — the countries of the block's list.

Click Show the estimate. The test works in the context of one shop ("Select one of your shops in the header to test a product." otherwise) and changes nothing. It computes the estimate with the same rules as the shop, for a visitor who is not logged in: the Visitor group, its price display and your default currency. It answers with the product (#ID and its name) and the line "Shown for quantity 1, combination -, delivered to Poland." (with your values), then:

  • Carriers the visitor sees — Carrier, Delivery time and Price, as the block shows them, in the block's order (also the carriers behind "Show all carriers");
  • Carriers not shown — every other carrier of the shop with Why it is not listed:
  • "It does not deliver to the zone of this country."
  • "It is not available to the Visitor group."
  • "The product is limited to other carriers."
  • "The product is larger than the maximum package size of the carrier."
  • "The order is heavier than the maximum weight of the carrier."
  • "The order is outside its ranges, and the carrier is set to be disabled then."
  • "It has no price for this zone."
  • "Its module computes the price: not listed, as chosen in Settings."
  • "The checkout of PrestaShop does not offer it: a module carrier without price ranges."
  • "Another module removed it from the estimate."

When the product gets no block, the test says why:

  • "No product with this ID in this shop."
  • "Not shown: the product is disabled in this shop."
  • "Not shown: the product is not available for order."
  • "Not shown: a virtual product is not shipped."
  • "Not shown to visitors who are not logged in: the categories of the product are closed to the Visitor group."
  • "This combination does not belong to the product in this shop."

When the results are there but the shop would not show them, a line says so: "The module is switched off in Settings: nothing is shown in the shop." or "The shop is in catalogue mode: the estimate is not shown." When no country of the shop has a carrier, the test form is not shown and the page says "No country of this shop has a carrier: the estimate is not shown. Check Shipping > Carriers (zones) and International > Locations (active countries)."

If another module fails while the estimate is computed, the test says "The test could not be finished: an error occurred while the estimate was computed. The details are in Advanced Parameters > Logs." and the rest of the page keeps working.

The test checks the visitor who is not logged in. A logged-in customer of another group can see other carriers (carriers limited to groups) and other prices (the group's reduction and price display).

Who sees the test. Every employee who may configure the module can use it in the shops they manage. It shows product names (also of disabled products) and the carrier settings of the shop (zones, groups, limits, ranges), also to an employee who has no access to Catalog or Shipping. Give the module's Configure permission accordingly (Advanced Parameters → Team → Permissions).

5. Multistore

Settings are saved for the shop or shop group selected in the Back Office header. Values saved with All shops apply to every shop that has no value of its own. In the All shops or a group context only an employee who manages every shop of that context can save ("Select one of your shops in the header to change the settings: in the All shops or group context they also apply to shops you do not manage.").

Each storefront uses the settings of its own shop and computes the estimate with that shop's carriers, zones, ranges, countries, prices and shipping preferences (handling charges, free shipping thresholds, sorting). Test a product works in one shop at a time and only for the products of that shop. One licence covers every shop of the installation.

6. Uninstall

Module Manager → Shipping Cost Estimator → Uninstall deletes every setting of the module, in every shop, labels included. Reset does the same and then installs the module again with the default settings. The module has no table and no data besides its settings; your carriers and prices are not touched. The module's own hook actionApShippingestimateRows stays in the list of hooks, because other modules may use it.

Disable keeps the settings; while the module is disabled the shop shows no block. Switching off Enable the estimate in the settings does the same for one shop.

7. FAQ and troubleshooting

A product shows no block. Type the product's ID in Test a product: it says whether the product gets an estimate and why not. Then check:

  1. Enable the estimate is on, and the module is enabled in the Module Manager.
  2. The product is active, available for order and not virtual.
  3. At least one country is in the list: a carrier is active, linked to the shop and to the zone of an active country (Shipping → Carriers, International → Locations).
  4. The shop is not in catalogue mode, and the visitor's customer group shows prices (Shop Parameters → Customer Settings → Groups, "Show prices"). Test a product reports the catalogue mode of the shop, not the setting of a group.
  5. You are looking at the product page itself: the block is never shown in quick view.
  6. With Only where the theme calls the widget: a template of the product page contains the widget.

If it still does not appear, look in Advanced Parameters → Logs for an entry starting with "Shipping Cost Estimator:".

The price differs from the cart. The estimate is for this product alone (section 3, "What the estimate leaves out"). The usual reasons are:

  • other products in the cart reach another range, a free shipping threshold or a weight limit;
  • a voucher or a cart rule (free shipping, for example) applies in the cart;
  • the customer's address is in a state or postcode with another zone or tax;
  • the customer's address has a VAT number that exempts it from tax;
  • the carrier is priced by its module, which the estimate never asks.

Type the same product, quantity and country in Test a product to see what the estimate counts.

A carrier is missing. Test a product lists every carrier that is not shown, with the reason: the carrier does not deliver to the zone of the country, is not open to the Visitor group, the product is limited to other carriers, the product is larger or heavier than the carrier's limits, the order is outside the carrier's ranges and the carrier is disabled then, it has no price for the zone, or it is priced by its module and Carriers priced by their module hides it. For a carrier limited to customer groups, remember that the test is for a visitor who is not logged in.

A carrier shows "Price shown in the cart". Its module computes the price (section 3, "Carriers priced by a module"). Choose Do not list them to hide such carriers.

The country the block starts with is wrong. The block starts with the country PrestaShop found for the visitor (section 3, "The country"). Check your default country, Set default country from browser language and geolocation in International → Localization. PrestaShop uses the browser's language only on the first page of a visit. A country the visitor picked before in the block wins, as long as it is in the list.

A country is missing from the list. The country must be active, belong to the shop, and its zone must be active and have an active carrier of the shop. A country whose states have their own zones is estimated with the zone of the country; when only the states' zones have carriers, the country is not in the list.

The block shows the country or the carriers of another visitor. A full-page cache serves the same product page to everybody. Configure it to keep a separate page per customer group and country, or exclude product pages (section 3, "Other modules of your shop").

"The estimate could not be loaded. The shipping cost is shown in the cart." The browser could not get an answer, or the shop refused the request. Reload the page. If it stays, look in Advanced Parameters → Logs for "Shipping Cost Estimator:" and check the shipping modules of your shop.

The block appears twice, or disappears after a combination change. The block is printed once per page. When it disappears after a combination change, the widget sits in a part of the page that the theme replaces; move it (section 3, "The place of the block").

"The page has expired. Reload it and save again." The page was open for a long time, or you logged in again in another tab. Reload the page and save again.

A text of the module is still in English in my shop or my Back Office. Open International → Translations → Installed module translations, select the module and your language, and check the translation. The texts "Free" and "tax incl." / "tax excl." next to the prices are PrestaShop's own, the same as in your checkout.

8. Updates and support

Updates are free for life: download new versions from My account → Order history at addonspresta.com and upload them like a new module. Your settings are kept.

Support is included for 12 months from your order: write to mail@addonspresta.com or use the contact form at addonspresta.com (Monday to Friday, 10:00–16:00; we usually answer within 2 business days). Please include your PrestaShop version, the module version and the steps that lead to the problem.

Back to User manuals

Loading...
Back to top