Split combinations into separate products
Install and use the module that splits a product with combinations into separate products, from picking a strategy through to rolling a split back.
Installation
Drop the dfproductsplitter folder into the /modules directory of your shop, then install the module from Modules and Services in the back office. You can also upload the supplied ZIP archive directly.
On installation the module creates two tables, PREFIX_df_split_job and PREFIX_df_split_item, and adds a Product Splitter tab under the Catalog menu. No class or controller override is installed, and no Composer dependency is required.
The module is compatible with PrestaShop 8.0 to 9.x and PHP 7.4 to 8.4. Table and constant names that differ between PrestaShop 8 and 9 are resolved automatically at runtime.
Opening the interface
Go to Catalog then Product Splitter. The screen has four blocks: source product search, split strategy, generation options, and the history of splits already performed.
The module always works in the context of the shop selected at the top of the back office. Prices, stock and combinations are read from that shop.
Choosing the source product
Type a name, a reference or a product id in the search field. Only products with at least one combination on the current shop appear in the results.
Once selected, the module displays the price, reference, number of combinations and number of attribute groups used. A link opens the product page in a new tab for verification.
Limiting the split to certain combinations
Tick the Limit to certain combinations box to display the full combination table, with reference, price impact and stock. Untick the ones you do not want to extract. Useful when you only want to pull one colourway out of a range and leave the rest on the original product.
The two split strategies
One product per combination
Each combination becomes a simple product with no combinations of its own. The price impact and weight impact of the combination move into the base price and base weight of the new product. The combination reference, EAN, ISBN, UPC, MPN, minimum quantity and availability date are carried over when set, otherwise the source product values are used as fallback.
This mode fits cases where each combination has its own commercial existence, for example a fragrance sold in three volumes or software sold in three licence durations.
One product per attribute group value
You pick an attribute group to extract, for example Colour. The module creates one product per value of that group, and the other groups remain combinations of the new product. A product with three colours and five sizes becomes three products with five combinations each.
If the product only has one attribute group, this mode automatically falls back to per-combination mode. A warning is shown in the preview.
How prices stay identical
In per-group mode, the module takes the lowest price impact among the combinations of each extracted value. That impact moves into the base price of the new product, then every remaining impact is recalculated by subtraction.
Example. A product at 89 euros, available in white and black, in sizes S, M and L. The white combinations carry impacts of 0, 3 and 6 euros. The White product is created at 89 euros, with impacts of 0, 3 and 6 euros on its three sizes. Had the white impacts been 3, 6 and 9 euros, the White product would be created at 92 euros with impacts of 0, 3 and 6 euros. In both cases the price paid by the customer for a given size is unchanged.
Weight follows exactly the same treatment.
Generation options
Name pattern
The name of created products is built from a pattern. Three variables are available: the source product name, the absorbed attribute values, and the source product reference. The default pattern joins the source name and the attribute values with a dash.
The name is generated independently in each shop language, with translated attribute values. Characters forbidden by PrestaShop in a product name are stripped automatically and the result is truncated to 128 characters.
Reference pattern
Four variables are available: the source product reference, the combination reference, a slug of the attribute values, and the source product id. If the pattern produces an empty string, the module falls back to the combination reference then to the source product reference.
URL rewrite
A URL rewrite is generated for each language from the product name. The module checks that it does not already exist in that language and appends a numeric suffix if needed, which prevents collisions and duplicate URLs.
Images carried over
Three modes are available. Combination images duplicates first the images linked to the processed combinations, falling back to all source product images when none are linked. All images always duplicates the full set. No image creates the products without any visual.
Duplication is physical. The original file and every thumbnail already generated are copied, whatever their format, jpg as well as webp or avif, and translated captions are copied too. The first image of each product becomes its cover.
Data to carry over
Ten checkboxes control the transfer of stock, categories, features, tags, specific prices, carriers, attachments, suppliers, customisation fields and the accessories of the source product. The first nine are enabled by default.
Additional processing
Convert absorbed attributes into features creates a feature named after the public name of the attribute group, and a value named after the attribute, then links both to the generated product. If the feature or the value already exist, they are reused. Handy to keep colour as a filter criterion after the split.
Cross-link generated products adds each created product as an accessory of all the others from the same split.
Reindex search runs the PrestaShop search indexation on the created products at the end of the run.
Status of created products
Your choice of same as the source product, all active, or all disabled. The disabled mode lets you review the pages before putting them online.
Previewing before writing
The Preview button computes the full plan without writing anything to the database. You get the number of products that will be created, then for each one its name, the number of combinations kept, and the resulting price excluding tax and weight.
The Run split button stays disabled until a preview has been run, and is disabled again as soon as you change an option.
Running the split
On launch, the module stores a job in the database with the full configuration and the list of products to generate, then processes the items in successive AJAX batches. A progress bar shows the advancement and a log lists every product created with a direct link to its page.
The Products per batch field controls how many products are created on each request. The default value is five.
On shared hosting or with products carrying many images, lower the batch size to two or three. Processing takes a little longer but will not risk hitting the PHP execution time limit.
What happens to the source product
Four behaviours are available, applied once all products have been generated.
- Keep as is. The source product stays active and unchanged. You temporarily get duplicates in the catalogue, which lets you compare before deciding.
- Disable. The source product goes offline but remains visible in the back office.
- Disable and 301-redirect to the first created product. The source product is disabled, its redirect type is set to permanent redirect to a product, and the target is the first generated product. This is the option to prefer when the original URL is indexed or receives inbound links.
- Delete permanently. The source product is deleted after generation. Only choose this once you have checked the result on a first test split.
History and rollback
Every split appears in the history with its id, the source product, the number of items processed, its status and its date. The Detail button expands the list of generated products with their individual status and a link to each page.
The Rollback button deletes every product generated by that job, then restores the active or inactive status and the original redirect of the source product exactly as they were before the split. The job moves to the rolled back status.
If you chose to delete the source product permanently, the rollback does delete the generated products but cannot restore the original one. Only use that option once the result has been validated.
What is carried over, in detail
Stock
The quantity of each combination is transferred to the matching product or combination of the generated product. The out-of-stock behaviour defined on the source product is carried over. The source product stock is not decremented.
Categories
All categories of the source product are carried over, including the default category.
Features
Features are copied. Custom values, which belong to a single product, are duplicated so that each generated product has its own.
Specific prices
Specific prices of the source product are copied. Those defined for all combinations are carried over as is. Those defined for a specific combination are only carried over if that combination belongs to the generated product, and are then applied to the whole product.
Suppliers
Supplier rows are carried over at product level. Duplicates across combinations of the same supplier are deduplicated.
Multistore
Generated products are associated with the same shops as the source product.
Edge cases and limits
- Product packs cannot be split. The module says so before any processing.
- Virtual and downloadable products are handled normally.
- Orders placed on the source product are not modified. They keep referencing the original product and combination.
- Customer reviews attached to the source product are not transferred.
- Your theme canonical URL handling may require a cache flush after a large split.
Troubleshooting
Processing stops midway
Lower the number of products per batch. Products with many images or many combinations are the most expensive. The job stays in the database but is not resumable from the interface: roll it back from the history to delete the products already created, then run it again with a smaller batch size.
Images are not copied
Check write permissions on the product image directory, img/p. The module creates the required subfolders but cannot work around a file system restriction.
Prices do not match what I expected
Check the preview, which shows the computed price excluding tax for each product. In per-group mode, the base price of a product is the source price plus the lowest impact of the extracted group for that value, which is not necessarily the impact of the default combination.
Two products share the same URL rewrite
The module checks uniqueness at creation time and appends a numeric suffix on collision. If the conflict appears afterwards, it most likely comes from another module or an import. Edit the rewrite from the SEO tab of the product page.
Uninstalling
Uninstalling removes the tab, the settings and the two module tables. Products generated by your splits are kept. If you want to remove them, roll back the relevant jobs from the history first, then uninstall the module.