Magmi Import: Not able to set product status to 'Disabled' - magmi

I am trying to set the status of a set of products to 'Disabled' using magmi import csv. Even though I don't get any error, the product status is not changed in back-end and I am able to see the product in the front-end. I do have stock of these products, so I have retained the attribute 'qty' as a positive value.
What could I be doing wrong? Please guide me - I am new to Magento and magmi.
PS: With the same csv, I am able to set status to 'Enabled', if it was previously 'Disabled' manually from admin panel.

Since you did not post a sample of your CSV file, I'm going to assuming you are using the values Enabled and Disabled in the status column.
This is incorrect, the status attribute requires either:
1 value for enabled
2 value for disabled

Related

Products are not displaying in Frontend after import in Magento

I have imported products using System - Import/Export - Import option.
I can see my products in Admin panel, but not in Frontend.
I tried Re-indexing, cache clear, cache refresh, physical cache remove.
also checked product stock status, availability etc. Everything is ok.
But they are not displaying in frontend. I marked onething, If I open product that I imported using csv, just saved without any change, it starts displaying. But I have 100s of products. So I can't use this solution.
So please help me where I am going wrong in csv. below is my csv screenshot.
You need to ensure that the products are attached to a website.
This can be done via a bulk update:
Access the product listm select all
Alter attribute
Products information -> websites
It can also be done in the csv by using a "_product_websites" field and setting it to the website name or 'base'.
I forgot which CSV columns are mandatory but I do remember that if some are missing the importer does not tell you that but instead you get the behaviour that you are describing.
The simplest way to find out what is mandatory is to:
Fix bugs in Magento ImportExport module
Create a new product in admin
Check that the new product is visible on front-end
Export the new product with Magento ImportExport exporter
Delete created product
Import the previously exported product csv
Clear cache and reindex data
Check that product is visible on front-end (it should be)
Compare your CSV with the exported one and try to figure out what is missing from it
Try to import your CSV with added/fixed columns and add data untill the product is imported so that it is visible on front-end
This requires allot of trial and error...
The missing columns in my case had always the same value so if this will be the case with your problem as well you can simply extend CSV importer and hard code those values in there instead of fixing your CSV manually.
Since your product gets saved correctly if you open it in admin and save it you can also:
Import a product
Export that product
Open that product in admin and save it
Export newly saved product
Compare exported CSV-s where they differ
Fixing Magento ImportExport bugs:
First bug is that if you import multiple products the quantity informatino from the first product is used for all the products. To fix this you have to add $row = array(); right before $row['product_id'] = $this->_newSku[$rowData[self::COL_SKU]]['entity_id']; in Mage_ImportExport_Model_Import_Entity_Product::_saveStockItem() function.
The second bug causes Magento ImportExport module to return a foreign key constraint error when importing multiple products. Error happens because magento splits products data into multiple segments and if one product is located in two segments importer will delete data that was imported for the product in first segment before importing the second segment thereby causing database corruption (see this link for detailed explanation - this is where I got the solution below).
Note that removing foreign key constraint will not fix the problem but will instead make it worse since the database will contain corrupt data.
To fix it you have to change the code in Mage_ImportExport_Model_Import_Entity_Abstract::_saveValidatedBunches() function:
After if ($startNewBunch || !$source->valid()) { add
if ($startNewBunch && count($bunchRows) > 1) {
$arrKeys = array_keys($bunchRows);
$arrNew = array();
while(($tRow = array_pop($bunchRows))) {
$tKey = array_pop($arrKeys);
$arrNew[$tKey] = $tRow;
if ($tRow['sku']) {
break;
}
}
$nextRowBackup = array_reverse($arrNew, TRUE) + $nextRowBackup;
}
Hope this helps.
I had the same problem recently and I spent some time tring to figure it out...
Looks like magento needs a status flag for every product otherwise magento will not show it in the dashboard.
Solution : add a "status" column to your CSV file and set all the statuses to "Enabled"
(yes it's not a boolean. Just use the string inside the quotes as it is :)
I was stuck with the same problem, i then visited my var/export/export_all_products file, downloaded it again and uploaded the same back through import, logged out of my account and logged-in back, all products were back. This worked as a backup for me and i could see all the products back at the back-end.
Import as you have. If they are enabled, but not showing...
then you can fix this by clicking "select all" products in the "manage products" table and then "change status" and then select "enabled." This process might take a minute.
Visit your store and you should see your frontend with products.
Some kind of bug with the status/enabled setting.
You must have next fields in CSV
sku
_attribute_set
_type
_category
description
image
name
price
short_description
status
tax_class_id
thumbnail
visibility
weight
qty
_product_websites
is_in_stock
Please note that field is_in_stock is mandatory even if qty more then 1
In magento 2 we need to reindex in index management to display the products in frontend.
We can reindex through cmd.like the given example we need to enter magento file directory after that cmd php -f bin/magento indexer:reindex to reindex .
When I first started importing products via csv although I set the product to enabled, I figured out that even though it shows in the magento back end as enabled, it actually isnt - think its to do with setting the field contents as "1" or "0" rather than "enabled" or "disabled/null".
To get around this, after a import I simply selected all the products in the back end and change status to enabled - it fixes issue.
But, I do think if I simply changed the data in the csv import it would save me this minor in-convenience.

Import Customers To Magento via csv

I'm trying to import customers into magento with a csv file, using Magento built in customer importer.
It's working OK (customers name, email and password goes into database), but the customers billing and shipping addresses are not.
Here's my csv header:
'id', '_website', 'firstname', 'lastname', 'email', 'password_hash', 'billing_firstname', 'billing_lastname', 'billing_company', 'billing_postcode', 'billing_city', 'billing_street1', 'billing_telephone', 'billing_country', 'billing_region', 'shipping_firstname', 'shipping_lastname', 'shipping_company', 'shipping_postcode', 'shipping_city', 'shipping_street1', 'shipping_telephone', 'shipping_country', 'shipping_region', 'is_subscribed', 'group_id', 'dob'
I also tried to put these tags into header, but still nothing.
'postcode', 'city', 'street1', 'telephone', 'country', 'region',
If anyone had this problem and know how to do this, please help,
Thanks in advance,
OK, I found a solution to do this:
Go to Magento admin->System->Import/Export->Dataflow profiles.
(NOT to Magento admin->System->Import/Export->Import!)
Then, select profile: Import Customers (or create if it not exists).
I set the Store value in Profile information box to 'Default store view'.
Then, upload Your csv, and run the profile.
It worked for me and goes every value into magento database correctly - shipping and billing addresses too.
Here is my CSV header:
id website firstname lastname email password_hash billing_firstname billing_lastname billing_company billing_postcode billing_city billing_street1 billing_telephone billing_country billing_region shipping_firstname shipping_lastname shipping_company shipping_postcode shipping_city shipping_street1 shipping_telephone shipping_country shipping_region is_subscribed group group_id dob
I don't know if group_id is required or not, but you must have a group column (I set 'General' value for it.)
I found it a little buggy, so don't panic if everything are set correct and You get an error message like: 'required column website not set' - or similar, I refreshed the Import Dataflow page, run the profile again, and it worked - of course You set everything correctly.
Hope it helps,
The "Group_id" is going to cause a problem. The correct header is group. ( I have seen some examples of select statements that are using "Group_id" and I believe they do not know how to escape reserved words in MYSQL.
If you put the default value of General in the Group column the import should be OK
We can have all the information regarding a customer into the csv. The fields that are not compulsary can be left blank.
Headers are as follows:
website,email,group_id,disable_auto_group_change,firstname,lastname,password_hash,prefix,middlename,suffix,taxvat,billing_prefix,billing_firstname,billing_middlename,billing_lastname,billing_suffix,billing_street_full,billing_street1,billing_street2,billing_street3,billing_street4,billing_street5,billing_street6,billing_street7,billing_street8,billing_city,billing_region,billing_country,billing_postcode,billing_telephone,billing_company,billing_fax,shipping_prefix,shipping_firstname,shipping_middlename,shipping_lastname,shipping_suffix,shipping_street_full,shipping_street1,shipping_street2,shipping_street3,shipping_street4,shipping_street5,shipping_street6,shipping_street7,shipping_street8,shipping_city,shipping_region,shipping_country,shipping_postcode,shipping_telephone,shipping_company,shipping_fax,created_in,is_subscribed,group
Hope this helps.

Magento Product import error - SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘attribute_id’ cannot be null

I am having an issue uploading a large csv of products.
It goes through the check on then after then import says: SQLSTATE[23000]: Integrity constraint violation: 1048 Column ‘attribute_id’ cannot be null
After this has done I have checked the products page and they are all there but do not seem to be in the categories, do not show in search and even if I manually enable the categories do not show.
Any ideas? Really stuck!
There is a value missing in "_media_attribute_id"
check all column and insert "88" where it is missing.
It solved my problem
Invalid attribute_id is associated with custom attributes.
You need to check that 1) all the attribute fields referenced in your csv - lets use Color just as an example - have been set up as attributes in Magento (Catalog > Attributes > Manage Attributes). Similarly, you need to make sure that any custom attributes that have been added and configured to be required are in your csv.
The attributes which Magento will be expecting will ultimately depend on the attribute_set you tell Magento to use for those products - also part of your csv. Attribute sets can be managed similarly under Catalog > Attributes > Manage Attribute Sets
You then need to make sure that all the attribute values you are attempting to import and are mentioned in the csv, actually appear as values for those attributes in Magento. For exmaple, if in Magento the available values for the attribute Color were only Red and Blue - and you were trying to import Yellow under this heading, it would throw the error you mentioned. Note these are also case sensitive. Magento will error on blue if it is expecting Blue.
Products not appearing in Search would be an unrelated issue...
In your csv, check under the heading "visibility" that you imported the value "Catalog, Search" - it might be that you have imported them as either "Catalog" or "Not visible individually" which would explain them not appearing (I assume at this point they have been uploaded as enabled or you have manually enabled them before searching!)
I had the same error. In my case, some products didn't have "_media_attribute_id" field populated.
I received this same error when I hadn't set up my attribute and attribute set prior to importing a configurable item using said non-existent attribute.
Edit: Thus, creating and configuring the attribute and attribute set from the Magento dashboard resulted in Magmi not throwing this error.
I had the same problem..Then i solved with filling '88' under '_media_attribute_id' column.

Magmi Configurable Products Importation

In Magmi v0.7.17, I can't manage to import configurable products.
Here is an example of the csv I've got (just fields related to problem here):
http://img198.imageshack.us/img198/8871/csvq.jpg
First of all, I need to put "_attribute_set" for the importation to work, otherwise I've got the error “cannot create product sku:xxx no attribute_set defined”. But in every online documentation and in the Dataflow Export this field is "attribute_set".
When I run the importation (using the Configurable Item processor v1.3.6), only the simple products are created and I've got theses errors :
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'attribute_id' cannot be null - INSERT INTO catalog_product_super_attribute(product_id,attribute_id,position) VALUES (?,?,?)
None of the attributes and attributes set exist in database, I want it to be created on the fly. But is it possible ? or do I miss some fields ?
Thanks !
Ok, it works now. After a little debugging in the plugin, I saw that the column "configurable_attributes" was empty. I move it at the beginning of the files (next to attribute_set) and it works fine. It's due to the fact that I didn't encapsulate my text with "" in csv, because Excel doesn't do it. So I modified my file with OpenOffice and let it at the end.
Suddenly attribute_set is working too.
Be sure to select "Magmi Magento Reindexer", otherwise the products won't appear in frontend.
Attributes and attribute sets have to be created in BackOffice before importation. Magmi can just create values of attribute.
What is work for me is:
1. Check "configurable_attributes"
- All attribute are listed ?
- All attribute are correctly spelled?
2. Check same for all custom attribute on header row
3. Check attribute "Use To Create Configurable Product" value is set "Yes"
This Error Means you are having error with attribute and attribute set.

Magento 1.6, allow SKU's to be used in catalog promotion rules

I'd like to set up catalog price rules discounts based on SKU.
However when I go to 'manage attributes' and try to edit SKU to 'use in Promo Rules: yes'. I get an error saying that SKU is a system reserved atrribute.
I have already changed the SKU attribute to user_defined=1 under eav_attribute table, but the message still appears.
It seems this was possible in earlier version of magento but not 1.6?
Any help is much appreciated.
I took a guess and managed to fix my own problem.
I had set SKU attribute to user_defined=1 under eav_attribute table earlier on along with every other attribute. I had assumed setting them all to '1' would make life easier in the future. However, setting SKU user_defined to 0 via phpmyadmin, actually allowed me to make the changes I wanted.

Resources