Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import product fail #246

Open
SofianeMerouane opened this issue Jan 4, 2021 · 2 comments
Open

Import product fail #246

SofianeMerouane opened this issue Jan 4, 2021 · 2 comments
Labels

Comments

@SofianeMerouane
Copy link

Hello, I'm trying to import a product, via the administration, but I have this error message

Erreur

The mandatory header-keys, "t_shirt_brand, t_shirt_collection, t_shirt_material, cap_brand, cap_collection, cap_material, dress_brand, dress_collection, dress_material, jeans_brand, jeans_collection, jeans_material, book_cover, Chaussures ahomme, Images_main, t_shirt_brand, t_shirt_collection, t_shirt_material, cap_brand, cap_collection, cap_material, dress_brand, dress_collection, dress_material, jeans_brand, jeans_collection, jeans_material, book_cover, Chaussures ahomme, Images_main", are missing in the data-set. Found header-keys are "Code, Locale, Name, Description, Short_description, Meta_description, Meta_keywords, Main_taxon, Taxons, Channels, Enabled, Price". Either change the service definition of the processor accordingly or update your import-data
I don't understand why they require attribute values?

If anyone can help me please?

@oallain
Copy link
Member

oallain commented Jan 10, 2021

Hello @SofianeMerouane ,

I think this is due to the list of columns you have in your import file. Columns are defined in ProductProcessor here :

- ['Code', 'Locale', 'Name', 'Description', 'Short_description', 'Meta_description', 'Meta_keywords', 'Main_taxon', 'Taxons', 'Channels', 'Enabled', 'Price']

You must override this service definition and this ProductProcessor class to use your specific columns.

public function process(array $data): void

I hope this will help you.

@SofianeMerouane
Copy link
Author

Hello oallain,
thank you for your answer, my import file is the plugin fixture file in tests / Behat / Resources / fixtures / products.csv,
so the fields are:
Code | Locale | Name | Description | Short_description | Meta_description | Meta_keywords | Main_taxon | Taxons | Channels | Enabled | Price.
So my file does contain the fields specified in the configuration, and bearing the error message indicates that the keys are missing.

Erreur

The mandatory header-keys, t_shirt_brand, t_shirt_collection, t_shirt_material, cap_brand, cap_collection, cap_material, dress_brand, dress_collection, dress_material, jeans_brand, jeans_collection, jeans_material, book_cover:
This is the list of attributes in my database, in fact in the class ProductProcessor.php

public function process(array $data): void
{
/**
**/

    **$this->headerKeys = \array_merge($this->headerKeys, $this->attrCode);**
  /**
  **/

    $this->productRepository->add($product);
}

I do not understand why I am deamnde to re-enter attribute values ​​in my database, in the import file
thank you in advance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants