1. What this module does
Let customers compare products side by side in a clear table of prices and features. The module adds a Compare button to the product page and to product tiles, a bar with the selected products at the bottom of the page and a comparison page with its own address: the products in columns, their price, availability, brand, features and other details in rows, with the differences highlighted.
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
- Download the module from My account → Order history at addonspresta.com.
- In your Back Office, open Modules → Module Manager and click Upload a module.
- Drop the
ap_productcompare_v1.0.0.zipfile and wait for the confirmation. - 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_productcompare from the shop folder.
Right after the installation customers can compare up to 4 products. The button is on the product page below Add
to cart and on product tiles, the floating bar is on, and the header shows a Compare link next to the cart. The
comparison page already has its address in every language of your shop, for example /en/product-comparison, and
is kept out of search engines.
3. How it works
Choosing products. A customer clicks Compare on a product page or on a product tile. The button changes to In comparison with a check mark; another click takes the product off the list. When the list is full, a message says how many products can be compared and asks to remove one first. Buttons also work on products loaded later: after filtering a category, in a quick view or with infinite scroll.
The floating bar. While the list has products, a bar at the bottom of every page shows their thumbnails and names with a button to remove each one, the number of products out of the maximum, a Compare (n) button that opens the comparison page and Clear. On a phone the bar shows only the thumbnails and the buttons. It is not shown on the comparison page itself.
The link to the comparison page. Depending on your settings, a Compare link with the number of products appears in the header, a Product comparison entry on the customer's My account page and a Compare products block in the footer.
The comparison page. Each product is a column with its image, name and a button to remove it. Below, one row per detail you selected in the settings: price (with the old price, the discount and the unit price when there are any), availability, brand, reference, category, condition, weight, dimensions, EAN-13, UPC, ISBN, MPN, short description, one row for each attribute of the combinations (for example Size: S, M, L), one row for each feature (for example Material) and an Add to cart button. A row without a value in any of the products is not shown. Rows whose values differ between the products can be highlighted. Above the table, customers can:
- switch Only differences on to hide the rows that are the same for every product (from 2 products);
- click Copy link to copy the address of this comparison and send it to someone — whoever opens it sees the same products with the note "This comparison was shared with you." and can keep them with Save as my comparison; opening the link never changes the visitor's own list;
- click Print — the print view leaves out the buttons, the bar and the header and footer of your theme;
- click Clear the list.
On a phone the table scrolls sideways inside its frame, with the row names fixed on the left; the page itself never scrolls sideways. With an empty list the page says "Your comparison list is empty." and shows Continue shopping.
Which products can be compared. Only products that are active in the shop, visible "Everywhere", "Catalog only" or "Search only", and in a category the customer's group may see. A product that is switched off or hidden later disappears from every list by itself. A product with combinations is compared as one product: its combinations appear as the values of the attribute rows, and Add to cart adds the default combination.
Shop settings the module follows. The comparison shows what the product page would show:
- in catalog mode, and for customer groups that do not see prices, the price and availability are not shown and the last row offers View product instead of Add to cart; the same button appears for a product that cannot be added directly (not available for order, out of stock without backorders, a customization to fill in);
- with stock management off (Shop Parameters → Product Settings), there is no availability row;
- with the optional features Features or Combinations off (Advanced Parameters → Performance), there are no feature rows or no attribute rows;
- the condition row shows the condition of the products where it is displayed on the product page.
Where the list is kept. In the cookie PrestaShop already uses for each visitor — the module adds no cookie of its own and nothing to the database. The list therefore belongs to the browser: it lasts as long as PrestaShop's visitor cookie (by default 20 days after the last visit, like the cart of a guest), it is not linked to the customer account, and it is emptied when a customer logs out, so the next person on a shared computer does not see it. In multistore each shop has its own list; shops of a group that shares carts share one list, and each of them shows only its own products.
Cache. The buttons look the same for every visitor, and the state of each visitor's list is applied in the browser. That is why they also work with the Smarty cache on (Advanced Parameters → Performance) and in product blocks of other modules. After you save the settings, the module clears the Smarty cache so that tiles show the new buttons. If you use a module that caches whole pages, set it up so that it never serves one visitor's page to another.
The module stores only its settings and the comparison page in SEO & URLs. It does not change PrestaShop tables and does not connect to addonspresta.com or any other server.
4. Features and settings
Open Modules → Module Manager → Product Comparison → 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 three panels — Buttons, Comparison table and Page and SEO. Each has a Save button, and each one saves all three panels.
Buttons
Maximum number of products
How many products a customer can compare at once, from 2 to 10; 4 by default. Four columns fit well on a computer; on a phone the table scrolls sideways.
Button on the product page
Shows the Compare button on the product page. On by default.
Position on the product page
- Below the Add to cart button — directly under the purchase area (default).
- With the additional information (share buttons) — lower, next to the share buttons of your theme.
Button on product tiles
Shows the button on product tiles: categories, search results, the home page and the product blocks of other modules. On by default.
Button style on product tiles
- Icon and text — the icon with "Compare" (default).
- Icon only — a small round button; the text is still read by screen readers.
On the Classic theme the tile button is always a round icon in the corner of the image, because the Classic tile has no room for text. The button on the product page always has icon and text.
Floating comparison bar
Shows the bar with the selected products at the bottom of the page. On by default. When it is off, customers reach the comparison page through the link below.
Link to the comparison page
Tick where the link with the number of compared products appears:
- Header, next to the cart (displayNav2) — ticked by default;
- Header, top bar on the left (displayNav1);
- My account page (displayCustomerAccount) — an entry "Product comparison" among the customer's account links;
- Footer (displayFooter) — a block "Compare products".
You can leave all of them unticked: the bar still leads to the page. For another place in your theme, your
developer can add {widget name='ap_productcompare' link=1} to a template.
Comparison table
Rows
Tick the rows the table shows; at least one. The image, name and link of each product are always shown. The rows always appear in this order: Price, Availability, Brand, Reference, Default category, Condition, Weight, Dimensions (width, height, depth), EAN-13, UPC, ISBN, MPN, Short description, Combination attributes (one row per attribute), Features (one row per feature) and Add to cart button. All are ticked by default except Default category and the four codes.
Weight and dimensions use the units of International → Localization (Local units); a value of 0 counts as empty. A row is skipped when none of the compared products has a value in it.
Features
- All features of the compared products — every feature that at least one of the products has, in the order of Catalog → Attributes & Features → Features (default).
- Only the selected features — only the features ticked below, for example to leave out internal ones.
Selected features
The list of your shop's features, shown when the shop has some. It is used only with Only the selected features, and then at least one must be ticked while the Features row is on.
Highlight differences
Colours the rows whose values differ between the products. The comparison ignores tags, extra spaces and upper or lower case. On by default.
"Only differences" switch
Shows the Only differences switch above the table, which hides the rows that are the same for every product. It appears from 2 products. On by default.
Share link
Shows the Copy link button. The link holds the product IDs and opens the same comparison for anyone, read-only; products that the person may not see are left out. When this setting is off, such links open the visitor's own list. On by default.
Print button
Shows the Print button. On by default; customers can still print with their browser.
Page and SEO
The panel shows the current address of the comparison page. The address, meta title and meta description are also
in Shop Parameters → Traffic & SEO → SEO & URLs (page module-ap_productcompare-compare); a change in one place
shows in the other.
Page address
The part of the address after the language, for each language: by default product-comparison (English),
porownanie-produktow, comparateur-de-produits, produktvergleich, comparar-productos and confronta-prodotti.
What you type is saved as an address: lower case, spaces turned into hyphens, up to 128 characters. It is
required in the default language; a language
left empty uses the address of the default language. An address used by another page of the shop in the same
language is refused. The address is used when friendly URLs are on.
Meta title
The title of the page for search engines and the browser tab, for each language, up to 128 characters. By default "Product comparison" in each language.
Meta description
The description for search engines, for each language, up to 255 characters. The meta title and description cannot
contain the characters < > = { }.
Search engines
- Do not index (noindex, follow) — default. Each visitor sees their own list, so the page has nothing to offer in search results; search engines still follow its links.
- Index (index, follow) — allows the page in search results.
The canonical address of the page is always the address without the product list.
5. Multistore
Settings are saved for the shop or shop group selected in the Back Office header. Select All shops to set the same values everywhere, or a single shop to give it its own buttons, rows and features. In the All shops or group context only an employee who manages every shop of that context can save. The page address, meta title and meta description are saved for the shops of the selected context. Each shop has its own comparison list and compares only its own active products. Shops of a group that shares the cart share one list, because PrestaShop gives them one cookie: each shop shows only its own products, and changing the list in one shop removes the products added in another shop of the group. One licence covers every shop of the installation.
6. Uninstall
Module Manager → Product Comparison → Uninstall removes all the module's settings and the comparison page from SEO & URLs. Lists kept in visitors' browsers are no longer used. To keep the settings, use Disable instead.
7. FAQ and troubleshooting
The Compare button does not appear on product tiles.
Check that Button on product tiles is on and clear the cache in Advanced Parameters → Performance. The button
uses the theme hook displayProductListReviews; Classic and Hummingbird have it. With another theme, check
Design → Positions for that hook, or ask your developer to add {widget name='ap_productcompare'
id_product=$product.id_product} to the product tile.
The button stays on "Compare" after a click. Open the browser console and look for a JavaScript error of another script. Check also that the module is enabled in the shop of the current context and that the page is not served from a whole-page cache.
A product I added does not appear on the comparison page. It is no longer active, its visibility is "Nowhere", or its categories are closed to the customer's group. The module removes such products from every list. Products of another shop of a multistore are not compared.
There is no price, or "View product" instead of "Add to cart". The shop is in catalog mode, the customer's group does not see prices (Customers → Groups), or the product cannot be added directly: not available for order, out of stock without backorders, or with a customization to fill in. The module shows what the product page would show.
A row I ticked is missing. No compared product has a value in it: for example no brand, a weight of 0, or no short description. Feature rows also need the optional feature Features on, attribute rows Combinations on, and the availability row stock management on. The condition row shows only products whose condition is displayed on the product page.
A feature I do not want appears in the table. Choose Only the selected features in Features and tick only the features customers should compare.
The page address gives a "Page not found" error. Check that friendly URLs are on in Shop Parameters → Traffic & SEO → SEO & URLs and that the address is not used by another page. After a change, clear the cache in Advanced Parameters → Performance.
Does the comparison follow the customer to another computer? No. The list is kept in the browser where it was made and is emptied at logout. A customer can send the comparison with Copy link and open it elsewhere, then keep it with Save as my comparison.
A text is still in English in my shop. The page address, meta title and meta description are settings for each language in Page and SEO; at installation they are filled in English, Polish, French, German, Spanish and Italian, and in English for other languages. The other texts are translated in International → Translations → Installed modules translations.
Can I change how the buttons, the bar or the table look?
Yes, from your theme, so your changes survive updates: the README.md file in the module zip, section
"Customising", lists the template sections, CSS variables, widgets and hooks you can use.
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 CET; we usually answer within 2 business days). Please include your PrestaShop version, the module version and the steps that lead to the problem.