Mapping
On this page

This page is for version 1.0. Read the current version.

Mapping

The mapping is the table in the feed form that says, for every field the channel wants, where its value comes from. One row is one field. This page explains each column and the three ways to fill a row.

The mapping table of a Google Shopping feed

The columns

Column What it is
Field The name of the field in the channel's file: id, title, price. For a feed of type Google Shopping the names must be Google's; for Generic any name goes and becomes a column in the file.
Value The source of the value. The picker lists product attributes, computed values and Fixed value or template…; see Three kinds of source.
Dictionary A translation table applied after the value is read: see Dictionaries.
Modifiers Small changes made to the value on its way out: cut it, strip HTML, change case. See Modifiers.
Required A product with nothing in this field is left out of the feed; the grid's Health counts it, and Why? says why and what to do. A feed in which every product is left out is not published at all: see An empty feed is never published. Copying a field catalog ticks it for the fields the platform insists on. Untick it to send the product with the field empty and let the platform decide.
Order The order of the columns in the file. Rows can also be dragged by the handle at the left.

The × at the right of a row removes it. Add field adds an empty row at the bottom.

Three kinds of source

Open the Value picker on any row. It has three groups.

Attributes

A value straight off the product: sku, name, description, color, any attribute the catalogue has. A select or multiselect attribute gives its option label, not its id. parent.sku and the other parent.… entries read the configurable parent of a product, which is what item_group_id needs. url is the product's page; a variation that is Not Visible Individually has none, so its url is its parent's page with its size and colour already chosen.

Computed

Values the module works out rather than reads:

  • Product URL: the product's own page, its parent's, or the parent's with this child's options pre-selected. GET parameters can be appended, for tracking: utm_source=google&utm_content={sku}.
  • Image URL and Additional image URLs: the main image or any other media image, or the rest of the gallery, at a size the theme declares, or at its original size when no size is chosen.
  • Price with currency, Sale price with currency, Sale window: prices the way every shopping platform wants them written, 34.00 USD. The sale price is there while the product sells below its price, from a special price or a catalogue price rule; the window gives the special price's dates in ISO 8601, and only while today is between them.
  • Google product category: from the Google categories section of the feed. Category path: the product's own deepest Magento category under the root category of the feed's store view, as Women > Tops > Blouses; categories under another store's root are not the feed's.

A computed source may show an argument under the picker, such as the image size: choose one.

Fixed value or template

Choose Fixed value or template… and a text box appears. Whatever you type goes out as it is, for every product: new for condition, GB for a country. Curly braces put an attribute into the text:

{name} in {color}, size {size}

gives Joust Duffle Bag in Blue, size L. \{ gives a literal brace.

Modifiers

A modifier changes the value after it is read and before it is written. Press + on a row to pick one from the list; it appears as a chip, and several chips run left to right. A chip with an argument is written name:argument. An argument that holds a : or a |, or begins or ends with a space, goes in quotes: suffix:' | ', replace:'a:b':ab.

Modifier Does
strip_tags Removes HTML, leaving the text. A <style> or <script> block goes with what it holds, such as the styles Page Builder adds to a description. The copied description row has it.
truncate:150, truncate:150:… Cuts to a length, on a word boundary. A second argument is put at the end of a cut value, within the length. Google allows 150 characters in a title and 5,000 in a description.
trim Removes spaces from both ends.
lower, upper, ucfirst Lower case, upper case, first letter capitalised.
prefix:text, suffix:text Puts text in front of, or after, the value.
replace:from:to Replaces one piece of text with another.
default:text Uses this text when the value is empty.
number, number:3, number:2:,:. Formats as a number: two decimals unless the argument says otherwise, then the decimal point and the thousands separator, . and none unless given. Text that is not a number is left as it is.
date:Y-m-d Formats a date, PHP date() syntax. Eight digits, such as 20260808, are read as year, month, day.
currency, currency:EUR Formats as money, the way the store shows a price: $19.90, or 19,90 € in a German store view. Without an argument the currency is the store view's: the one its prices are shown in, which is the one a feed's prices are in. For Google's price fields, which want 19.90 USD, keep the Price source as it is.

A multiselect attribute gives a list of labels, and a modifier changes each of them: upper on Red, Blue gives RED, BLUE.

A name the module does not know is marked in the table and refuses the save, naming the row.

Dictionaries

A dictionary translates a store's values into a channel's, such as Navy into Blue. On a mapping row, choose it in the Dictionary column; Dictionaries says how to make one and which ones the module installs.

Copy from

Copy from fills the table in one go, from another feed or from a field catalog, and asks first when the table already has rows: Replace mine throws your rows away, Update mine keeps rows for fields you already have and adds the rest, Cancel leaves everything as it is. Nothing is saved until the feed is saved.

What the feed type expects

The feed's Type knows the platform's fields: which of them it requires, how long a text may be, which values a field accepts. That knowledge fills the table when you copy the type's catalog. After that, the type only warns: it never leaves a product out and never refuses a save. The platform has the last word on its own rules, and the module's copy of them can be older than the platform's.

Where What it says
Above the form, every time a saved feed opens A yellow message naming the fields the type requires that have no mapping row, for example No mapping rule for Price, which the feed type requires. Add the row, or leave it out knowingly.
Why? in the grid's Health column How many products went out with an empty field the type requires, a text over its length or a value the type does not list: one line per field, with the number of products.
Preview, under a row The same, for the products on screen, marked Warning.

What does leave a product out is a field marked Required that the product has nothing for, a dictionary set to exclude it, or a module your developer added: see Left out.

Checking a row

Save the feed and press Preview at the top. It shows the rows of a few products exactly as they will go out, after dictionaries and modifiers, so you see a wrong source or a missing dictionary before the file is published. See Preview a product.