Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

Page 1 of 2
qty column only using the first row of data for all SKU’s
 
eleven11
Jr. Member
 
Total Posts:  6
Joined:  2010-03-21
 

I am trying to import a stock update csv using via system > import/export > import

sku,qty
skuA,44
skuB,0
skuC,24
skuD,64
skuE,8

But what ever value i have in the qty field for skuA will be the value that is assigned for all sku\’s
So in this case, ALL SKU\’s would have a qty of 44
I can open the csv in notepad, and change the file to something like

sku,qty
skuA,2
skuB,0
skuC,24
skuD,64
skuE,8

All Sku will be set to 2

All other fields update fine with this method such as price, descriptions etc.

I have to be making a simple mistake somewhere here, can anyone help?

Thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
Store_Manager
Enthusiast
 
Avatar
Total Posts:  867
Joined:  2012-07-09
 

Hi there,

Looks like that the issue is caused by the fact that the file is parsed improperly.  I can offer you alternative solution. Try to import via Store Manager for Magento software. It has built-in Import/Export Wizard which step-by-step guides you what settings you need to do for .csv file with data to be parsed properly.

There is free version for you to try it out - http://www.magentocommerce.com/magento-connect/store-manager-for-magento.html

Let me know the result. If the issue still remains, please, specify more exactly which kind of products with mentioned SKUs you are importing (I mean simple, configurable, grouped etc ) or maybe you you are importing some custom options. More details will be appreciated to get the better idea of the issue and find possible solution for you.

 
Magento Community Magento Community
Magento Community
Magento Community
 
eleven11
Jr. Member
 
Total Posts:  6
Joined:  2010-03-21
 

I still want to look for a solution before i spend on something that has been working.
The software looks great, but i dont need the other features at the moment. Maybe a future investment though.

I am uploading only the columns Sku and Qty, but qty is always set to what is in the first row

This does not happen when i try updating other options

Strangely enough, it works with the advanced import - But this is very slow compared to the new import feature.
I will be trying direct import to update stock if i cant get this working soon, but it is very convenient.

i need to update to 1.7.0.2, maybe this will help first, so i will give a try, and disable all my extensions. See if i can figure out what is going on.

If anyone else has come accross this problem, please let me know.

 
Magento Community Magento Community
Magento Community
Magento Community
 
iporty
Jr. Member
 
Total Posts:  1
Joined:  2012-07-24
 

Hi eleven11,

I\’m having the same problem and haven\’t find a solution yet. Hope someone can help us. I\’ve tried to upload the data from Dataflow Profiles -> Import Product Stock and it works, although the script is too slow and I get execution time limit error.

Found this script to speed it up, but still don\’t think it\’s the appropriate solution.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Kristi Banwart
Jr. Member
 
Avatar
Total Posts:  7
Joined:  2011-10-12
 

We are on a fresh install of 1.7.02 and are new to Magento and are trying to set-up our CSV file.  I created a configurable product in the admin as we use a lot of those and exported the file via the standard export.  We then created around a dozen products using the same set-up from the export and have a couple of issues.

The first issue is that the “qty” is like described in this thread and is always the same as the first item entered.  As we first entered our configurable product first which has the default value of “0” quantity, every item came in as “0” quantity and automatically changed status to “out-of-stock”.  We tried several times and it always comes in the same as the first entry.  Obviously the “qty” field is one that we would absolutely have to have functioning as that is mostly what we edit.

I looked everywhere for instructions on how to import images in Magento and everywhere said to place the images in the media/imports folder and then use the /imagename.jpg format in the csv file.  The first problem is that they apparently changed the file structure in the 1.7.0.2 version because that folder did not exist.  I created it and placed the images there, but to no avail.  We cannot get any images to import.

I also tried to use the “tier pricing” fields that were part of our exported csv file.  It included three different fields and when we entered these for the import file, they also did not import.

Did things get majorly changed on the 1.7.0.2 version that now the data import/export functionality is broken???  We are hitting our heads against the wall as we cannot proceed with the creation of our new site until we can import our products…

 
Magento Community Magento Community
Magento Community
Magento Community
 
xgalen
Jr. Member
 
Total Posts:  2
Joined:  2012-08-06
 

I’m having the same problem with 1.7.0.0.
My input csv file:
sku,qty,_type,_attribute_set,name,price,short_description,description,weight,status,visibility,tax_class_id
a,2,simple,Default,aa,1,"a”,"aa",2.000,1,4,0
b,5,simple,Default,bb,2,"a”,"aa",2.000,1,4,0
c,7,simple,Default,cc,3,"a”,"aa",2.000,1,4,0
d,3,simple,Default,dd,4,"a”,"aa",2.000,1,4,0
e,6,simple,Default,ee,5,"a”,"aa",2.000,1,4,0

And then all these products have qty=2 :(

Is a bug? Any solution?

Thank you in advance smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
Store_Manager
Enthusiast
 
Avatar
Total Posts:  867
Joined:  2012-07-09
 

Hello xgalen,

Thank you for your question.

My input csv file:
sku,qty,_type,_attribute_set,name,price,short_description,description,weight,status,visibility,tax_class_id
a,2,simple,Default,aa,1,"a”,"aa",2.000,1,4,0
b,5,simple,Default,bb,2,"a”,"aa",2.000,1,4,0
c,7,simple,Default,cc,3,"a”,"aa",2.000,1,4,0
d,3,simple,Default,dd,4,"a”,"aa",2.000,1,4,0
e,6,simple,Default,ee,5,"a”,"aa",2.000,1,4,0

And then all these products have qty=2 :(

The issue is related to decimal and thousand separators. Most likely in Magento admin you have dot as decimal separator instead of thousand and import cannot adjust those values on a fly.

Any solution?

I’d recommend you to try the Store Manager for Magento software mentioned above. It allows you to specify separators while import. See step 7 of import products wizard named “Base Formats and Separators “. You have to specify comma as Decimal symbol and dot as thousands separator. This way you will have qty 2000 rather than 2.

 
Magento Community Magento Community
Magento Community
Magento Community
 
xgalen
Jr. Member
 
Total Posts:  2
Joined:  2012-08-06
 

Thank you for your response Store Manager.

If you see my .csv, the \’Qty\’ column is the second value (2,5,7,3,6), which is pure integer, so the problem with the separators shouldn\’t have effect. The weight (9 column), which has the value 2.000 in all his rows works fine with many values.

My clients needs the .csv file so I can\’t use Store Manager\’s software.

 
Magento Community Magento Community
Magento Community
Magento Community
 
sucitivel
Jr. Member
 
Avatar
Total Posts:  15
Joined:  2009-07-21
Chicago, IL
 

Ah, good old magento… how thee let me down on a regular basis.  Here’s how to fix this problem, I do not know if there are any unintended consequences at this point.

In the file /app/code/core/Mage/ImportExport/Model/Import/Entity/Product.php near line 1610, above the lines:

$row['product_id'$this->_newSku[$rowData[self::COL_SKU]]['entity_id'];
$row['stock_id'1;

Add this:

$row['qty'$rowData['qty'];

For an end result of:

$row['qty'$rowData['qty'];
$row['product_id'$this->_newSku[$rowData[self::COL_SKU]]['entity_id'];
$row['stock_id'1;

You could also (as I am doing) just overload this file in your local branch with the modified code above applied to it, which is recommended.

 
Magento Community Magento Community
Magento Community
Magento Community
 
krlecarp
Jr. Member
 
Total Posts:  27
Joined:  2010-04-14
 

post deleted by author

 
Magento Community Magento Community
Magento Community
Magento Community
 
phillipmeyer
Jr. Member
 
Total Posts:  6
Joined:  2012-02-07
 

The next problem that I have (with or without the above fix) is that any product import updates product levels e.g. if I do an import to update product descriptions and leave qty blank it still updates qty (using the current stock level for the first product on the list.

Does anyone have any idea what caused this problem? I’d re-install Magento and start afresh but our version is far to customised to make that practical.

 
Magento Community Magento Community
Magento Community
Magento Community
 
grayousious
Jr. Member
 
Total Posts:  5
Joined:  2012-12-21
 

Having the exact same issue… Imported products all carry the qty of the first line.

 
Magento Community Magento Community
Magento Community
Magento Community
 
phillipmeyer
Jr. Member
 
Total Posts:  6
Joined:  2012-02-07
 
grayousious - 12 January 2013 08:32 AM

Having the exact same issue… Imported products all carry the qty of the first line.

The fix about will definitely work and is really simple to implement so give it a go but it definitely feels like a bug. I reported this as a bug yesterday.

 
Magento Community Magento Community
Magento Community
Magento Community
 
axaios
Jr. Member
 
Avatar
Total Posts:  6
Joined:  2009-06-15
Thessaloniki, Greece
 

@Store_Manager Please stop advertising your product in every Magento related topic. I admire your work but probably this a bug discussion topic. You cannot suggest to substitute a Magento bug with your product.

Back to topic know. It is a known issue. See bug report here: http://www.magentocommerce.com/bug-tracking/issue?issue=14614
So maybe wait for next version.

 
Magento Community Magento Community
Magento Community
Magento Community
 
michausi
Jr. Member
 
Total Posts:  1
Joined:  2012-08-16
 

Looks like the [’is_in_stock’] row could use the same tweak

 
Magento Community Magento Community
Magento Community
Magento Community
 
Luciano Fuza
Jr. Member
 
Avatar
Total Posts:  14
Joined:  2009-07-13
Itajaí
 

One way I found to get around the problem with stock_status was:

include this:

Mage::getSingleton('cataloginventory/stock_status')->updateStatus($row['product_id']);

after line 1633:

if ($helper->isQty($this->_newSku[$rowData[self::COL_SKU]]['type_id'])) {
   
if ($stockItem->verifyNotification()) {
      $stockItem
->setLowStockDate(Mage::app()->getLocale()
         ->
date(nullnullnullfalse)
         ->
toString(Varien_Date::DATETIME_INTERNAL_FORMAT)
      );
   
}
   $stockItem
->setStockStatusChangedAutomatically((int) !$stockItem->verifyStock());
                    
   
Mage::getSingleton('cataloginventory/stock_status')->updateStatus($row['product_id']);

else {
   $stockItem
->setQty(0);
}

don´t forget to add a tip in line 1610:

$row['qty'$rowData['qty']
$row['is_in_stock'$rowData['is_in_stock']
$row['product_id'$this->_newSku[$rowData[self::COL_SKU]]['entity_id'];
$row['stock_id'1;

It works only for products with manage_stock = 0 because the qty in cataloginventory_stock_status will be save with 0 (zero)

don´t forget to copy the file Product.php to:
app/code/local/Mage/ImportExport/Model/Import/Entity/

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top
Page 1 of 2