1. What this module does

Let customers order several combinations of a product at once from one table. On the product page the module adds a table with one row per combination — picture, variant, reference, the customer's own price, availability and a quantity field. The customer types quantities for as many sizes or colours as needed, sees the number of variants, the number of pieces and the total below the table, and puts everything into the cart with one click on Add selected to cart. You decide which customer groups see the table and for which categories and products.

The table is added next to PrestaShop's own attribute selector and Add to cart button; it never replaces them. It is not shown in quick view or in product lists, not for products with a required customization field, packs or virtual products, and not without JavaScript in the browser. The module keeps no saved order lists and has no CSV import.

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_combinationtable_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_combinationtable from the shop folder.

Right after the installation the table is on for every visitor and every product with combinations, under the Add to cart button. That is the default because no customer group and no category is chosen yet. To show it only to your wholesale customers:

  1. Open Modules → Module Manager → Combinations Table → Configure.
  2. Under Customer groups, tick the group of your wholesale customers (create it first in Shop Parameters → Customer Settings → Groups if you do not have one).
  3. Optionally tick Categories or type Product IDs to limit the products, and click Save.
  4. Type a product ID in Test a product to check the result.

3. How it works

Who sees the table. The setting Customer groups decides it:

  • Nothing ticked: every visitor sees the table, also visitors without an account and guests.
  • One or more groups ticked: only visitors who belong to at least one of them. A customer can belong to several groups; all of them count, not only the default group. A visitor who is not logged in is in PrestaShop's Visitor group, a customer who ordered without an account is in the Guest group: tick these groups too if they should see the table.

Which products have the table.

  • No category ticked and no product ID typed: every product with combinations.
  • Otherwise a product has the table when its ID is listed in Product IDs or when it is in one of the ticked Categories. Either one is enough. A ticked category also covers all its subcategories, and a product counts in every category it is associated with, not only through its default category.

When the table is not shown, whatever the settings say:

  • the product has no combinations in this shop, or combinations are switched off in the shop;
  • the product has a required customization field;
  • the product is a pack or a virtual product;
  • the product is disabled, or its option "Available for order" is off;
  • the shop is in catalogue mode, or the visitor's group does not see prices (Shop Parameters → Customer Settings → Groups);
  • the visitor may not see the product at all (the customer groups of its categories);
  • Enable the table is off, or the module is disabled in the Module Manager;
  • another module hid it (developers can do this, see README.md).

Test a product under the settings answers for a product ID whether the table is shown and, if not, why (section 4).

Where the table is. By default under the Add to cart button, in the product column next to the pictures. When the page has loaded, the module's script moves the table right below the theme's add-to-cart area, so it stays in place and keeps the typed quantities when the customer picks another combination in the native selector. The setting Place of the table can put it below the product instead, across the full width of the page (more room for the columns).

What the customer sees. A heading ("Order several variants at once", or your own text), then the table:

  • Picture — the picture of the combination, or the cover of the product when the combination has none (setting Show the picture).
  • Variant — the attribute values of the combination, for example "Size: M, Color: Blue", in the visitor's language.
  • Reference — the reference of the combination (setting Show the reference). The column is left out when no combination of the product has a reference. In the narrow product column the reference is shown under the variant name instead of in its own column.
  • Price — the customer's own price for the combination, with the group price, specific prices and catalogue price rules that apply to that customer, as the product page shows it when that combination is selected. It is the price for the row's minimum quantity. The column heading carries the theme's tax label "(tax incl.)" or "(tax excl.)" when the theme shows tax labels.
  • Availability — the availability text PrestaShop itself would show for the combination (only when stock management is on in the shop): your labels for products in stock, back-ordered products and products out of stock (Shop Parameters → Product Settings, or the product's own labels), "Last items in stock" when the stock is below the threshold of the last items, "There are not enough products in stock" when some pieces are left but fewer than the minimum quantity. When you left PrestaShop's labels empty, the module writes "In stock", "Available on backorder" or "Out of stock" so no cell stays empty. With Show the quantity in stock on, a second line "Available: N" gives the number of pieces in stock, minus what the customer's cart already holds. When the customer's cart already holds the combination, the cell also says "In your cart: N".
  • Quantity — a number field. A quantity above 0 selects the combination; there is no checkbox. A sold-out combination has a greyed, disabled field.

Quantity rules. The table follows PrestaShop's own rules for the cart:

  • A combination with a minimum quantity above 1 says "Minimum: N" under its field. A smaller number is raised to the minimum when the customer leaves the field, with the message "The minimum quantity for this variant is N." When the cart already holds some pieces, only what is missing to the minimum is required.
  • When orders of out-of-stock products are denied, the field does not take more than the pieces that can still be added (stock minus what the customer's cart already holds). A larger number is lowered with the message "Only N available." When back-orders are allowed there is no such limit.
  • At most 99,999 pieces per combination.

Summary and adding to the cart. Below the table the customer sees "Variants:", "Pieces:" and "Total:" (quantity × the price shown, in your shop's currency format, with the tax label), and the button Add selected to cart. When the product has a quantity discount, a note says: "Prices are for the minimum quantity of each variant. Volume discounts are applied in the cart." The cart computes the final prices.

One click on Add selected to cart sends every chosen combination in a single request, also those typed on other pages of the table. Each combination goes into the cart through PrestaShop's own cart function, with PrestaShop's stock and minimum rules, so other modules that check the cart (quantity limits, minimum order) work as with the theme's own button. Then:

  • Combinations that can be added are added in full.
  • The others are not added and are listed with the reason: "Not enough stock: N available." (N is what can still be added), "Out of stock.", "The minimum quantity is N.", "This variant is no longer available." or "This variant could not be added to the cart."
  • Nothing is ever corrected silently: a quantity is never reduced to what is in stock. The customer sees what was refused and decides.
  • The module shows its own confirmation in the table, "Added to your cart — variants: N, pieces: N.", with a View cart link, and the list of refused combinations below it. The quantities that were added are cleared; the refused ones stay as typed.
  • The cart preview of the theme in the header (number of products and content) is refreshed. The theme's "added to cart" pop-up does not open: it can show only one product, so it would misreport an order of several variants.
  • The rows are loaded again, so availability, limits and "In your cart" follow the new cart.

Limits of one click. One click adds at most 200 combinations; a larger selection is refused with "You can add up to 200 variants at once." — add it in parts. The adding itself works for at most 15 seconds per click, or for half of the server's PHP time limit (max_execution_time) when that is shorter, but never less than 2 seconds. With a very large selection on a slow server, the combinations it did not reach within that time are not touched and are listed as "Not added yet. Click the button again to add this variant."; their quantities stay in the table and a second click adds them, without adding the others twice. The adding stops in the same way once it has used a quarter of the memory PHP had free for the request (memory_limit). On a shop in production mode this does not happen even with 200 combinations; in the debug mode of PrestaShop 1.7.8, which keeps thousands of notices in memory with every change of the cart, a large selection needs many clicks.

When no answer arrives at all (a server error, or a server that stopped the request), the table says "The shop did not answer. Check your cart before you add the variants again." and loads its rows again: "In your cart: N" then shows what was added before the error. The typed quantities stay in the fields, so check them before you click again.

Long lists. When a product has more combinations than Rows per page, the table gets a field "Filter variants" and the buttons Previous and Next with a status such as "Variants 51–100 of 300". The filter finds the combinations whose attribute values or reference contain every word typed (up to 5 words); with no match the table says "No variant matches the filter." Quantities typed on one page are kept when the customer goes to another page or filters the list. At most 1000 combinations of a product are shown in the table; a product with more gets the note "This product has more variants than the table can show. Use the options above for the others." — the native selector still offers every combination.

After another cart change. When the customer adds a product with the theme's own button, the rows are loaded again too.

On a phone. When the table is narrower than 480 pixels — on a phone, or in a narrow column — every row becomes a small card: picture, variant and price on one line, availability and quantity below. The page never scrolls sideways. This works with both the Classic and Hummingbird themes. A browser too old for this layout (before 2023) shows the full table with every column on screens wider than 576 pixels, and the cards on smaller screens.

Stock information. When orders of out-of-stock products are denied, the limit of each quantity field is the number of pieces that can still be added. That number is part of the page, also when Show the quantity in stock is off: the setting hides the number in the text, not this limit. A visitor who reads the page's code can learn the stock of every combination. PrestaShop's own product page reveals the same number for the selected combination, and its "you can only buy" message tells it too.

Themes. The table is printed by the hooks displayProductAdditionalInfo (under the Add to cart button) and displayFooterProduct (below the product). Classic (1.7.8, 8 and 9) and Hummingbird call both. The table needs JavaScript: without it the block is not shown.

Personal data, connections, e-mails. The module stores no personal data and has no database table of its own: only its settings. It sets no cookie and uses no browser storage. It makes no outgoing connection — no licence check, no statistics, nothing to addonspresta.com or any other server. It has no cron job and sends no e-mails.

Failures. If the table cannot be shown, the product page is shown without it, and one line at most per hour is written to Advanced Parameters → Logs, starting with "Combinations Table:".

4. Features and settings

Open Modules → Module Manager → Combinations Table → 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 table

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

Customer groups

The customer groups of the shop, including Visitor and Guest; tick the groups that see the table. "Nothing ticked: every visitor sees the table, also without an account. Otherwise only visitors who belong to at least one ticked group." The line Ticked: above the list repeats your choice.

Categories

The categories of the shop as a tree. "A ticked category also covers its subcategories. A product counts in a category when it is associated with it, not only through its default category." Up to 1000 ticked categories; with more, tick a parent category instead.

Product IDs

The IDs from Catalog → Products, separated by commas (spaces and new lines work too), up to 500. "No category ticked and no ID: the table is shown for every product with combinations. Otherwise for the listed products and for the products of the ticked categories." After the save the names of the listed products are shown under the field ("Listed products: …"). An ID that is not a product of this shop refuses the save with "These IDs are not products of this shop: …".

Place of the table

  • Under the Add to cart button (default) — in the product column, next to the pictures.
  • Below the product, across the full width — the whole width of the page, under the product: more room for the columns of a product with many combinations.

Show the picture

On after the installation. "The picture of the combination, or the cover of the product when the combination has none."

Show the reference

On after the installation. "The column is left out for a product whose combinations have no reference."

Show the quantity in stock

Off after the installation, because it publishes your stock levels. On: "Adds the number of pieces available under the availability text." ("Available: N"). Off: only the text (in stock, last items, out of stock). Read "Stock information" in section 3: the limit of the quantity field is in the page in both cases.

Rows per page

"From 10 to 100. A product with more combinations gets a filter and pages." Default 50.

Heading

One field per language, up to 100 characters of plain text (the characters < and > are refused). "Leave empty to show "Order several variants at once", translated into the language of the visitor."

Test a product

Under the settings: type a Product ID and click Is the table shown?. The test uses the same rules as the shop for that product and changes nothing. It works in the context of one shop; in the All shops or a group context it says "Select one of your shops in the header to test a product." Answers:

  • "The table is shown for this product.", followed by "Shown to every visitor." or "Shown only to visitors in these groups: …".
  • "Not shown: the product is disabled in this shop."
  • "Not shown: the product is not available for order."
  • "Not shown: packs and virtual products are not supported."
  • "Not shown: combinations are switched off in the shop."
  • "Not shown: the product has no combinations."
  • "Not shown: the product has a required customization field."
  • "Not shown: the product is outside the categories and product IDs chosen in Settings."
  • "Not shown: another module hid the table for this product."
  • "No product with this ID in this shop."

Extra lines when they apply: "The module is switched off in Settings: nothing is shown in the shop." and "The shop is in catalogue mode: the table is not shown."

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."). The lists of groups and categories, and the product IDs you may type, are those of the shops of the selected context that you manage.

On the storefront each shop shows its own combinations, prices, pictures and stock, with its own settings; a shop group that shares its stock is read as PrestaShop reads it. Test a product answers for the shop selected in the header. One licence covers every shop of the installation.

6. Uninstall

Module Manager → Combinations Table → Uninstall deletes every setting of the module in every shop. Reset in the Module Manager does the same and then installs the module again with the default settings. The module has no table of its own and stores no other data, so nothing else is removed. What is kept: the declaration of the module's event for developers, so that other modules attached to it keep their place.

Disable keeps the settings: while the module is disabled the product pages show no table. Switching off Enable the table in the settings has the same effect for one shop.

7. FAQ and troubleshooting

A product shows no table. Type the product's ID in Test a product: it says whether the table is shown and why not. Then check:

  1. The visitor belongs to a ticked group under Customer groups. A logged-out visitor is in the Visitor group only; to test as a wholesale customer, log in with a customer of that group.
  2. The product is in the scope: listed in Product IDs or in a ticked category.
  3. The product has combinations, no required customization field, is not a pack or a virtual product, is enabled and available for order.
  4. The shop is not in catalogue mode and the visitor's group sees prices.
  5. JavaScript is on in the browser.

If the table still does not appear, look in Advanced Parameters → Logs for an entry starting with "Combinations Table:".

The table is in the wrong place. Choose the other Place of the table. A theme that does not call the hook displayProductAdditionalInfo on the product page shows no table under the Add to cart button: choose Below the product, across the full width, or ask your theme developer to add the hook.

The message "The page has expired. Reload it and try again." appears after a click on Add selected to cart. The page was open for a long time, or the customer logged in or out in another tab, and the security token of the page no longer matches. Reload the page; the typed quantities have to be entered again.

A variant "could not be added to the cart". PrestaShop or another module refused that combination in the cart (for example a module that limits quantities). The other combinations were added. Check the product, or the rules of the module that controls the cart.

Some variants are listed as "Not added yet". The selection was very large and the server did not add everything within the time of one click (15 seconds, or less on a server with a short PHP time limit) or within the memory kept for the adding. Click Add selected to cart again: only those variants are sent. On PrestaShop 1.7.8 this happens much sooner while debug mode is on; switch it off for normal work.

The message "The shop did not answer. Check your cart before you add the variants again." appears. The server did not send a usable answer (an error, or a time limit of the server or of a proxy in front of it). Some variants may already be in the cart: the table loads its rows again, so "In your cart: N" shows what was added. Lower the quantities of those variants, or clear them, before you click Add selected to cart again; otherwise they are added a second time. If it happens often, ask your host to check the error log and the PHP time limit, or add the variants in smaller parts.

The prices in the cart differ from the table. The table shows the price for the minimum quantity of each combination. Quantity discounts are applied in the cart, by the quantity really ordered, and so are vouchers and cart rules.

The theme's pop-up does not open after the add. That is on purpose: the theme's pop-up shows one product only. The module shows its own confirmation with a View cart link, and the cart in the header is updated.

Customers see their stock levels although "Show the quantity in stock" is off. The setting hides the number in the text only. When orders of out-of-stock products are denied, the limit of the quantity field is the stock that can still be added; see "Stock information" in section 3.

I use a full-page cache module. The product page then contains prices of one customer, the cart quantities ("In your cart") and a security token of one visitor. As for any PrestaShop page, the cache must not serve product pages to logged-in customers or visitors with a cart; exclude them in the cache module's settings.

Can the table replace the attribute selector? No. The native selector and the Add to cart button always stay.

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.

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