<aside>
ℹ️ The following is a specification for the import/export file format in GPCP. This is intended to be an easy way to understand the intended format and behavior of the importer and exporter.
</aside>
Helpful Terms
Column Condition: A spreadsheet column defining a field name and its associated values which can conditionally effect a price.
Row Condition: A spreadsheet row defining values in a field which can conditionally effect a price.
Quantity Condition: A condition which affects price based on the quantity or count of a given field. These types of conditions use the is , is not, less than and greater than operators.
Condition Type Column: A column which specifies the type of rule. Possible values are all
and any
(all
is the default if not included).
File Format
- The first row in the spreadsheet is always a “header row”. This contains headings for the (optional) “Condition Type” column, the “Product” column, and all Condition Columns.
- There are two ways to define conditions:
- Column Condition:
- These are defined only once, within the header row. As a result, they are shared between all products.
- Each column represents one field.
- These must come after the product names but before pricing levels.
- Condition Row:
- These rows only apply to the succeeding product. If you want multiple products to have condition rows, the rows must be defined above each product.
- There are three types of columns possible:
- Condition Type: which is used to define the “type” of condition. Possible values are “all” and “any”. The default, if not included, is “all”. This column, if included, must always be at index 0.
- Product: which is used to define product names. This column must be at index 0 if the Condition Type column is not included, or index 1 if the Condition Type column is included.
- All identical products should be placed next to each other on neighboring rows. Breaking this pattern might work, but isn’t guaranteed.
- A new product is delineated by one of:
- An empty first column in one or more adjacent rows (these are parsed as row conditions).
- A row whose first column contents are different from the preceding row.
- Condition Column: which are used to define pricing level rule values. The header should be the name of a form field and the subsequent values, possible values of that field.
- Empty rows are ignored and have no meaningful effect.
Exporter
- The exporter will only ever create one row condition if, and only if, Quantity Conditions are detected for a given product. All other conditions will be added as Column Conditions.
Limitations
- A product name must currently be specified for every single row with product pricing rules.
- Product names must match exactly in order to be grouped as a single product. For example, two subsequent products named “Taco” and “Tacos” will be parsed as separate products.