CSV Product import #25

Open
maceck opened this Issue Dec 13, 2012 · 25 comments

Comments

Projects
None yet
9 participants
@maceck

maceck commented Dec 13, 2012

when we import products via csv the group NOT LOGGED IN is not set.
All other groups are set correctly, only when we import groupskatalog2 "NOT LOGGED IN"
this value is not set correctly?

@Vinai

This comment has been minimized.

Show comment Hide comment
@Vinai

Vinai Dec 13, 2012

Owner

Which method of import are you using? Dataflow? ImportExport? Third Party?
Also, which version of Magento and of the extension are you using?

My guess is that the group isn't being set because the value for NOT_LOGGED_IN is 0. Maybe the import script treats that as a non-value and skips it.

Owner

Vinai commented Dec 13, 2012

Which method of import are you using? Dataflow? ImportExport? Third Party?
Also, which version of Magento and of the extension are you using?

My guess is that the group isn't being set because the value for NOT_LOGGED_IN is 0. Maybe the import script treats that as a non-value and skips it.

@maceck

This comment has been minimized.

Show comment Hide comment
@maceck

maceck Dec 13, 2012

method is importExport, Magento 1.7 .0.2, Netzarbeiter_Groupskatalog2 0.1.6 (beta)

maceck commented Dec 13, 2012

method is importExport, Magento 1.7 .0.2, Netzarbeiter_Groupskatalog2 0.1.6 (beta)

@maceck maceck closed this Dec 13, 2012

@maceck maceck reopened this Dec 13, 2012

@Vinai

This comment has been minimized.

Show comment Hide comment
@Vinai

Vinai Dec 13, 2012

Owner

Please update GroupsCatalog2 to the latest version (0.2.4) and try again.

Owner

Vinai commented Dec 13, 2012

Please update GroupsCatalog2 to the latest version (0.2.4) and try again.

@Vinai

This comment has been minimized.

Show comment Hide comment
@Vinai

Vinai Jan 7, 2013

Owner

Any update on the issue?

Owner

Vinai commented Jan 7, 2013

Any update on the issue?

@maceck

This comment has been minimized.

Show comment Hide comment
@maceck

maceck Jan 7, 2013

the import does not work properly, so we changed the default group settings to not logged in to start with our shop.

maceck commented Jan 7, 2013

the import does not work properly, so we changed the default group settings to not logged in to start with our shop.

@Vinai

This comment has been minimized.

Show comment Hide comment
@Vinai

Vinai Jan 7, 2013

Owner

Have you updated the extension to the latest version (0.2.4)?

Owner

Vinai commented Jan 7, 2013

Have you updated the extension to the latest version (0.2.4)?

@maceck

This comment has been minimized.

Show comment Hide comment
@maceck

maceck Jan 7, 2013

yes of course, as you wrote in your last email.

maceck commented Jan 7, 2013

yes of course, as you wrote in your last email.

@Vinai

This comment has been minimized.

Show comment Hide comment
@Vinai

Vinai Jan 7, 2013

Owner

Thanks for the update, I'll have to debug why the customer group id 0 (NOT_LOGGED_IN) causes trouble during the ImportExport module processing.

Owner

Vinai commented Jan 7, 2013

Thanks for the update, I'll have to debug why the customer group id 0 (NOT_LOGGED_IN) causes trouble during the ImportExport module processing.

@stevejones20

This comment has been minimized.

Show comment Hide comment
@stevejones20

stevejones20 May 17, 2013

Just for information - I've just tried importing and having the same issue.

If my product in the csv contains these in the groupscatalog2_groups:

NOT LOGGED IN
General
Wholesale
Retailer

I end up with these selected in the product:
[ USE DEFAULT ]
General
Wholesale
Retailer

Magento Version: 1.7.0.1
GroupsCatalog2 version: 0.2.5

Thanks
Steve

Just for information - I've just tried importing and having the same issue.

If my product in the csv contains these in the groupscatalog2_groups:

NOT LOGGED IN
General
Wholesale
Retailer

I end up with these selected in the product:
[ USE DEFAULT ]
General
Wholesale
Retailer

Magento Version: 1.7.0.1
GroupsCatalog2 version: 0.2.5

Thanks
Steve

@Vinai

This comment has been minimized.

Show comment Hide comment
@Vinai

Vinai May 17, 2013

Owner

Thanks for the update! This issue is next on my free-stuff todo list. I've got to look into it, hopefully within the next couple of weeks I'll find a little time.

Owner

Vinai commented May 17, 2013

Thanks for the update! This issue is next on my free-stuff todo list. I've got to look into it, hopefully within the next couple of weeks I'll find a little time.

@Vinai

This comment has been minimized.

Show comment Hide comment
@Vinai

Vinai May 25, 2013

Owner

I haven't forgotten about this, I'm just super busy with preparation of an upcoming conference. After that is done I'll have time to look into the CSV import.

Owner

Vinai commented May 25, 2013

I haven't forgotten about this, I'm just super busy with preparation of an upcoming conference. After that is done I'll have time to look into the CSV import.

@harkanik

This comment has been minimized.

Show comment Hide comment
@harkanik

harkanik Jan 7, 2014

I have make a workaround, the import core set NOT LOGGED IN at id=-2

when validate customer groups ids at Customergroups.php in Model/Entity/Attribute/Backend

I have add a simple change of id from -2 to 0

 // validate all customer groups ids are valid
    foreach ($data as $key => $groupId) {
     if(-2 == $data[$key]  ) {$data[$key] = 0;}
        if (!in_array($groupId, $customerGroupIds)) {
             unset($data[$key]);
        }
    }

harkanik commented Jan 7, 2014

I have make a workaround, the import core set NOT LOGGED IN at id=-2

when validate customer groups ids at Customergroups.php in Model/Entity/Attribute/Backend

I have add a simple change of id from -2 to 0

 // validate all customer groups ids are valid
    foreach ($data as $key => $groupId) {
     if(-2 == $data[$key]  ) {$data[$key] = 0;}
        if (!in_array($groupId, $customerGroupIds)) {
             unset($data[$key]);
        }
    }
@Vinai

This comment has been minimized.

Show comment Hide comment
@Vinai

Vinai Jan 9, 2014

Owner

Thank you for your comment @harkanik.
Its very strange the NOT LOGGED IN group is assigned the value -2, which actually is used for the setting [ USE DEFAULT ].
Both entries, [ USE DEFAULT ] with the ID -2 and NOT LOGGED IN with the ID 0, should be present in the available options.
Which import mechanism do you use please?

Owner

Vinai commented Jan 9, 2014

Thank you for your comment @harkanik.
Its very strange the NOT LOGGED IN group is assigned the value -2, which actually is used for the setting [ USE DEFAULT ].
Both entries, [ USE DEFAULT ] with the ID -2 and NOT LOGGED IN with the ID 0, should be present in the available options.
Which import mechanism do you use please?

@Lennerd320i

This comment has been minimized.

Show comment Hide comment
@Lennerd320i

Lennerd320i Feb 12, 2014

@Vinai If I try to upload via the Import/Export module, the NOT LOGGED IN group is assigned with the -2 value.
Along with this I do have an additional question. I'm using a Multi Store setup (one in Dutch and one in French) who share products. So the description changes. If I upload via a CSV file (import/export module), having groups assigned to the base entity (NOT LOGGED IN, General, Retailer) and leave the groups blank for the other store view, the system should take over the options from the Original entity (like it does perfectly for the images etc), but yet the Groupscatalog2_groups field being empty, it is being uploaded with the value 0 (since the change proposed by harkanik) or -2 (without harkanik's change).

@Vinai If I try to upload via the Import/Export module, the NOT LOGGED IN group is assigned with the -2 value.
Along with this I do have an additional question. I'm using a Multi Store setup (one in Dutch and one in French) who share products. So the description changes. If I upload via a CSV file (import/export module), having groups assigned to the base entity (NOT LOGGED IN, General, Retailer) and leave the groups blank for the other store view, the system should take over the options from the Original entity (like it does perfectly for the images etc), but yet the Groupscatalog2_groups field being empty, it is being uploaded with the value 0 (since the change proposed by harkanik) or -2 (without harkanik's change).

@Vinai

This comment has been minimized.

Show comment Hide comment
@Vinai

Vinai Feb 12, 2014

Owner

Thanks for the update @Lennerd320i - I really have to takle this one soon!

Owner

Vinai commented Feb 12, 2014

Thanks for the update @Lennerd320i - I really have to takle this one soon!

@henleyt

This comment has been minimized.

Show comment Hide comment
@henleyt

henleyt Apr 23, 2014

I finnally had csv import working. Along with the @harkanik workaround, I had to work around the why of another problem. In the CSV file, line 1 being the one with column tags "sku,_store,groupscatalog2_groups" don't put anything on line 101, 201, 301, 401 and so on. if you have a product that overlap those lines in the csv, insert lines with only ",," from the end of the last product description until the next starting one at line 102, 202, 302 and so on.

This was an issue on the 0.2.8 vers. as well as the last master commit 0.3.5

henleyt commented Apr 23, 2014

I finnally had csv import working. Along with the @harkanik workaround, I had to work around the why of another problem. In the CSV file, line 1 being the one with column tags "sku,_store,groupscatalog2_groups" don't put anything on line 101, 201, 301, 401 and so on. if you have a product that overlap those lines in the csv, insert lines with only ",," from the end of the last product description until the next starting one at line 102, 202, 302 and so on.

This was an issue on the 0.2.8 vers. as well as the last master commit 0.3.5

@Vinai

This comment has been minimized.

Show comment Hide comment
@Vinai

Vinai Apr 24, 2014

Owner

Thanks for the info @henleyt . That bug you describe is related to the way the core code processes the import in bunches. It happens independently of my extension.

Owner

Vinai commented Apr 24, 2014

Thanks for the info @henleyt . That bug you describe is related to the way the core code processes the import in bunches. It happens independently of my extension.

@henleyt

This comment has been minimized.

Show comment Hide comment
@henleyt

henleyt Apr 24, 2014

This seemed to me so because I haven't witnessed the same behavior with the import of the main catalog CSV which contains every other product info including group pricing. So it may be an issue with 3 colums csv, or more than 10 rows informations per sku. I understand it's probably core related. May be valuable to your customers still. Thanks for your work!

henleyt commented Apr 24, 2014

This seemed to me so because I haven't witnessed the same behavior with the import of the main catalog CSV which contains every other product info including group pricing. So it may be an issue with 3 colums csv, or more than 10 rows informations per sku. I understand it's probably core related. May be valuable to your customers still. Thanks for your work!

@Vinai

This comment has been minimized.

Show comment Hide comment
@Vinai

Vinai Sep 2, 2014

Owner

Did you reindex the groupscatalog indexes after installation?
I don't know Magmi, do they emit the regular product save events? And the
indexer triggers?
Which version of Magento and the extension are you using?

Owner

Vinai commented Sep 2, 2014

Did you reindex the groupscatalog indexes after installation?
I don't know Magmi, do they emit the regular product save events? And the
indexer triggers?
Which version of Magento and the extension are you using?

@ecin1resp1

This comment has been minimized.

Show comment Hide comment
@ecin1resp1

ecin1resp1 Sep 2, 2014

Vinai - I did not reindex after each update, which appears to be required. I deleted my previous comments on this issue after figuring that out. I'm surprised you hadn't heard of Magmi, seems to be pretty popular among people doing mass product updates/inserts. FWIW it appears to be compatible with your plugin as it is currently working on those products.

Vinai - I did not reindex after each update, which appears to be required. I deleted my previous comments on this issue after figuring that out. I'm surprised you hadn't heard of Magmi, seems to be pretty popular among people doing mass product updates/inserts. FWIW it appears to be compatible with your plugin as it is currently working on those products.

@Vinai

This comment has been minimized.

Show comment Hide comment
@Vinai

Vinai Sep 2, 2014

Owner

I've heard of MAGMI, I just never worked on a project using it.
After an initial reindex after installation, it is not required to reindex if the products where created through the Magento admin interface. Since it seems you will have to reindex after each update via MAGMI, that means they don't trigger the indexer events.
Is this issue resolved for you now? Or is there still something open?

Owner

Vinai commented Sep 2, 2014

I've heard of MAGMI, I just never worked on a project using it.
After an initial reindex after installation, it is not required to reindex if the products where created through the Magento admin interface. Since it seems you will have to reindex after each update via MAGMI, that means they don't trigger the indexer events.
Is this issue resolved for you now? Or is there still something open?

@ecin1resp1

This comment has been minimized.

Show comment Hide comment
@ecin1resp1

ecin1resp1 Sep 2, 2014

MAGMI does have a plugin which lets you reindex, so I will try that and see if it works.
Currently, any time I make a change in the extension settings a re-index was required, but I can confirm that is needed for even non-MAGMI products.. So far the extension seems to be working for me, but I will keep you updated if there are any cases like this in the future.

Thanks for your quick response, it is much appreciated.

MAGMI does have a plugin which lets you reindex, so I will try that and see if it works.
Currently, any time I make a change in the extension settings a re-index was required, but I can confirm that is needed for even non-MAGMI products.. So far the extension seems to be working for me, but I will keep you updated if there are any cases like this in the future.

Thanks for your quick response, it is much appreciated.

@ConnDublin

This comment has been minimized.

Show comment Hide comment
@ConnDublin

ConnDublin Jan 8, 2015

I have an issue with standard ImportExport function in Magento 1.7 .0.2, Netzarbeiter_GroupsCatalog2 v0.3.5. I am using Import CSV to update the product name(s) of stock items which already exist and have been assigned values in the "Show to Groups" selection area. When I use a really simple CSV import with just sku, name the name is correctly updated, but the value in "Show to Groups" is reset to [Use Default]. After each import, I re-index ALL files and flush the cache.

I can overcome this bug by including the field groupscatalog2_groups and the categories each product had already been assigned in the import CSV.

What I would expect is that if groupscatalog2_groups (or any) field is left out of the imported CSV file, that property of the sku is not changed. Put positively, if an import CSV includes the sku (required) and another field, ONLY that field should be impacted by the import. At the moment, any such import resets the "Show to Groups" setting.

I have an issue with standard ImportExport function in Magento 1.7 .0.2, Netzarbeiter_GroupsCatalog2 v0.3.5. I am using Import CSV to update the product name(s) of stock items which already exist and have been assigned values in the "Show to Groups" selection area. When I use a really simple CSV import with just sku, name the name is correctly updated, but the value in "Show to Groups" is reset to [Use Default]. After each import, I re-index ALL files and flush the cache.

I can overcome this bug by including the field groupscatalog2_groups and the categories each product had already been assigned in the import CSV.

What I would expect is that if groupscatalog2_groups (or any) field is left out of the imported CSV file, that property of the sku is not changed. Put positively, if an import CSV includes the sku (required) and another field, ONLY that field should be impacted by the import. At the moment, any such import resets the "Show to Groups" setting.

@Vinai

This comment has been minimized.

Show comment Hide comment
@Vinai

Vinai Jan 8, 2015

Owner

Thanks for your report and the really good description of the issue.
I'm currently quite busy, but hope to be able to change the behavior accordingly during one of the next few months.

Owner

Vinai commented Jan 8, 2015

Thanks for your report and the really good description of the issue.
I'm currently quite busy, but hope to be able to change the behavior accordingly during one of the next few months.

@VinceTheDude

This comment has been minimized.

Show comment Hide comment
@VinceTheDude

VinceTheDude May 4, 2016

Relying to the initial issue of this thread that the customer group NOT LOGGED IN (ID=0) ist turned into USE_DEFAULT (-2) is because you're checking in Netzarbeiter_GroupsCatalog2_Model_Entity_Attribute_Backend_Customergroups line 43 if $data is set. if you have only the NOT LOGGED IN group set data is interpreted as false (0) and therefore it is overwritten with -2.

Overriding this model and checking for explicit false helped me to fix this issue.

Relying to the initial issue of this thread that the customer group NOT LOGGED IN (ID=0) ist turned into USE_DEFAULT (-2) is because you're checking in Netzarbeiter_GroupsCatalog2_Model_Entity_Attribute_Backend_Customergroups line 43 if $data is set. if you have only the NOT LOGGED IN group set data is interpreted as false (0) and therefore it is overwritten with -2.

Overriding this model and checking for explicit false helped me to fix this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment