11/10/2021 5 min read Author: Gorilla Software

Sylius — Product import

Sylius

Explanation of product import

The process of importing products involves filling out a CSV file, which enables you to add all the products to your store in one go.

Steps:

  1. The first step is to create a file with the appropriate structure needed for import. Examples of tools to do this are: Google Sheets or Excel.
  2. The next step is to find out the meaning and complete the columns in the previously created file.
  3. When your file has been filled in correctly, you can proceed to importing the file directly from the admin panel

1 — Create file with correct strucutre

Step 1: Create a File with the Correct Structure

First, create a file using tools like Google Sheets or Excel. This file must have the correct structure for import. You can create a sheet or text file in your preferred program and then add the necessary columns. The column structure should follow the template below:

  • Sylius CSV Example (can be created in Google Sheets or Excel):
Sylius CSV in Google Sheets

2 — Complete the columns in the file correctly

Next, you need to fill in the columns accurately, based on the descriptions provided:

  • Code — A unique identifier for each product. This code should follow a specific pattern, which must be agreed upon with a company representative.
  • Locale — Indicates the language of the product. Accepted values are pl_EN for Polish and en_US for English. If a product is available in multiple languages, it should be added twice—once for each language, using the same product code but with different locale attributes. Alternatively, you can create separate files for different languages while ensuring that the product codes match across files.
  • Name — The name of the product as it will appear in the store. If the product has different names based on language, be sure to adjust the locale accordingly.
  • Description — A detailed description of the product, supporting HTML tags for formatting (e.g., bold text, paragraphs, and text alignment). You can use a WYSIWYG editor to format your descriptions online editor example. Remember, if the product has different descriptions in different languages, the locale attribute must reflect this.Note: Be cautious of different dash types—MS Word sometimes replaces keyboard dashes with slightly longer ones, which may cause issues in certain systems, including databases. Always use the correct dash.
  • Short_description — A brief product description, typically without HTML tags. The length and content should be determined with the company representative. For multi-language descriptions, update the locale as needed.
  • Meta_description — A description meant for SEO (Search Engine Optimization) purposes, without HTML tags. If available in multiple languages, adjust the locale.
  • Meta_keywords — Keywords that help search engines like Google index your product. Ensure that this field is completed for each language by adjusting the locale.
  • Main_taxon — The primary product category. This should be coordinated with the company representative.
  • Taxons — Additional product categories, separated by commas, and agreed upon with the company representative.
  • Channels — Specify the sales channel for the product. If uncertain, this field can be left blank or clarified with the company representative.
  • Enabled — A toggle for activating or deactivating the product in the store. Accepted values are 1 (enabled) and 0 (disabled). For incomplete products that will be added later, set the value to 0.
  • Price — The product’s price. This field should either be left blank or filled after consulting with the company representative.

3 — Save the file and import it in the Admin panel

Once the file is filled out correctly, save it with a .CSV extension and ensure it is downloaded to your computer.

If your store lacks a built-in product import feature, ensure the necessary plugin is installed: Sylius ImportExport Plugin.

When everything is ready, go to the admin panel and locate the import interface, where you can select your CSV file and click the “Import” button. If there are any issues, an error message will appear at the top of the screen, guiding you to the necessary corrections.

Congratulations! You’ve successfully imported your products.

If everything is ok, you should see a panel like this:

Sylius | Import interface

Now you can select the file from your computer and click the import button. If there are any errors you will be informed about this in a message at the top of the screen.

4 — Common Mistakes During Import

To avoid issues when importing products, keep an eye on the following:

  • Incorrect product codes — Remember, each product must have a unique code. Duplicates can cause issues in the system.
  • Improper CSV file formatting — Ensure the file is saved as CSV and that the column separator is correctly set (e.g., commas or semicolons, depending on your system settings).
  • Incorrect values in columns — Check that fields such as locale, enabled, and price are filled in according to the guidelines.
  • Incompatible characters — Be careful with special characters, such as different types of dashes, which can cause errors when saved to the database.

5 — How to Troubleshoot Issues?

If you encounter problems during import, here are a few steps that may help:

  • Check the CSV file — Open the file in a text editor to ensure that columns are properly separated and there are no invalid characters.
  • Update the import plugin — Make sure you are using the latest version of the Sylius ImportExport Plugin.
  • Review error logs — If you see an error in the admin panel, check the system logs for more details on the issue.

6 — Additional Tips

  • Test the import — We recommend testing the import with a small number of products before importing the entire database. This will help identify any potential issues faster.
  • Create backups — Before importing new products, ensure you have a backup of your database. Importing a large number of products can make changes that are hard to undo.
  • SEO strategy — Make sure the meta_description and meta_keywords fields are optimized for search engines to improve the online visibility of your products.

7 — Frequently Asked Questions (FAQ)

What should I do if a product doesn’t appear after import?
Check that the enabled field is set to 1 and that no errors occurred during the import.

Can I update existing products via import?
Yes, products can be updated using the same CSV file, provided that you use the same product codes.