Allow modules to choose which product element a sync updates
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 48/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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?
- Lenguaje dominante
- PHP
- Estrellas
- 56
- Forks
- 31
- Merge medio
- 15 h 41 min
- PR fusionados (30 d)
- 23
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de craftcms/shopify
-
Blitz cache not busted after updating variant in ShopifyQuizá libre de nuevo @nfourtythree la tomó hace 285 días y no hay ningún pull request abierto. Abiertobug Plugins Plugins → Shopify repo:shopify
craftcms/shopify#199 · 5 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Webhooks not getting createdAbiertobug Plugins Plugins → Shopify repo:shopify
Dificultad 4/5 3-5 días Aptitud para principiantes 30/100
craftcms/shopify#193 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Migration failing when updating from 5.4.1 to 6.1.1 - Syntax error or access violationQuizá libre de nuevo @nfourtythree la tomó hace 359 días y no hay ningún pull request abierto. Abiertobug Plugins Plugins → Shopify repo:shopify
craftcms/shopify#190 · 5 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Way to only sync products from online store channel?Quizá libre de nuevo @nfourtythree la tomó hace 456 días y no hay ningún pull request abierto. Abiertorepo:shopify
craftcms/shopify#173 · 6 comentarios · 1 asignado ·
Los mantenedores suelen responder en 1 día
-
Plugins -> Shopify repo:shopify
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
craftcms/shopify#164 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
Todos los issues de craftcms/shopify
Issues similares
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
Automattic/static-site-importer#3462 ·
Los mantenedores suelen responder en 1 día
-
Document lexicon.default.userconfig and lexicon.default.userconfig.enforced in config.sample.phpAbiertoenhancement feature: settings good first issue
Dificultad 1/5 1-3 horas Aptitud para principiantes 88/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
nextcloud/integration_openai#480 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
roundcube/roundcubemail#10468 ·
Los mantenedores suelen responder en 1 día