Allow modules to choose which product element a sync updates
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 48/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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?
- Ngôn ngữ chính
- PHP
- Star
- 56
- Fork
- 31
- Merge trung bình
- 15 giờ 41 phút
- Pull request đã merge (30 ngày)
- 23
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của craftcms/shopify
-
Blitz cache not busted after updating variant in ShopifyCó thể làm lại được @nfourtythree đã nhận 285 ngày trước và không có pull request nào đang mở. Đang mởbug Plugins Plugins → Shopify repo:shopify
craftcms/shopify#199 · 5 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Webhooks not getting createdĐang mởbug Plugins Plugins → Shopify repo:shopify
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
craftcms/shopify#193 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Migration failing when updating from 5.4.1 to 6.1.1 - Syntax error or access violationCó thể làm lại được @nfourtythree đã nhận 359 ngày trước và không có pull request nào đang mở. Đang mởbug Plugins Plugins → Shopify repo:shopify
craftcms/shopify#190 · 5 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Way to only sync products from online store channel?Có thể làm lại được @nfourtythree đã nhận 456 ngày trước và không có pull request nào đang mở. Đang mởrepo:shopify
craftcms/shopify#173 · 6 bình luận · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Plugins -> Shopify repo:shopify
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 45/100
craftcms/shopify#164 · 3 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của craftcms/shopify
Issue tương tự
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
Automattic/static-site-importer#3462 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Document lexicon.default.userconfig and lexicon.default.userconfig.enforced in config.sample.phpĐang mởenhancement feature: settings good first issue
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
nextcloud/integration_openai#480 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
roundcube/roundcubemail#10468 ·
Maintainer thường phản hồi trong vòng 1 ngày