=== WPRobo Checkout URL Bridge for Meta Shops ===
Contributors: wprobo, alishanvr
Tags: meta checkout url, facebook shop, instagram shop, woocommerce checkout, meta shops
Requires at least: 6.4
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Fixes the empty cart from Facebook & Instagram Shops: Meta checkout URL products, quantities and coupons land in your WooCommerce cart.

== Description ==

Meta no longer supports checkout on Facebook and Instagram. Shops must send
buyers to your website with a **Meta checkout URL** carrying the cart as
parameters. Out of the box, many of those clicks end in an **empty
WooCommerce cart** — because Meta catalogs send retailer IDs (like
`wc_post_id_123`), SKUs, or composite IDs that WooCommerce doesn't recognise.
Every one of those is a lost sale.

**WPRobo Checkout URL Bridge for Meta Shops** makes your store a fully
compatible Meta checkout destination. Zero configuration: install, activate,
submit your checkout URL in Commerce Manager, done.

= What it does =

* Reads Meta's `products` parameter (any quantity of items).
* Resolves every ID format: WooCommerce IDs, `wc_post_id_` retailer IDs,
  SKUs, variation SKUs, and `SKU_ID` composites.
* Clears the cart on each visit so buyers see exactly what they picked.
* Validates stock and tells the buyer if something is unavailable — never a
  silent empty cart.
* Validates and applies the `coupon` parameter with a visible discount.
* Preserves `utm_*`, `fbclid` and `cart_origin` for your analytics.
* Adds nothing to your database, makes no external calls, has no settings.

Full setup guide: [wprobo.com/plugins/wprobo-checkout-url-bridge-for-meta-shops](https://wprobo.com/plugins/wprobo-checkout-url-bridge-for-meta-shops/)

= Passing Meta's checkout validation =

Meta reviews your checkout URL periodically. This plugin implements the
required behaviors from Meta's developer specification, including correct
RFC 3986 decoding, cart clearing, and buyer-facing error states.

== Frequently Asked Questions ==

= What checkout URL do I give Meta in Commerce Manager? =

Your normal checkout page, e.g. `https://yourstore.com/checkout/`. Enter it in
Commerce Manager under your shop's Settings → Checkout method → "Checkout on
another website". You never build the product part of the URL yourself — Meta
appends `?products=...&coupon=...` automatically when a buyer checks out, and
the plugin detects that parameter on any front-end URL.

= How does Meta know my WooCommerce product IDs? =

From your product catalog, not from the checkout URL. Every item you sync to
Meta carries a "retailer ID": the Meta for WooCommerce extension uses
`wc_post_id_123` (your real product ID), data feeds use whatever their `id`
column contains (usually your SKU), and some feeds produce `SKU_123`
composites. When a buyer checks out, Meta builds the checkout URL from those
retailer IDs — and this plugin translates every one of those formats back to
the correct WooCommerce product or variation.

= Do I need to re-sync or change my catalog? =

No. The plugin resolves whatever retailer IDs your existing catalog already
sends, as long as they trace back to your store's product IDs or SKUs. Only
catalogs whose IDs match nothing in WooCommerce (e.g. IDs from a previous
shop platform) cannot be resolved automatically.

= Buyers still land on an empty cart — why? =

Almost always page caching. Exclude your checkout page (and any URL with a
`products` query parameter) from caching in LiteSpeed Cache, WP Rocket,
SG Optimizer, or your host's server-level cache. Most caching plugins exclude
`/checkout/` by default — verify it.

= Does it support variable products? =

Yes — pass the variation ID or the variation's SKU and the correct variation
is added with its attributes.

= Does it work with the Meta for WooCommerce (Facebook) extension? =

Yes. That extension syncs your catalog with `wc_post_id_` retailer IDs, which
this plugin resolves natively.

== Changelog ==

= 1.0.0 =
* Initial release.
