# 3DL Central Checkout for WooCommerce

Free central cart and checkout for WooCommerce Multisite.

## Purpose

FREE is the minimal, working central-cart edition of 3DL Central Checkout. It demonstrates the core architecture while keeping the production synchronization features in PRO.

## How FREE works

- **Main store:** owns the real WooCommerce cart, checkout and final order.
- **Source store:** sends a signed product transfer to the Main store after add-to-cart.
- **Remote line item:** represents the Source product in the Main-store cart without publishing a duplicate public product in the Main catalog.
- **Products supported:** simple products, variable products, selected variations and requested quantities.
- **Checkout safety:** before checkout, the Main store asks the Source store to verify availability, purchasability, price, currency, units and stock quantity.
- **Source-store cart UI:** Source stores may show a read-only Main-cart count when available. Their cart and checkout links lead to the Main store; FREE does not create a second editable cart.

The transfer is protected by an HMAC-SHA256 shared secret and the Main store's explicit trusted-Source URL allow-list.

## FREE/PRO boundary

FREE intentionally does not provide:

- Source stock reservation, deduction or restocking
- Source-side order records
- Refund or order-status synchronization
- Live editable cross-store cart mirroring
- Event logs, CSV exports, repair tools or advanced diagnostics

Those production capabilities remain in 3DL Central Checkout PRO.

## Setup summary

1. Install and activate the same plugin on the Main store and every Source store in one WordPress Multisite network.
2. Set one site to **Main store**. It owns the central cart, checkout and order.
3. Generate the shared secret on the Main store and copy the same key to every Source store.
4. Add every exact Source-store home URL to the Main-store trusted-source allow-list.
5. On each Source store, enter the exact Main-store home URL and choose the post-add behavior.
6. Use the same currency and weight/dimension units on all participating stores.
7. Test a simple product, a variable product with its selected variation, a quantity greater than one, and products from multiple Source stores in one checkout.

## Customer flow

The default post-add behavior returns the customer to the Source store so they can continue browsing. The item has already been added to the Main-store cart. The Source-store badge is informational only, and the Source-store cart or checkout always leads to the Main store.

The final order is created on the Main store only. Remote order items retain the Source-store URL and original product ID so their origin remains visible.

## Development notes

Keep the FREE transfer core small and stable. Changes to transfer, helper-product visibility, sessions, redirects and cart status should be made independently and tested separately. The internal carrier product must remain hidden from the public catalog and return 404 when opened directly.

## WordPress.org notes

WooCommerce is declared as a plugin dependency. Runtime translations are distributed through translate.wordpress.org rather than bundled PO/MO files.
