Allow modules to choose which product element a sync updates
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
Direzione di ricerca
Start with Products::createOrUpdateProduct() and the EVENT_BEFORE_SYNCHRONIZE_PRODUCT handler flow described in the issue. Trace where the product element is selected and how event handlers can affect it; the issue proposes two possible extension points but does not settle which one to use. Done means a module can select the existing product to update during sync, preventing duplicates after a database refresh.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
We'd like to connect our test/acceptance Craft environments to our staging Shopify store, while production Craft stays on the production store. We run into duplicates, though. The non-production databases are frequently refreshed from production, so their products carry production GIDs. Products::createOrUpdateProduct() matches only by GID, so when the staging store syncs, every product is created a second time, next to the one that entries and relations point to.
In our case the handles are the same in both stores, so we match by handle instead. Today the only way to do that is to patch createOrUpdateProduct(). EVENT_BEFORE_SYNCHRONIZE_PRODUCT fires after the element has been picked, and the method keeps using its local variable, so a handler can't swap in a different element.
Handle matching might not belong in the plugin itself, as it's a niche case and handles are only unique within a store. A small extension point would let us move it into a module instead. For example:
- Use
$event->elementafterEVENT_BEFORE_SYNCHRONIZE_PRODUCT, so handlers can replace it. - Or add an event before the lookup that lets a handler return the element to update.
We also considered a one-off "relink by handle" command to run after each database copy. Given how often we refresh, we'd rather the sync just handles it.
Does that make sense, or is there a better way to handle this setup?
- Lingua principale
- PHP
- Stelle
- 56
- Fork
- 31
- Merge medio
- 15h 41m
- PR unite (30g)
- 23
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di craftcms/shopify
-
Blitz cache not busted after updating variant in ShopifyForse di nuovo libera @nfourtythree l’ha presa 285 giorni fa e non c’è nessuna pull request aperta. Apertabug Plugins Plugins → Shopify repo:shopify
craftcms/shopify#199 · 5 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Webhooks not getting createdApertabug Plugins Plugins → Shopify repo:shopify
Difficoltà 4/5 3-5 giorni Idoneità per principianti 30/100
craftcms/shopify#193 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Migration failing when updating from 5.4.1 to 6.1.1 - Syntax error or access violationForse di nuovo libera @nfourtythree l’ha presa 359 giorni fa e non c’è nessuna pull request aperta. Apertabug Plugins Plugins → Shopify repo:shopify
craftcms/shopify#190 · 5 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Way to only sync products from online store channel?Forse di nuovo libera @nfourtythree l’ha presa 456 giorni fa e non c’è nessuna pull request aperta. Apertarepo:shopify
craftcms/shopify#173 · 6 commenti · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Plugins -> Shopify repo:shopify
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
craftcms/shopify#164 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di craftcms/shopify
Issue simili
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
Automattic/static-site-importer#3462 ·
I maintainer di solito rispondono entro 1 giorno
-
Document lexicon.default.userconfig and lexicon.default.userconfig.enforced in config.sample.phpApertaenhancement feature: settings good first issue
Difficoltà 1/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
nextcloud/integration_openai#480 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
roundcube/roundcubemail#10468 ·
I maintainer di solito rispondono entro 1 giorno