Template duplication skips WooCommerce tables and never recreates them, so carts are lost on new sites
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 62/100
Direzione di ricerca
Start in inc/duplication/data.php, where Data::is_runtime_table() lists the WooCommerce tables that are skipped during template duplication, and read the docblock that says they are regenerated. Reproduce by duplicating a WooCommerce template site and checking whether the woocommerce_sessions table exists on the new blog. Done means the tables exist on the destination and a cart survives a page load, and you should first settle which of the two fixes the issue proposes.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Version: Ultimate Multisite 2.17.2, WooCommerce, subdomain multisite
What happens:
Data::is_runtime_table() (inc/duplication/data.php) skips woocommerce_sessions, woocommerce_api_keys, woocommerce_downloadable_product_permissions and woocommerce_log when duplicating a template. The docblock says these tables “are regenerated on the destination site”, but nothing creates them. On the new site those four tables don’t exist at all.
Visible symptom: WooCommerce can’t save the session. A visitor adds a product and the mini-cart count updates from the AJAX response. On the next page load, /cart and /checkout are empty, and the Store API /wc/store/v1/cart returns no items even when the session cookie is sent. It happens in incognito and on any device. Nothing is logged on the front end.
Reproduce:
Duplicate a site that has WooCommerce active, using a template.
Check the DB for {prefix}{blog_id}_woocommerce_sessions. It’s missing.
Add a product to the cart, then request /cart with the same cookie. The cart is empty.
Suggested fix: skip the rows but keep the structure. For tables flagged as runtime-only, run CREATE TABLE IF NOT EXISTS LIKE instead of skipping them entirely. That keeps the intent (no copying of sessions, logs or queues) and avoids a missing-table problem for any plugin, not just WooCommerce. The same issue probably applies to other tables on that list, such as actionscheduler_, yoast_, redirection_* and litespeed_*, which some plugins expect to exist.
Alternative: after the data copy, switch to the new site and call WC_Install::create_tables() when WooCommerce is present.
Workaround we use: an mu-plugin that does the second option on mucd_after_copy_data.
- Lingua principale
- PHP
- Stelle
- 218
- Fork
- 87
- Merge medio
- 1g 7h
- PR unite (30g)
- 85
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 Ultimate-Multisite/ultimate-multisite
-
Secondary networks: sunrise queries unregistered scoped tables, and wu_{N}_* tables are never createdForse già presa @superdav42 l’ha presa oggi. Apertabug origin:interactive status:available
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
Ultimate-Multisite/ultimate-multisite#2012 · 6 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Secondary networks never get Ultimate Multisite tables created or upgradedForse già presa @superdav42 l’ha presa 1 giorno fa. Apertabug origin:interactive status:claimed
Ultimate-Multisite/ultimate-multisite#2009 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
auto-dispatch needs-investigation origin:worker security status:available tier:standard type:bug
Difficoltà 3/5 Mezza giornata Idoneità per principianti 30/100
Ultimate-Multisite/ultimate-multisite#1938 ·
I maintainer di solito rispondono entro 1 giorno
-
auto-dispatch needs-investigation origin:worker security status:available tier:standard type:bug
Difficoltà 3/5 Mezza giornata Idoneità per principianti 30/100
Ultimate-Multisite/ultimate-multisite#1930 ·
I maintainer di solito rispondono entro 1 giorno
-
needs-maintainer-review review:approve triage-failed
Difficoltà 3/5 1-2 giorni Idoneità per principianti 48/100
Ultimate-Multisite/ultimate-multisite#1925 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Ultimate-Multisite/ultimate-multisite
Issue simili
-
sync-en
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 86/100
I maintainer di solito rispondono entro 1 giorno
-
sync-en
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 78/100
I maintainer di solito rispondono entro 2 giorni
-
Source item status is not saved when stock is deducted on shipment (stays "In Stock" at qty 0)ApertaIssue: ready for confirmation
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
-
Перевод устарел
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
LinkStackOrg/LinkStack#1014 · 2 commenti ·