Skip to content
Extension Foundry

Attribute mapping and the naming rule

Produktpass Pro takes values that are already in WooCommerce into your passports: from attributes, meta fields and product fields. So you keep a value in one place.

Produktpass helps you with the battery passport and the battery QR code under Regulation (EU) 2023/1542. The plugin's texts, templates and notes are not legal advice. You remain responsible for your duties and for the accuracy of your data. For a binding answer on your own case, ask a lawyer.

The naming rule

An attribute whose name starts with dpp_ and ends with the key of a passport field belongs to that field: dpp_<field>. This holds for global attributes (the taxonomy is then called pa_dpp_<field>, such as pa_dpp_chemistry) and for local attributes of a product.

An example: the global attribute dpp_chemistry with the value “Li-ion” fills the battery chemistry field with li_ion after the next run. The attribute dpp_energy_kwh delivers the energy by which the plugin chooses between the battery passport and the information behind the QR code.

Map automatically

“Map automatically” on the page “Mapping” creates a rule for every attribute that follows the naming rule. Then you check the rules and add what is missing.

Your own rules

A rule (“The rule maps”) connects a field of the passport with a source:

  • “Field of the passport”: the template and the field,
  • “Source”: a global attribute (by its name, dpp_chemistry or pa_dpp_chemistry), an attribute of the product, a meta key other plugins keep, or a product field (SKU, GTIN, weight in kg, name),
  • “Transform”: none, number, date or “choice by a list of values” with one line per value in the form value = option,
  • “Number format”: the decimal separator (detect, comma, point) and a unit behind the number,
  • “Priority”: of several rules for one field the lower number wins; the next fills in where it has no value,
  • “Active”: only active rules run.

A mapped text goes into the first language of the passport's language list; the other languages keep their values, and the passport page marks the fallback there.

The queue

Every save of a product puts it into a queue; nothing more happens on save. Every 15 minutes the background work maps the queue; “Map the queue now” starts it at once. At night the plugin queues again only products whose sources changed.

When the licence has lapsed, the mapping stops; the queue stays.

Fields changed by hand

If you change a mapped field by hand in the passport editor, it keeps your value. The plugin offers new values from the source for taking over: tick them and click “Take over the ticked values”.

Hiding mapped attributes

The option “Hide mapped attributes in the product page's ‘Additional information’” is on at first. It hides the mapped attributes in the display only; the attributes and their values stay unchanged.

Support

Write to support@extensionfoundry.com. Name the versions of WordPress, WooCommerce and Produktpass (the plugin shows them under “Help”) and what you did. Send no access data. Report vulnerabilities on the page Security.

Back to the help for Produktpass for WooCommerce