Active
Project:
Commerce Feeds
Version:
7.x-1.3
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
27 Dec 2012 at 17:07 UTC
Updated:
8 Apr 2015 at 18:48 UTC
Jump to comment: Most recent
On a vanilla install, I created this importer:
$feeds_importer = new stdClass();
$feeds_importer->disabled = FALSE; /* Edit this to true to make a default feeds_importer disabled initially */
$feeds_importer->api_version = 1;
$feeds_importer->id = 'products_regular_update';
$feeds_importer->config = array(
'name' => 'Products regular update',
'description' => '',
'fetcher' => array(
'plugin_key' => 'FeedsFileFetcher',
'config' => array(
'allowed_extensions' => 'txt csv tsv xml opml',
'direct' => FALSE,
),
),
'parser' => array(
'plugin_key' => 'FeedsCSVParser',
'config' => array(
'delimiter' => ',',
'no_headers' => 0,
),
),
'processor' => array(
'plugin_key' => 'FeedsCommerceProductProcessor',
'config' => array(
'product_type' => 'product',
'author' => '1',
'tax_rate' => TRUE,
'mappings' => array(
0 => array(
'source' => 'SKU',
'target' => 'sku',
'unique' => 1,
),
1 => array(
'source' => 'Quantity',
'target' => 'commerce_stock',
'unique' => FALSE,
),
2 => array(
'source' => 'Regular Price',
'target' => 'commerce_price:amount',
'unique' => FALSE,
),
3 => array(
'source' => 'Sale Price',
'target' => 'field_sale_price:amount',
'unique' => FALSE,
),
4 => array(
'source' => 'Non-Set Price',
'target' => 'field_non_set_price:amount',
'unique' => FALSE,
),
5 => array(
'source' => 'Product ETA Note',
'target' => 'field_backorder_message',
'unique' => FALSE,
),
),
'update_existing' => '2',
'input_format' => 'plain_text',
'skip_hash_check' => 0,
),
),
'content_type' => '',
'update' => 0,
'import_period' => '0',
'expire_period' => 3600,
'import_on_create' => 1,
'process_in_background' => 0,
);
The products simply doesn't update. It only gives the message "There are no new commerce products."
If I tick "Skip hash check", it works.
Comments
Comment #1
pcambraPlease provide test data to reproduce the problem.
Comment #2
akosipax commentedDo you mean a CSV file?
My ABB1PB has stock 2. It should update to 4 but it didn't. Unless I 'skip hash check'.
Comment #3
pcambraYeah, a "before" csv and a "after" would be ideal
Comment #4
akosipax commentedI can't attach CSVs so here it is:
Before:
After:
Comment #5
pcambraComment #6
dianikol commentedI have the same issue here. Eve if i enable the "Skip hash check" option. The csv i want to import is pretty simple.
with sku set as unique and a stock
Comment #7
pcambraJust did a quick test with this, using your files with just SKU, quantity as integer field and price and works just ok, initial import and subsequent updates.
Comment #8
marktheshark commentedI'm trying to update the stock for an existing product.
I am using Commerce Feeds Multitype and a very simple CSV file:
Note that I have "update existing" enabled in the settings.
Commerce Feeds gives me the following constraint violation:
How am I supposed to indicate I want an update, not an insert?
Comment #9
marktheshark commentedThe above problem was saved by indicating the SKU as unique, however a side effect of updating an existing entity is that all images are lost when the entity is re-saved...
Comment #10
Daniel.uww commented@marktheshark
If you Importer contains mapped columns that are not present in your imported csv, then those fields will get updated with blank data.
I had the same issue today when testing product price imports using a product importer that had all my product fields.
I simply created a importer with only the fields I needed to update and the product updated without deleting any of the other product data.
Comment #11
marktheshark commentedHello Daniel, my importer did not contain a mapped field for the images. It included only the SKU and Stock values.
Fortunately, I am not getting this issue any more.
Comment #12
summit commentedHi,
I think this is valuable info to place above the mapper:
If you Importer contains mapped columns that are not present in your imported csv, then those fields will get updated with blank data.
Greetings, Martijn
Comment #13
sedam commentedSame here! How can I update a product entity without inserting anything? Thank you!
Comment #14
sedam commentedDefinitely I was doing wrong mapping fields. I marked a SKU as an unique field and after applying patch #25 https://www.drupal.org/node/1286298, produts are updating.
Comment #15
JulienF commentedHello There,
I'm re-activating this issue because I'm having a problem with custom commerce_product types.
The issue happens if I do things as follows:
1. Import products from a CSV
2. Edit a product field value on the User Interface: in my case a taxonomy term reference
3. Import back the same CSV so it resets the field to its original value
In that case, the hash (value used to compare if an entity should be updated in feedsprocessor.inc process() method from the feeds module) didn't get updated from step 2 and thus the entity doesn't get back to the csv value.
I'm not sure this is directly related to the commerce_feeds module yet since the issue I have also goes away by ticking the "Skip hash check" option I thought it might be related and thus valuable to post it here.