Column mapping
The Columns mapping table decides which fields a profile reads or writes, what each column is called in the file, and how values are transformed.
The Columns table
Columns mapping lists every field available for the element of the profile. Each row has these parts.
| Column | What it does |
|---|---|
| Sort order | Position of the column in an exported file. Drag the rows to reorder them. |
| Field | The OpenCart field. Some fields have a Possible values link that lists the values accepted in your shop (tax classes, stock statuses, stores, layouts, weight and length classes). |
| Column name in file | The header of this column in the file. In an import it must match the file exactly. |
| Default value | Value used when the column is empty. |
| Conditional value | Rule that changes the value. |
| Extra configuration | Options that depend on the kind of field. |
| Status | Switches the column on or off. Columns that are off are ignored. |
Above the table:
- Get columns configuration from profile: copies names and settings from another profile.
- Disable All Non-Named switches off every column whose name you did not change.
- Check/Uncheck All switches every column on or off.
Column names cannot be empty or repeated inside a profile.
Obtain Columns
Import profiles can read the column names from a sample file, so you choose them instead of typing them.
- Fill in the main configuration first (format, origin and, for XML, the XML Item node).
- If the profile is uploaded manually, upload a sample file in Columns File.
- Press Obtain Columns.
- Each Column name in file becomes a list with the columns found. Choose one, or --- Insert manually --- to type a name.
Default value
- Import: used when the column is empty or does not exist in the file.
- Export: used when the value is empty.
A text is used as it is: Cars. A column name in brackets takes the value of that column: [Manufacturer]. You can combine several columns and text.
Conditional value
A conditional value is written as (condition=result). Several conditions can follow one another, and : introduces the value used otherwise.
| Symbol | Meaning |
|---|---|
> < >= <= | Greater than, less than, greater or equal, less or equal |
== != | Equal, not equal |
* !* | Contains, does not contain |
~= | Contains, ignoring upper and lower case and extra spaces |
like | Contains, where % stands for any amount of spaces |
= | Separates the condition from the result |
: | Otherwise |
[COLUMN_NAME] | Value of another column |
Examples:
(>100=In stock)
(>=100=)
(===[Name])
(!=10=[Quantity])
(*Audi-X1=Audi)(*Peugeot-20=Peugeot:BMW)
(Quantity>=1=true:false)
([Cat. 1]~='electric cars'=Tesla)
([Cat. 1|length]>10='Large':'Small')- Line 1: a value greater than 100 becomes "In stock". Line 2: a value of 100 or more is emptied.
- Line 3: an empty value takes the value of the column "Name".
- Line 5: "Audi" if it contains "Audi-X1", "Peugeot" if it contains "Peugeot-20", "BMW" otherwise.
- Line 6: written in the column Status, gives "true" when the column "Quantity" is 1 or more.
A column in brackets accepts a transformation after a vertical bar:
[Status|Yes|No]: for columns that hold 1 or 0, gives the first text for 1 and the second for 0.[Name|upper],[Name|lower],[Name|capitalize],[Name|trim],[Name|length].[Description|substr(0,50)]: a fragment, from a start position (first character is 0) and with a length.[Description|ellipsis(20)]: cuts the text at that length and adds "...".
Extra configuration
Which options appear depends on the field.
| Option | Appears on | What it does |
|---|---|---|
| True value like: and False value like: | Yes/no fields | The texts that mean yes and no in the file. Defaults: 1 and 0. |
| ID instead of Name: | Fields that point to another element (category, manufacturer, filter...) | The file carries the ID of the element instead of its name. IDs must be numbers. |
| Name instead of ID: | Out stock status, Weight class, Length class, Tax class, Layout | The file carries the name instead of the ID. |
| Full image link: | Image fields, export | Writes the full URL of the image instead of its path. |
| Round: | Price fields | Rounds the price. |
| Only numbers | Prices, weight and measures | Keeps only the numeric part of the value. |
| Decimal separator like comma: | Decimal fields, export | Writes decimals with a comma. |
| Profit margin (%) | Price fields | Increases the price by that percentage. Numbers only. |
| Strip HTML Tags | Description | Type all to remove every HTML tag, or the tags to keep separated by commas, for example br,ul,li. |
| Max Length: | Text fields | Cuts the text to that number of characters. |
| Values splitted | Import | The symbol that separates several values held in one column. See below. |
| Product ID like: | Product id of specials, discounts, images and option values | The identifier the file uses for the product: ID, model, SKU, UPC, EAN, JAN, ISBN or MPN. |
| Delete associated images: | Delete, import | Also removes the image files of the deleted products. |
Several values in one column
When a supplier column holds several values separated by a symbol (for example Men|Accessories|Shoes in a column called Categories):
- In Column name in file write the column name,
>and the position, starting at 0:Categories>0,Categories>1,Categories>2. - In Extra configuration → Values splitted write the separator symbol.
XML column names
In XML imports, Column name in file is the path inside the item node:
| Name | Reads |
|---|---|
CODE | The tag CODE. |
CATEGORIES>CATEGORY*0 | The first CATEGORY tag inside CATEGORIES; *1 is the second. |
parameters>parameter*0@value | The attribute value of the first parameter tag. |
The symbols * and @ are only allowed in import profiles. In exports, names cannot contain spaces; a colon is accepted, as in g:product_id.
Attribute column templates
Product profiles have numbered rows for attributes. To fill them all at once, write a template in the first row of Attribute group, Attribute or Attribute value: wrap the value in template[...] and put x where the number goes.
template[attribute>x>@name]When you save, x is replaced with 0 in row 1, 1 in row 2, and so on, and the matching rows are enabled. Templates also work in Default value and Conditional value. Reopen the profile to review the result.
Columns worth knowing
- Delete (called Deleted in non-product profiles): a row with the true value (
1by default) deletes that element from the shop. - Main category: must be one of the categories assigned to the product in the other category columns.
- Products related: product models separated by
|, for exampleADTR4|ROFK8. A related product must appear earlier in the file or already exist. - Store: store IDs separated by
|, for example0|1|2. - Image columns: a local path that starts with
catalog/(data/on OpenCart 1.5), or a direct link to download.
Custom fixed-value column
Export profiles can add columns that do not exist in OpenCart. Press Add custom fixed-value column and fill in:
- Column name: header of the new column.
- Column value: a literal (
Laptop,22), a column in brackets ([Price]), a column with a calculation ([Price]*10; operators*,/,+,-and%for the remainder), or a text with several columns ([Name] - [Description]: [Price]). - Sort order: position of the column in the file, starting at 0. Each fixed column you place moves the following ones one position: to have two fixed columns in positions 2 and 6, type 2 and 7.
Still need help?
Open a support ticket from your account and our team will look at your store with you.