Skip to content
PrestaShop · User manual

Import & Export Pro for PrestaShop

Version 0.9.2 Product page
Chapter 8

Filters and conditions

How to choose which rows are processed with pre-filters and filters, and how to change values with conditional transformations.

Three tools, three jobs

ToolStepWhat it does
Pre-filtersPre-filtersSkip a row, or import it as inactive or with zero stock, when it matches. Can look at the file or at the product already in your shop.
FiltersConditions, section Include recordsKeep only the rows that match. Rows that do not match are counted as filtered.
Conditional valuesConditions, section Conditional valuesChange a mapped value, always or only when a condition matches.

All three work in imports and exports. In an export they never change your catalogue.

Building conditions

Conditions are built the same way everywhere:

  1. Choose the field. In an import it can be a source column or a product field; category_ids matches the IDs of the product's categories.
  2. Choose the operator.
  3. Type the value in Compare with.

A group combines its conditions with All conditions (AND) or Any condition (OR). Add condition adds a line, Add group adds a nested group with its own AND / OR, and × removes a line or group. A group holds up to 64 conditions.

Operators

OperatorMatches when the field…
equals / does not equalis or is not exactly the value.
greater than, greater or equal, less than, less or equalcompares as a number.
contains / does not containincludes or does not include the text.
contains (ignore case / extra spaces) / does not contain (ignore case / spaces)the same, ignoring capitals and repeated spaces.
starts with / ends withbegins or ends with the text.
one of (|) / not one of (|)equals or does not equal any of the values separated by |, for example Nike|Adidas.
list has any (|) / list has none (|)is a list that contains, or does not contain, any of the values. Use it with category_ids, for example 12|15.
is empty / is not emptyhas no value, or has one. No Compare with value needed.
date before / date afteris a date before or after the value, YYYY-MM-DD.
within last N days / older than N daysis a date within, or older than, the number of days typed.

Pre-filters

Press Add pre-filter in the Pre-filters step. Each pre-filter has a scope, an action and a group of conditions:

SettingOptions
ScopeFile / export source values: the conditions read the original values of the file, before mapping. Existing shop product values: the conditions read the product as it is in your shop before this job first updates it. New products never match a shop condition.
ActionSkip matching records: the row is not imported. Import as inactive: the product is imported disabled. Import with zero stock: the product is imported with stock 0.

When several pre-filters match, Skip matching records wins over the others. Import as inactive and Import with zero stock override conditional values for that row. Up to 64 pre-filters per profile.

In an export, pre-filters can only use File / export source values with Skip matching records.

Examples:

  • Skip products of a brand you do not sell: scope File / export source values, action Skip matching records, condition manufacturer equals Example Brand.
  • Do not reactivate products you disabled by hand: scope Existing shop product values, action Import as inactive, condition active equals 0.

Rows or whole products

Filter rows or whole products, in the Advanced & CRON step, decides what a filter or pre-filter excludes when a product has several combination rows:

  • Only the matching row / variant: only that combination is excluded.
  • Whole product: exclude if any variant is excluded: the whole product is excluded as soon as one of its rows is.

Include records

In the Conditions step, Include records keeps only the rows matching its conditions. It works on source values, before mapping, in both directions. Choose All conditions (AND) or Any condition (OR) in Include rows matching, then add conditions or groups. With no conditions, every row is included.

Conditional values

Conditional values changes mapped output values. Press Add transformation:

  1. In Mapped output field choose the destination field to change, for example price. It must be mapped.
  2. Choose the action.
  3. Type the value in Value or [source column]. A column name in brackets uses that column's value, for example [supplier_margin].
  4. Under Apply when (empty group applies to every row): add conditions to limit the change. Leave the group empty to change every row.

For Replace text, type the text to replace in Text to find (Replace text only) and the new text in the value.

Actions

ActionValue
Set valueThe new value.
Set if emptyValue used only when the field is empty.
Multiply by, Divide by, Add, Subtract, RemainderA number.
Round to decimalsNumber of decimals, 0 to 6.
Trim whitespace, Uppercase, Lowercase, Capitalize first letter, Keep digits only, Text lengthNo value needed.
Append / PrependText added at the end or the start.
Replace textThe replacement text, with Text to find.
Substring (start,length)For example 0,50 for the first 50 characters.
Shorten with ellipsisMaximum length, 3 or more.
Strip HTML (all or allowed tags)all, or a list such as p,br,strong.

A profile can hold up to 128 transformations.

Example: to sell a brand with a 25 % margin, add Multiply by 1.25 on price, applied when manufacturer equals Example Brand. The same rules can transform export columns.

Still need help?

Open a support ticket from your account and our team will look at your store with you.