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

Localized product attributes are not imported correctly #37

Open
clicktrend opened this issue Jun 14, 2016 · 8 comments
Open

Localized product attributes are not imported correctly #37

clicktrend opened this issue Jun 14, 2016 · 8 comments
Assignees

Comments

@clicktrend
Copy link

My csv file contains columns like

description-de_DE-ecommerce
description-en_US-ecommerce
name-de_DE-ecommerce
name-en_US-ecommerce
price-de_DE-ecommerce-EUR
price-de_DE-ecommerce-USD
price-en_US-ecommerce-EUR
price-en_US-ecommerce-USD

during import "columPrefix" which exists more than one time (description, name, price,...) the values array gets overriden with the next column in the foreach loop. So the values array takes always the last column. In my example my values array contains

description-en_US-ecommerce
name-en_US-ecommerce
price-en_US-ecommerce-USD

My magento shop setup is localized with "de_DE".

@magentix
Copy link
Collaborator

Hi,

Thanks for report. We will fix this on Monday June 20, 2016.

@magentix
Copy link
Collaborator

Hi,

This has been fixed in release 100.0.11

We need default column for store 0 but we were looking for "ecommerce-de_DE" instead of "de_DE-ecommerce".

So values for store and admin were not setted correctly.

@magentix
Copy link
Collaborator

@clicktrend

Is it ok for you?

@clicktrend
Copy link
Author

Unfortunately not! Of course you have found a bug but does not solve my problem. The localized fields (name, description and price) are blank after import.

The error is at the lines 488 and 496.

I have a fix which is not so good:

Line 488:

if(!isset($values[0][$columnPrefix])) { 
    $values[0][$columnPrefix] = $column; 
}

and line 496:

if(!isset($values[$store['store_id']][$columnPrefix])) { 
    $values[$store['store_id']][$columnPrefix] = $column; 
}

This solves my problem but it's not correct because other localized fields will be ignored.

@shavounet
Copy link
Contributor

shavounet commented Feb 13, 2017

I don't know if the test case is exactly the same or not, but here is my issue :

  • The default value for product attribute is not correctly set ; it uses the last imported locale. It does not impact the value for each store view (so frontend seems safe), but in backoffice, the default value are used in product grid.
  • What happens is that the last locale is used as a default value, due to setting $value[0][$columnPrefix] = $column at each iteration
  • One of main problem issue with that is when the last local too complex, it's hard to find one product in particular in BO ; another problem is using multiple imports with different locales & products, the default result may be inconsistent...
  • Proposed fix : in the following "stores" loop, set the default value matching the default store, and if not set just after, set $value[0](bonus point for a warning log in this case ;-) )

EDIT : it seems the problem is a little more complex... $stores does contain the ID 0, so it should have worked, but it doesn't with my current test :

  • for one product I have this (en_US is the default locale)
    image
  • in BO, the default value is 1, yet the en_US locale is 0...

@floplus
Copy link

floplus commented Mar 17, 2017

I can confirm that this issue still exists.
For each "column" in an import the last occuring column from the entities tmp table in Pimgento\Product\Model\Factory\Import->setValues

Investigating a fix...
Working in forked repo: https://github.com/floplus/PIMGento-2/tree/localization_with_channels

@magentix
Copy link
Collaborator

magentix commented Jul 4, 2017

Hi,

This issue has been corrected with MR #116

You can install last release :)

@magentix magentix self-assigned this Jul 4, 2017
@HisakaKoji
Copy link

THE FIELD "DESCRIPTION-EN_US-ECOMMERCE" DOES NOT EXIST
The issue still remains in akeneo 2.0.

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

No branches or pull requests

5 participants