I'm working on a site where I have several feeds that will update Commerce Product inventory. The issue is that I do NOT want feeds to create new products if a product isn't found. Currently my only options are "Do not update existing products" and "Update existing products." The issue is that both of these will create products. There is a patch for the feeds module that is still actively being talked-about. This patch adds another option to update existing entities only (doesn't create new ones). #1286298: Don't create new items, only update existing (see comment #7)
My first comment below will have the code necessary to handle this additional processor method.
| Comment | File | Size | Author |
|---|---|---|---|
| #1 | commerce_feeds-supports_update_only_method-1834726-1.patch | 1.23 KB | agileadam |
Comments
Comment #1
agileadamHere's the patch. It's very simple; only a few changes.
Comment #2
agileadamComment #3
pcambraI think more changes would be needed to fit #1286298: Don't create new items, only update existing, see #1835106: Make entity loading generic. but let's mark this postponed until something actually lands in feeds.
Comment #3.0
pcambraAdds comment number reference.
Comment #4
flebas commentedPatch #25 in #1286298: Don't create new items, only update existing works well for me.
Comment #5
maxplus commentedAlso used patch from https://www.drupal.org/node/1286298 (#57) and worked perfect for me.
No new products are created anymore during import, only stock is updated like I wanted.
Comment #6
mchamps commentedHi, Can this patch work with Feeds 8.x-3.x?
As it been ported? Thanks!
Comment #7
megachriz@mchamps
For D8/D9 you could try the latest code from #3116987: Don't create new items, only update existing (D8).
Comment #8
mchamps commented@MegaChriz
Done and that patch works great for D8. Thanks