Magento Forum

   
the quest for an efficient product import script
 
paderEpiktet
Member
 
Avatar
Total Posts:  36
Joined:  2010-11-04
Germany
 

@criollo95

For your SQL-Error during the image import, we had exactly the same point recently. The reason was that for a multistore the name of the store that is displayed in the backend differed from the constant in the table core_store for the store.

MAGMI did not find a storeid in getStoreIdsForStoreScope and therefore

$targetsids=$this->getStoreIdsForStoreScope($item["store"]);

was empty and then the loop

foreach($targetsids as $tsid)
            
{
                $vinserts[]
="(?,?,?,?,".($imglabel==null?"NULL":"?").")";
                
$data=array_merge($data,array($vid,$tsid,$pos,$excluded?1:0));
                if(
$imglabel!=null)
                
{
                    $data[]
=$imglabel;
                
}
            }

was not executed and therefore vinserts[] was empty and that caused the SQL error.

@dweeves

Perhaps one could contemplate about reporting that getStoreIdsForStoreScope did not find a corresponding store to the user. Some users might find this info helpful.  wink

 
Magento Community Magento Community
Magento Community
Magento Community
 
antomad
Jr. Member
 
Total Posts:  7
Joined:  2011-06-16
 

hello @dweeves me again!

youre script runs wonderful but i cant get the configurable product to show on frontend

any suggestion??

 
Magento Community Magento Community
Magento Community
Magento Community
 
dweeves
Enthusiast
 
Total Posts:  877
Joined:  2010-06-26
FRANCE
 

reason is reindexing.
i would suggest you to check “on the fly reindexer” which will do main part of the job. (url_rewrite index & catalog_category_product index)
but not all of it.
you need to use also “Magmi magento reindexer” and check “catalog_product_price”

but alas, your setup on which i tested it cannot run php cli scripts , so magmi magento reindexer plugin cannot call magento indexer cli script :(
so you’ll have to run this last index (catalog_product_price) from magento backend.

 
Magento Community Magento Community
Magento Community
Magento Community
 
dweeves
Enthusiast
 
Total Posts:  877
Joined:  2010-06-26
FRANCE
 

@paderEpitktet

The code to put in store column is the store view code , not the store code.
this is explained in latest wiki
however, you’re right, i could check for it & send an error or warning in case of an invalid store code detected.

 
Magento Community Magento Community
Magento Community
Magento Community
 
antomad
Jr. Member
 
Total Posts:  7
Joined:  2011-06-16
 

Thanks again dweeves!

 
Magento Community Magento Community
Magento Community
Magento Community
 
paderEpiktet
Member
 
Avatar
Total Posts:  36
Joined:  2010-11-04
Germany
 

@dweeves

Thank you for your quick response and help with multiple store import. To be honest, I have not already understood your point.

Within the function getStoreIdsForStoreScope I see the following code:

$cs=$this->tablename("core_store");
$sql="SELECT csmain.store_id from $cs as csmain WHERE csmain.code IN ($qcolstr)";

In Magento 1.5.1.0 the table core_store has the following attributes:

store_id     
    code     
    website_id     
    group_id     
    name     
    sort_order     
    is_active

What we have observed is, that when we used the content of the core_store.code in the column store in the csv-import file,
than the SQL-statement that was build in addImageToGallery in version 1.0.16 of the image processor was okay.

With best regards,

Andreas

 
Magento Community Magento Community
Magento Community
Magento Community
 
dweeves
Enthusiast
 
Total Posts:  877
Joined:  2010-06-26
FRANCE
 

the value to put in store colum is this one (highlited in yellow)

Image Attachments
sv.png
 
Magento Community Magento Community
Magento Community
Magento Community
 
paderEpiktet
Member
 
Avatar
Total Posts:  36
Joined:  2010-11-04
Germany
 

@dweeves

Thank you for your clear and fast explanation!

Yes, that is the code we used (in the end).

With best regards,

Andreas

 
Magento Community Magento Community
Magento Community
Magento Community
 
paderEpiktet
Member
 
Avatar
Total Posts:  36
Joined:  2010-11-04
Germany
 

@dweeves

Thank you again for your support and your great tool.

The import of configurable products and images under 1.5.1.0 worked without problems, the project is online.

With best regards

Andreas

 
Magento Community Magento Community
Magento Community
Magento Community
 
dweeves
Enthusiast
 
Total Posts:  877
Joined:  2010-06-26
FRANCE
 

@paderEpiktet

I’m really glad Magmi helped you finalizing your project.
Hope you’ll find some time to write about it on a blog explaing how magmi helped you and how it integrated in your workflow.

 
Magento Community Magento Community
Magento Community
Magento Community
 
TSK
Jr. Member
 
Total Posts:  23
Joined:  2009-07-06
 

hi,
i have an issue with multi-store view import ..my csv is looks like this

store;attribute_set;websites;type;sku;short_description;description;cost;price;status;visibility;is_in_stock;name;tax_class_id;qty;weight;category_ids;image;small_image;thumbnail;color;size;manufacturer;special_from_date;special_to_date;special_price;internalsku;url_key;news_from_date;news_to_date;color_code
en
;Default;base;simple;sku-37013;Twitch75cm ENGLISH;Twitch75 cm.;11;24.95;Enabled;1;1;Twitch75 cm.;BTW 19%;0;1;21;/5039 a.jpg;/5039 a.jpg;/5039 a.jpg;wood;75cm;QHP;;;;5039BE75;;;;
nl;Default;base;simple;sku-37013;Twitch75cm DUTCH;Twitch75 cm.;11;24.95;Enabled;1;1;Twitch75 cm.;BTW 19%;0;1;21;/5039 a.jpg;/5039 a.jpg;/5039 a.jpg;wood;75cm;QHP;;;;5039BE75;;;;

 
Magento Community Magento Community
Magento Community
Magento Community
 
dweeves
Enthusiast
 
Total Posts:  877
Joined:  2010-06-26
FRANCE
 
TSK - 04 July 2011 02:18 AM

hi,
i have a problem with multi-store view import ..my csv is looks like this

store;attribute_set;websites;type;sku;short_description;description;cost;price;status;visibility;is_in_stock;name;tax_class_id;qty;weight;category_ids;image;small_image;thumbnail;color;size;manufacturer;special_from_date;special_to_date;special_price;internalsku;url_key;news_from_date;news_to_date;color_code
en
;Default;base;simple;sku-37013;Twitch75cm ENGLISH;Twitch75 cm.;11;24.95;Enabled;1;1;Twitch75 cm.;BTW 19%;0;1;21;/5039 a.jpg;/5039 a.jpg;/5039 a.jpg;wood;75cm;QHP;;;;5039BE75;;;;
nl;Default;base;simple;sku-37013;Twitch75cm DUTCH;Twitch75 cm.;11;24.95;Enabled;1;1;Twitch75 cm.;BTW 19%;0;1;21;/5039 a.jpg;/5039 a.jpg;/5039 a.jpg;wood;75cm;QHP;;;;5039BE75;;;;


What is wrong with the CSV ?

What is exactly your problem, “i have a problem” is a little bit short to analyze.

 
Magento Community Magento Community
Magento Community
Magento Community
 
TSK
Jr. Member
 
Total Posts:  23
Joined:  2009-07-06
 

Hi dweeves,

i have multi language store.

i have given the attribute values to specific store views like below. But this was not imported to specific languages.

how to import attribute values to different store views?

store;.........color;size;manufacturer
en
;.............red;95cm;BHP;
nl;..............wood;75cm;QHP;

 
Magento Community Magento Community
Magento Community
Magento Community
 
dweeves
Enthusiast
 
Total Posts:  877
Joined:  2010-06-26
FRANCE
 

HI TSK, As said here in the wiki:

Magmi does not create “multilanguage” values but will create one value per store.
At the end,the result will be the same on frontend, but on the admin side, you won’t see “translated” value.

The explanation is simple:
With a single value in the column, there is no way to know which “translation” of other value it could be.

I explain this some posts before.

 
Magento Community Magento Community
Magento Community
Magento Community
 
xenix
Jr. Member
 
Total Posts:  4
Joined:  2011-03-16
 

Magmi works great for me for simple products, and for configurables - i have one slight problem.

I can’t force “Not Visible Individually” in the configure mode, when i click save profile; it does not save.

After importing products - I have to go edit manually the simples so that it doesn’t show up.

How do i fix this bug, or if it’s a mistake on my part ?

Thanks for an excellent script !

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top