1. What this module does
PrestaShop creates discount codes one at a time. When you need a different code for every newsletter subscriber, flyer, partner or marketplace buyer, that means hours of copying. Bulk Discount Codes creates up to 100,000 unique codes in one batch, in a few seconds, and exports them to a CSV file you can open in Excel or send to your mailing tool.
Every code is an ordinary PrestaShop discount (cart rule): your customers type it in the cart as usual, and you can still open and edit any single code in Catalog → Discounts.
Works with PrestaShop 1.7.8, 8.x and 9.x (PHP 7.2.5 or newer) and with multistore. The module works only in the Back Office: it adds nothing to the pages of your shop.
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_bulkvouchers_v1.0.0.zipfile and wait for the confirmation. - Click Configure on the module card.
3. How it works
You describe a batch once: how many codes, what they look like, what discount they give and when they work. The module then draws the codes and writes them straight into PrestaShop's discount tables in one go, instead of saving them one by one. That is why 100,000 codes take seconds rather than minutes. If anything goes wrong while saving, nothing is kept: you never get half a batch.
Codes are always in capital letters and unique in your whole shop. PrestaShop does not tell upper and lower case
apart, so a customer who types bf-7kq2-m9xt gets the code BF-7KQ2-M9XT. Before saving, the module checks every new
code against the codes that already exist.
To keep generation fast, a batch cannot have the restrictions that PrestaShop stores separately for every code: products, categories, carriers, countries, customer groups, a single customer or a gift product. For such a discount, create it by hand in Catalog → Discounts.
The module does not change PrestaShop's tables, stores nothing about your customers and does not connect to addonspresta.com or any other server.
4. Features and settings
Open Modules → Module Manager → Bulk Discount Codes → Configure. The Help box at the top links to this manual and to the module page at addonspresta.com, in the language of your Back Office. The form shows only the fields that apply to your choices.
1. Codes
- Batch name — for you only, for example "Newsletter November". It appears in the list of batches and in the description of each code in Catalog → Discounts.
- Number of codes — from 1 to 100,000.
- Code type:
- Random characters — the safest choice. Set the Random characters (7 to 32), the Characters (letters
and digits, letters only or digits only) and Dash every 3, 4 or 5 characters to make long codes easier to
read, for example
7KQ2-M9XT. - Pattern — you write the shape of the code:
#is a digit,?a letter,*a letter or a digit, anything else stays as typed.####-****-??gives codes like4825-K7XP-MW. A pattern needs at least 7 of these signs. - Numbered —
XMAS00001,XMAS00002… Set the Number of digits and the First number; numbers that another code already uses are skipped. Customers can guess numbered codes, so use them only for codes you hand out one by one, for example on printed cards. - Prefix — optional text at the start of every code, for example
BF-. Letters A–Z, digits,-and_, up to 20 characters. - Skip look-alike characters — leaves out 0, O, 1, I and L, which customers mix up when they type a code.
PrestaShop does not limit how many codes a visitor may try in the cart, so a random or pattern format must allow at least 4,294,967,296 different codes and a million for every code of the batch; otherwise the module asks you to make the codes longer. Eight random letters and digits allow up to 850,000 codes per batch, ten digits up to 10,000.
2. Discount
- Discount — Percentage, Amount or None (free shipping only).
- Percentage — from 0.01 to 100. Exclude discounted products leaves out products already on sale.
- Amount — with its Currency and Amount includes tax.
- Apply to — The order (without shipping), The cheapest product (percentage only) or One product, with its Product ID from Catalog → Products.
- Free shipping — on its own or together with the discount.
3. Conditions
- Valid from and Valid until — date and time. You can change the end date of the whole batch later.
- Uses of each code — how many orders in total can use one code (1 for single-use codes).
- Uses per customer — how many orders of one customer can use the same code.
- Minimum order amount — with its currency, and whether it includes tax and shipping. 0 means no minimum.
- Partial use — for amounts: when the order is smaller than the amount, PrestaShop gives the customer a new code for the rest.
- Cannot be combined with other codes — the customer cannot add another discount code in the same cart.
- Codes active — switch off to prepare codes now and enable them later.
- Name shown to customers — appears in the cart, the order and the invoice, for example "Newsletter -10%". Required in the default language; empty languages get the same name.
Preview and generation
Preview codes shows five sample codes and how many combinations the format allows, without saving anything. Generate codes creates the batch and opens its page with the time it took. The Enter key does not send the form, so you cannot create a batch by accident.
Batches
The list shows every batch, newest first, with the number of codes, how many were used in orders, how many are active, the discount and the end date. Search by batch name, and click Open to see a batch:
- the summary of the batch and its first 20 codes;
- Export to CSV — All codes, Unused codes or Used codes, with a semicolon (Excel in most European languages) or a comma as separator. Columns: code, name, discount, valid from, valid until, uses left, uses per customer, orders that used the code, active, cart rule ID;
- End date — changes "Valid until" of every code of the batch, for example to extend a campaign;
- Enable all and Disable all — for every code of the batch;
- Delete unused codes — deletes the codes no order has used. Codes used in an order stay in PrestaShop for the order history and are disabled. A batch with no code left disappears from the list.
Rights of employees
An employee needs the right to configure the module, and the matching right of Catalog → Discounts: Add to generate codes, Edit to enable, disable or change the end date, Delete to delete codes and View to export. Buttons the employee cannot use are hidden.
5. Multistore
Select one shop in the Back Office header to create codes that work only in that shop. With All shops selected, new codes work in every shop; only an employee who manages every shop can do that. With a shop group selected, the module asks you to choose one shop or all shops. The list shows the batches of the selected shop and, to employees who manage every shop, the batches for all shops. One licence covers every shop of the installation.
6. Uninstall
Module Manager → Bulk Discount Codes → Uninstall deletes the list of batches. The codes themselves stay in Catalog → Discounts and keep working, because they are your shop's discounts. If you no longer need them, open each batch and click Delete unused codes before uninstalling.
7. FAQ and troubleshooting
How long does a batch take? On our test shops 100,000 codes took about 5 seconds and 1,000 codes less than a second. Slow hosting takes longer; the module allows up to 5 minutes.
A customer says the code does not work. Open the batch: check the dates, that the codes are active and the number of uses. In Catalog → Discounts, search for the code to see its own settings and whether it was already used.
The voucher field is missing in the cart. PrestaShop shows it only when the shop has at least one active discount. The module switches this on when it creates codes; clear the cache in Advanced Parameters → Performance if your theme still hides the field.
The CSV file shows strange characters or everything in one column. Choose the separator your spreadsheet expects: semicolon for Excel in most European languages, comma for English Excel and Google Sheets. The file is saved as UTF-8.
Can I add product or customer group restrictions to the codes? Not in a batch: these restrictions are stored separately for every code and would make generation slow. Edit single codes in Catalog → Discounts, or create such a discount by hand.
"Another batch is being generated" Two batches of the same shop are never created at the same time, so that their codes cannot collide. Wait a moment and try again.
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 batches and codes 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.