Shared Carts
Navigate to yStore → Marketing → Shared Carts.
Shared Carts lets customers generate a link that pre-populates someone else's cart with their current items. When the recipient opens the link, the shared items are added to their cart automatically. It is a lightweight cart-sharing tool useful for B2B workflows, gift buying, and customer support scenarios.
Use cases
| Scenario | How it helps |
|---|---|
| B2B purchasing | A buyer builds a cart and shares it with a manager for approval before checkout |
| Gift purchasing | Share a cart with a friend or family member so they can buy the exact items |
| Customer support | A support agent recreates a customer's broken cart and sends a recovery link |
| Sales assistance | Sales staff build a custom product selection for a prospect and share it as a direct checkout link |
| Repeat orders | A customer shares their regular order with a colleague at the same company |
How it works end-to-end
If the recipient is the same person who created the share (same cart session), no changes are made and a notice is shown instead.
Admin list columns
| Column | Description |
|---|---|
| Cart | Original cart reference |
| Created by | The customer who generated the share |
| Status | active, expired, or depleted (used_count reached max_uses) |
| Uses | used_count / max_uses |
| Last used by | Email of the most recent recipient |
| Last restored | Timestamp of the most recent cart restoration |
| Expires at | When the link stops accepting new restorations |
Configuration
Go to yStore → Settings → Sales → Marketing → Shared Carts.
| Setting | Description | Default |
|---|---|---|
| Enable cart sharing | Master toggle — disabling removes the Share button from the storefront entirely | Off |
| Max uses per share | How many recipients can restore a cart from a single link | 5 |
| Link expiry (hours) | How long the link remains valid after creation | 72 |
Cart sharing must be explicitly enabled in settings. The Share button must also be added to your storefront cart template manually — it is not included in any default template. Enabling the setting alone does not surface the button to customers.
What happens with unavailable items
If a product in the shared cart has become unavailable between when the share was created and when the recipient opens it (disabled, deleted, out of stock), it is skipped during restoration. The recipient sees a notification listing which items could not be added. All available items are still restored normally.
| Item state at restoration | Outcome |
|---|---|
| Available and in stock | Added to recipient's cart |
| Out of stock | Skipped — listed as unavailable in the response |
| Disabled or deleted | Skipped — listed as unavailable in the response |
| Price changed since share | Added at current price — not the price when shared |
Shared cart links do not lock product prices at the time of sharing. If a price changes between when the share is created and when the recipient restores it, the recipient sees the current price. Inform customers of this if using shared carts for quote/approval workflows.
Reusing an active share
If a customer clicks "Share cart" when an active, non-expired share already exists for their current cart, the system returns the existing link instead of creating a duplicate. This prevents the same cart from generating multiple parallel active share links.
Share link format
Share links use a token-based URL:
https://yourstore.com/shop/cart/share/{token}
The token is a SHA-256 hash — long enough to be effectively unguessable and not sequential. There is no way to enumerate valid tokens.
Storefront integration
To add cart sharing to your storefront:
- Add a Share Cart button to your cart template.
- On click, call the cart share endpoint:
<form action="/actions/yui/cart/share" method="POST">
{{ csrfInput() }}
<button type="submit">Share this cart</button>
</form>
- Handle the response — the endpoint returns the share URL as JSON:
{
"success": true,
"url": "https://yourstore.com/shop/cart/share/abc123...",
"expiresAt": "2026-03-23T12:00:00Z",
"maxUses": 5
}
- Display the URL to the customer (copy button, shareable link widget, or email input to send directly).