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

the quest for an efficient product import script
 
serik
Jr. Member
 
Total Posts:  6
Joined:  2010-08-23
 

hi, dweeves,
i have a strange issue wenn i try to create categories with options on the fly
i use magmi api, here is php code for categories:

$cat_block get_between('<div id="bodyblock"''</div>'$page);
    
$cat_block explode('</a>'$cat_block);
    
$bp_cats "";
    
$i=1;
    
$imax count$cat_block );
    foreach (
$cat_block as $value{
        
if (strpos($value'<span itemprop="title">') !== false{
            $bp_cat_value 
get_between('<span itemprop="title">''</span>'$value);
            
$i++;
            if (
$bp_cat_value !== "Home"{
                
if($i == $imax{
                    $bp_cats[] 
$bp_cat_value."::1::1::1";
                
else {
                    $bp_cats[] 
$bp_cat_value."::1::0::1";
                
}
            }
        }
    }
here is output print_r($bp_cats);
Array
(
    
[0] => Schuhe Accessoires::1::0::1
    [1] 
=> Uhren::1::0::1
    [2] 
=> Damenuhren::1::1::1
)

here is output print_r($item_array);

Array
(
    
[sku] => ...
    
[name] => ...
    
[qty] => 1
    [description] 
=> ...
    
[short_description] => ...
    
[price] => 12.99
    [categories] 
=> Schuhe Accessoires::1::0::1/Uhren::1::0::1/Damenuhren::1::1::1
    [image] 
=> ...
    
[small_image] => ...
    
[thumbnail] => ...
    
[media_gallery] => ...
    
[url_key] => ...
)
here is api call:
$item_array = array (
        
"sku" => $item,
        
"name" => $bp_title,
        
"qty" => "1",
        
"description" => $bp_description,
        
"short_description" => $bp_short_description,
        
"price" => $bp_price,
        
"categories" => implode("/",$bp_cats),
        
"image" => $pics[0],
        
"small_image" => $pics[0],
        
"thumbnail" => $pics[0],
        
"media_gallery" => implode(";",$pics),
        
"url_key" => $url_key,
    );

    
$dp=Magmi_DataPumpFactory::getDataPumpInstance("productimport");
    
$dp->beginImportSession("Test","create",new TestLogger());
    
$dp->ingest($item_array);
    
$dp->endImportSession();

here is output for api call:

title:MAGMI by dweeves version:0.7.18beta2
startup
:Import Profile:Test
startup
:Import Mode:create
step
:step:0.5%
plugin;Magmi_DatapumpDS;pluginhello:DataPump Datasource-1.0.0-Dweeves-
plugin;Magmi_OptimizerPlugin;pluginhello:Magmi Optimizer-1.0.5-Dweeves-http://sourceforge.net/apps/mediawiki/magmi/index.php?title=Magmi_Optimizer
plugin;CategoryImporter;pluginhello:On the fly category creator/importer-0.2-Dweeves-http://sourceforge.net/apps/mediawiki/magmi/index.php?title=On_the_fly_category_creator/importer
plugin;ImageAttributeItemProcessor;pluginhello:Image attributes processor-1.0.24-Dweeves-http://sourceforge.net/apps/mediawiki/magmi/index.php?title=Image_attributes_processor
plugin;ItemIndexer;pluginhello:On the fly indexer-0.1.5-Dweeves-http://sourceforge.net/apps/mediawiki/magmi/index.php?title=On_the_fly_indexer
plugin;CustomOptionsItemProcessor;pluginhello:Custom Options-0.0.7-Pablo Dweeves-http://sourceforge.net/apps/mediawiki/magmi/index.php?title=Custom_Options
plugin;Magmi_DefaultAttributeItemProcessor;pluginhello:Standard Attribute Import-1.0.5-Dweeves-
plugin;Magmi_DefaultAttributeItemProcessor;startup:Standard Attribute Import v1.0.5 Newly created items will have default values for columns:store,type,status,visibility,page_layout
itime
:0.48602104187012 0.48602104187012
dbtime
:59 0.022047758102417 0.022047758102417 59
info
:Skus imported OK:1/1

as you can see only the last category is is_anchor, but not - in backend all categories are is_anchor

did i make somethings wrong or is it a bug?

Magento version - 1.7.0.2, Magmi - 0.7.18beta2

 
Magento Community Magento Community
Magento Community
Magento Community
 
sannisinas
Member
 
Total Posts:  67
Joined:  2011-01-27
 

?? no reply on this? am I wrong that this is a bug?

sannisinas - 09 November 2012 10:51 AM

Hi Dweeves,

I posted this before but is this a bug or?

Hi All,

I think I found a serious bug. I just did an upload with the following data

store, sku, special_price

for configurable products to change the special price.

The problem is that he is changing the configurable prodcucts to simple products.
So the dropdown is removed from the frontend.

It works when I add the type

store, sku, special_price, type

I am using magento 1.6.2 with the newest magmi file and plugins.

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

@serik : probably a bug in category flags management in the plugin, i’ll have a look.

@sannisinas : in 0.7.18beta2 , this faulty behaviour in update should have been fixed.

 
Magento Community Magento Community
Magento Community
Magento Community
 
gpcola
Sr. Member
 
Total Posts:  97
Joined:  2009-10-05
 

I’m trying to import products into my Magento CE 1.7 store using Magmi v0.7.18beta2.  Unfortunately I’m not getting very far due to this ‘Integrity Constraint Violation’ error:

SQLSTATE[23000]Integrity constraint violation1452 Cannot add or update a child rowa foreign key constraint fails (`gp_magento`.`cataloginventory_stock_item`, CONSTRAINT `FK_CATINV_STOCK_ITEM_PRD_ID_CAT_PRD_ENTT_ENTT_IDFOREIGN KEY (`product_id`) REFERENCES `catalog_product_entity` (`entity_id`) ON DELETE) - UPDATE `cataloginventory_stock_itemSET product_id=?,qty=?,min_qty=?,use_config_min_qty=?,is_qty_decimal=?,backorders=?,use_config_backorders=?,min_sale_qty=?,use_config_min_sale_qty=?,max_sale_qty=?,use_config_max_sale_qty=?,is_in_stock=?,low_stock_date=?,notify_stock_qty=?,use_config_notify_stock_qty=?,manage_stock=?,use_config_manage_stock=? WHERE product_id=? AND stock_id=?

Here’s an example row that causes the above error from my CSV:

"sku","ean","gr_ean","name","description","short_description","meta_keyword","meta_title","meta_description","url_key","url_path","attribute_set","tax_class_id","enable_googlecheckout","visibility","options_container","has_options","required_options","configurable_attributes","simples_skus","gift_message_available","custom_design","page_layout","qty","min_qty","use_config_min_qty","is_qty_decimal","backorders","use_config_backorders","min_sale_qty","use_config_min_sale_qty","max_sale_qty","use_config_max_sale_qty","is_in_stock","low_stock_date","notify_stock_qty","use_config_notify_stock_qty","manage_stock","use_config_manage_stock","stock_status_changed_automatically","product_name","store_id","product_type_id","type","websites","small_image_label","thumbnail_label","image_label","small_image","thumbnail","image","media_gallery","rrp","price","profit_value","profit_percentage","cost","custom_layout_update","store","status","news_from_date","news_to_date","category_ids","originalcategoryids","categories","originalcategorystr","shopzilla_category","google_base_product_type","grouped","weight","select_size","select_color","select_flavour","select_others","select_options","filter_brand","filter_lubetype","filter_colour","filter_size","filter_condomsize","filter_controller","filter_style","filter_material","filter_forwho","filter_whatisit","filter_insertable","filter_ukdresssize","filter_ukmenswaist","filter_cupsize","model","length","liquidvolumn","lubetype","washing","insertable","diameter","width","colour","flexibility","fastening","controller","forwho","whatisit","for","motion","misc","features","material","brand","power","size","style","condomsafe","harnesscompatible","oringcirc","oringdiam","waterproof","wp_posts","wp_categories","RECNO"
"BB2018"
,"5022052023092","5022052023092","Furry Hand Cuffs","Hen Night Hand Cuffs  designed for the partiers to cause maximum mischief for the Hen on her last night of freedom Whether you decide to hand cuff her to the first man you see or even each other you are bound to make it a night for her to remember Why not buy the whole fantastic range to make the Hen Night extra memorable","Hen Night Hand Cuffs designed for the partiers to cause maximum mischief for the Hen on her last night of freedom Whether you decide to hand cuff her to the first man you see or even each other you are bound to make it a night for her to remember Why not buy the whole fantastic range to make the Hen Night extra memorable","furry hand cuffs,boxer games,gifts & games,hen & stag nights","Furry Hand Cuffs Boxer Games - Free UK Delivery","Hen Night Hand Cuffs  designed for the partiers to cause maximum mischief for the Hen on her last night of freedom Whether you decide to hand cuff her to the first man you see or even each other you are bound to make it a night for her to remember Why not buy the whole fantastic range to make the Hen Night extra memorable",,,"Default","Taxable Goods","Yes","Catalog, Search","Block after Info Column","0","0",,,"Use config",," , No layout  updates","100","1","1","0","0","1","1","1","1","1","1",,"0","1","1","1","0","Furry Hand Cuffs","1","simple","simple","base","Furry Hand Cuffs","Furry Hand Cuffs","back","/bb2018.jpg","/bb2018.jpg","/bb2018.jpg",,"3.9900","3.9900","1.7100","42.0000","2.2800",,"default","Enabled","18/11/2012","18/02/2013","1,2,182,25","442",,"Hen And Stag Nights","14064","Mature > Erotic > Sex Toys",,"0.1000",,,,,,"Boxer Games",,,,,,,,"Female",,,,,,"BB2018",,,,,,,,,,,,"Female",,,,,,,"Boxer Games",,,,,,,,"No","50",,"1"

Every row in my CSV causes the same error so I’m really not sure where to go from here.  Can anyone offer advice?

I’ve attached log files from /magmi/state in case they contain relevant info.

Thanks.

Update 23/11/2012 20:04 GMT
After a lot of playing around I managed to solve this.  I had a column ‘product_id’ in my CSV which was left over from my previous import method using the Magento Dataflow API.  Once this column was removed the problem no longer occured.  Maybe this will help others out there who come to start using Magmi after Magento Dataflow.

Thanks for a terrific addition to Magento dweeves wink

File Attachments
trace.txt  (File Size: 296KB - Downloads: 79)
progress.txt  (File Size: 30KB - Downloads: 213)
 
Magento Community Magento Community
Magento Community
Magento Community
 
bobdpt
Jr. Member
 
Total Posts:  2
Joined:  2011-12-28
 

Hi There!

Very very Thanks for thi great ext !

There is anyway to auto turn ( horizontal flip ) images imported ?
someone can help? will be great to have this function inside magmi!!

Many Thanks!

creazione siti web

 
Magento Community Magento Community
Magento Community
Magento Community
 
tomharding
Member
 
Avatar
Total Posts:  63
Joined:  2011-03-24
 

Ahoy,

I’m wondering if any of you category buffs have a solution to my query:

What I’ve got is a giant store with a good couple hundred categories. The data coming in through magmi has the majority of the products automatically mapped to the category (so LCD tvs = category id 120, Projectors = category id 200 and so forth).

However what my client wants to do is categorise each product into their manufacturer category. I could achieve this with an advanced search, but it doesn’t provide layered navigation. 

I achieve the first using the standard category_ids column. I acheive the manufacturers categories using Magmi’s on the fly category creator. From what I gather though, these both don’t work in tandem. The first won’t work when the other is turned on.

So my question is this - is there a method of doing both at the same time? Can the on-the-fly importer include both category id’s and category trees? This would be mightily helpful to my cause if so smile

Thanks,
Tom

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

@tomharding:
Just use corresponding category tree name for the ones for which you use category_ids.
since category importer can affect to multiple categories at once using ;; separator.

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

0.7.18 beta3 will soon be released, but the current svn is already including the following.

Features:
- csv remote download now renames files to csv if not csv or txt (or even no extension due to applicative url)
- csv remote download now supports http cookies in download request
- csv datasource now detects and handles UTF8 with BOM !!!

Bugfixes:
- indexer not working (due to lack of chdir)
- fixed plugin parameter override in cli
- fixed custom sql utility to be more easily callable with cli & parameter override
- category importer not assigning to roots when using option “all categories in tree”
- category importer creating empty named category
- category product position could not be updated if product already in category
- remote agent extra plugin was not compatible with php 5.2

checkout & try it , i need reports.

 
Magento Community Magento Community
Magento Community
Magento Community
 
travelermeng
Member
 
Total Posts:  54
Joined:  2009-03-13
 

I’ve tried magmi, I started with 1 product, it imported successfully, but the products is not show up at frontend. I have checked the backend, the products is enabled and the visibility is catalog, search. After searching on this forum, there are people having the same problem, and they suggested refresh the index. However, I have over 1000 products, and about 50 catalogs, I have tried reindex many many times with no success, it’s alwasy showing “processing”.
Can anyone help to get the product showing up at frontend?

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

use “on the fly indexer” plugin of magmi + reindex only prices in magento (and possibly not through the UI since it would take too long ,magento has a script shell/indexer.php that can be called using php cli)

 
Magento Community Magento Community
Magento Community
Magento Community
 
travelermeng
Member
 
Total Posts:  54
Joined:  2009-03-13
 
dweeves - 05 December 2012 05:49 AM

use “on the fly indexer” plugin of magmi + reindex only prices in magento (and possibly not through the UI since it would take too long ,magento has a script shell/indexer.php that can be called using php cli)

It worked!!!! Thank you so much!!!!

 
Magento Community Magento Community
Magento Community
Magento Community
 
travelermeng
Member
 
Total Posts:  54
Joined:  2009-03-13
 

one more question, I jsut import about 1000 products, I have follow the Image attributes processor guide lines to import images, however, after importing, all the products have the same images, Why is that?? Please help

 
Magento Community Magento Community
Magento Community
Magento Community
 
Wallie85
Member
 
Total Posts:  44
Joined:  2010-10-24
 
tomharding - 12 October 2012 12:34 AM

Wallie85 - 12 October 2012 12:22 AM
Thirst of all thanks for Magmi as addon to Magento.

We have everything setup and we are using Magmi to update the stock in our shop. After running Magmi the stock is updated only the indexes are not reindexed (so in the frontend we do not see the products with stock 0 gone). In Magmi there is the common addon “Magmi Magento Reindexer v1.0.5” and we are trying to use this to reïndex the stock index. When we run Magmi it only doest not work and get the following report:



Skus imported OK:1399/9384
Magmi Magento Reindexer v1.0.5 - running indexer
Magmi Magento Reindexer v1.0.5 - Reindexing cataloginventory_stock....
Magmi Magento Reindexer v1.0.5 - X-Powered-By: PHP/5.2.17

Content-type: text/html

Warning: require_once(../engines/.php) [function.require-once]: failed to open stream: No such file or directory in /home/carnaval/public_html/magmi/web/magmi_run.php on line 12

Fatal error: require_once() [function.require]: Failed opening required ‘../engines/.php’ (include_path=’.:/usr/lib/php:/usr/local/lib/php:/home/carnaval/public_html/magmi/inc:/home/carnaval/public_html/magmi/integration/inc:/home/carnaval/public_html/magmi/engines’) in /home/carnaval/public_html/magmi/web/magmi_run.php on line 12

Magmi Magento Reindexer v1.0.5 - done in 0.26 secs


I do not know what to do to make this work.

Can someone please help?

Thanks.

I’d like to know how this works too.

I’ve done some research on it and discovered that apparently you need the php cli extension installed. Sorting this out has been pretty low on my priority list, so that’s as far as I got.

At this moment we are having a work around that you can set up using a cron job at your server / hosting. What we do is first run a cron job to perform the automatic import:

php /home/tablet/public_html/magmi/cli/magmi.cli.php (you have to set it correct for your hosting: tablet is our user name)

After this we are running a cronjob tor reindex only the index for stock:

php /home/tablet/public_html/shell/indexer.php --reindex cataloginventory_stock (again you have to set it correct for you hosting)

By running the index a minute after the first cronjob the import is going ok and stock is reindexed.

 
Magento Community Magento Community
Magento Community
Magento Community
 
Wallie85
Member
 
Total Posts:  44
Joined:  2010-10-24
 

We are now importing the stock automaticly every night, what is going great. The only thing we run into and hopefully someone has done the some is importing multiple csv files from remote locations.

So we have several suppliers that have all there own stock list at remote locations.

Can you just set multiple csv’s separated by comma or do you have to do something else?

Hope someone has the answer.

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

just cron a shell scripti with several calls to magmi cli with different import profiles (one for each provider csv) , for optimization do not check indexing for all but the last profile you’ll call.

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