Skip to main content
Version: 2.0.0

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

ScenarioHow it helps
B2B purchasingA buyer builds a cart and shares it with a manager for approval before checkout
Gift purchasingShare a cart with a friend or family member so they can buy the exact items
Customer supportA support agent recreates a customer's broken cart and sends a recovery link
Sales assistanceSales staff build a custom product selection for a prospect and share it as a direct checkout link
Repeat ordersA 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

ColumnDescription
CartOriginal cart reference
Created byThe customer who generated the share
Statusactive, expired, or depleted (used_count reached max_uses)
Usesused_count / max_uses
Last used byEmail of the most recent recipient
Last restoredTimestamp of the most recent cart restoration
Expires atWhen the link stops accepting new restorations

Configuration

Go to yStore → Settings → Sales → Marketing → Shared Carts.

SettingDescriptionDefault
Enable cart sharingMaster toggle — disabling removes the Share button from the storefront entirelyOff
Max uses per shareHow many recipients can restore a cart from a single link5
Link expiry (hours)How long the link remains valid after creation72
Opt-in feature

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 restorationOutcome
Available and in stockAdded to recipient's cart
Out of stockSkipped — listed as unavailable in the response
Disabled or deletedSkipped — listed as unavailable in the response
Price changed since shareAdded at current price — not the price when shared
Prices are not locked

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 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:

  1. Add a Share Cart button to your cart template.
  2. On click, call the cart share endpoint:
<form action="/actions/yui/cart/share" method="POST">
{{ csrfInput() }}
<button type="submit">Share this cart</button>
</form>
  1. 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
}
  1. Display the URL to the customer (copy button, shareable link widget, or email input to send directly).