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

pcambra’s picture

Category: bug » support
Priority: Major » Normal

Please provide test data to reproduce the problem.

akosipax’s picture

Do you mean a CSV file?

SKU,Quantity,Regular Price, Sale Price, Non-Set Price, Product ETA Note
ABB1PB,4,1300,,,Currently on backorder. Estimated arrival in up to 5 weeks.
ADJCD,10,1900,,,Currently on backorder. Estimated arrival in up to 5 weeks.
ADOPC,1,700,,,Not actively stocked. Expect delivery in up to 5 weeks.
AECDNG,0,1400,,,Not actively stocked. Expect delivery in up to 5 weeks.

My ABB1PB has stock 2. It should update to 4 but it didn't. Unless I 'skip hash check'.

pcambra’s picture

Status: Active » Postponed (maintainer needs more info)

Yeah, a "before" csv and a "after" would be ideal

akosipax’s picture

I can't attach CSVs so here it is:

Before:

SKU,Quantity,Regular Price, Sale Price, Non-Set Price, Product ETA Note
ABB1PB,2,1300,,,Currently on backorder. Estimated arrival in up to 5 weeks.
ADJCD,10,1900,,,Currently on backorder. Estimated arrival in up to 5 weeks.
ADOPC,1,700,,,Not actively stocked. Expect delivery in up to 5 weeks.
AECDNG,0,1400,,,Not actively stocked. Expect delivery in up to 5 weeks.

After:

SKU,Quantity,Regular Price, Sale Price, Non-Set Price, Product ETA Note
ABB1PB,4,1300,,,Currently on backorder. Estimated arrival in up to 5 weeks.
ADJCD,10,1900,,,Currently on backorder. Estimated arrival in up to 5 weeks.
ADOPC,1,700,,,Not actively stocked. Expect delivery in up to 5 weeks.
AECDNG,0,1400,,,Not actively stocked. Expect delivery in up to 5 weeks.
pcambra’s picture

Status: Postponed (maintainer needs more info) » Active
dianikol’s picture

I 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

pcambra’s picture

Status: Active » Postponed (maintainer needs more info)

Just 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.

marktheshark’s picture

Status: Postponed (maintainer needs more info) » Active

I'm trying to update the stock for an existing product.

I am using Commerce Feeds Multitype and a very simple CSV file:

SKU,Stock
100979,15

Note that I have "update existing" enabled in the settings.

Commerce Feeds gives me the following constraint violation:

Integrity constraint violation: 1062 Duplicate entry '100979' for key 'sku'

How am I supposed to indicate I want an update, not an insert?

marktheshark’s picture

The 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...

Daniel.uww’s picture

@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.

marktheshark’s picture

Hello 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.

summit’s picture

Hi,

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

sedam’s picture

Same here! How can I update a product entity without inserting anything? Thank you!

sedam’s picture

Definitely 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.

JulienF’s picture

Hello 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.