HowTo: Import packaging units

Edit on GitHub

This document shows how to extend the list of the packaging unit types available by default (box, bag, palette) by importing packaging unit information and types using a CSV file.


The packaging unit type import must happen first; otherwise, you can’t import packaging units if the types are not present yet.

Import packaging unit types

The CSV file for import must have a name field populated.

To import packaging units types, in the ProductPackagingUnitDataImport/data/import/product_packaging_unit.csv file, run the following command:

console data:import product-packaging-unit-type

To import packaging unit types from your file, indicate a path to it:

console data:import product-packaging-unit-type -f path_to_file.csv

The imported packaging unit types appear in the spy_product_packaging_unit_type database table.

Import packaging units information

You can import the following product packaging unit information using a CSV file:

  • Define a packaging unit for a specific product concrete by populating the concrete_sku and packaging_unit_type_name fields. Both fields are required.
  • In the lead_product_sku field, define a lead product.
  • Define the default amount (default_amount) included in the packaged product.
  • In the is_amount_variable field, set amount restrictions: 1 if the amount can be changed and 0 if it cannot be changed.
  • In the amount_min and amount_max fields, define the minimum and maximum number of items, respectively.
  • In the amount_interval field, set the the interval for the quantity that a customer can buy.

Import packaging units information from the ProductPackagingUnitDataImport/data/import/product_packaging_unit.csv file:

console data:import product-packaging-unit

To import packaging unit data from your file, indicate a path to it:

console data:import product-packaging-unit -f path_to_file.csv

The import populates only the spy_product_packaging_unit table with the respective data.

After the import, the packaging unit information is saved to the storage in the Back Office, in Maintenance > Storage, there are Redis keys: product_packaging_unit:{redis_key_suffix_column}.