=== Share Cart and Save Cart for Later for WooCommerce by LeanPlugins ===
Contributors: azplugins
Tags: woocommerce, share cart, save cart, save for later, wishlist
Requires at least: 5.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.1.6
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Share cart via link in one click. Save cart for later with custom names. Reduces cart abandonment. Works with classic and FSE block carts.

== Description ==

**Share cart in one click and save cart for later.** Every customer can share cart contents with a unique link, and logged-in users can save unlimited carts with custom names for later purchase.

The share cart feature works for everyone, including guests. One click creates a unique URL that loads the exact cart anywhere, on any device. Perfect for cross-device shopping, getting approval from others, or sharing product recommendations. Logged-in customers can save carts with custom names (like "Birthday Wishlist" or "Monthly Reorder"), viewable in My Account → Saved Carts where they can restore or delete them anytime.

Lightweight, works with classic themes and modern FSE Cart Blocks, and helps reduce cart abandonment while enabling natural product sharing.

🌐 [Visit Official Website](https://leanplugins.com/wordpress-plugins/cart-share-and-save/?utm_source=wordpress.org&utm_medium=desc) | ⚡ [Upgrade to Pro](https://leanplugins.com/wordpress-plugins/cart-share-and-save/?utm_source=wordpress.org&utm_medium=desc&utm_campaign=upgrade#pricing)

**Try it yourself, no install needed:**

**1. Test Cart Sharing** (no login required)

* [See a pre-loaded shared cart →](https://demo.leanplugins.com/cart-share-and-save/share-cart/lUyyJl6e4Y)
* Works instantly, no need to add products yourself.

**2. Test Cart Saving** (auto login)

* [Auto-login with cart ready →](https://demo.leanplugins.com/cart-share-and-save/share-cart/lUyyJl6e4Y?demo_auto_login=x8Kp2mQr9vLn)
* Click "Save Cart" once logged in to test the save feature.
* Manual login: Username `demo` / Password `demo`

**3. View Saved Carts**

* [My Account → Saved Carts →](https://demo.leanplugins.com/cart-share-and-save/my-account/saved-carts/?demo_auto_login=x8Kp2mQr9vLn)

**4. Test Custom Message** (Pro)

* [See a shared cart with a personal note →](https://demo.leanplugins.com/cart-share-and-save/share-cart/ruMjfZe2GZ)
* Notice the message shown to the recipient above the cart.

**5. Test Password Protection** (Pro)

* [Open a password-protected shared cart →](https://demo.leanplugins.com/cart-share-and-save/share-cart/32FP01OueX)
* Password: `demo`

**Real Business Scenarios Where This Plugin Shines:**

* **B2B Sales & Consultations**: Share product quotes and recommendations with clients instantly
* **Gift Shopping & Wishlists**: Let customers create and share wishlists with family and friends
* **Abandoned Cart Recovery**: Customers can save their cart for later and return instead of losing their selections
* **Team Purchasing & Approvals**: Enable team members to collaborate on group orders and bulk purchases
* **Cross-Device Shopping**: Let customers start shopping on mobile, save, and complete on desktop
* **Event Planning & Bulk Orders**: Share product lists for weddings, parties, or seasonal restocking
* **Recurring Purchases & Subscriptions**: Create and share weekly/monthly item packages - customers can save these lists to their profile and easily reorder or modify quantities or products

**Key Features:**

* **Cart Sharing**: Generate unique shareable URLs for any cart
* **One-Click Cart Links**: Every cart link preloads the exact products and quantities, ready to send to customers or use in promotions and campaigns
* **Cart Saving**: Allow logged-in users to save carts with custom names
* **Custom Message**: Let sharers include a personal note shown to the recipient when the cart loads [PRO]
* **QR Code**: Show a scannable QR code in the share popup so recipients can open the cart on their phone [PRO]
* **Password Protection**: Let sharers set a password recipients must enter before the cart loads [PRO]
* **WooCommerce Integration**: Seamlessly integrates with your existing WooCommerce store
* **FSE & Block Cart Support**: Works perfectly with both classic themes and modern Full Site Editing (FSE) themes with WooCommerce Cart Blocks
* **My Account Integration**: Saved carts appear in customer My Account area
* **Flexible Settings**: Configure share expiry, button label, button position
* **Data Management**: Optional data cleanup on plugin uninstall
* **Security First**: Proper nonce verification and input sanitization
* **Lightweight**: Minimal impact on site performance

**Cart Sharing Features:**
* Generate unique share URLs for any cart
* Configurable expiration (or never expire)
* Custom button label and position
* Product variation support (size, color, etc. preserved on the shared link)
* Quantities preserved exactly as the sharer selected them
* Personal message to recipient [PRO]
* Pre-filled default message text [PRO]
* QR code in share popup [PRO]
* Password-protect share links [PRO]

**Cart Saving Features:**
* Save cart for later with a custom name
* View all saved carts in My Account area
* Restore any saved cart with one click
* Delete saved carts when no longer needed
* Perfect for wishlist functionality

== Upgrade to Pro ==

[Get Pro](https://leanplugins.com/wordpress-plugins/cart-share-and-save/?utm_source=wordpress.org&utm_medium=desc&utm_campaign=upgrade#pricing)

**Custom Message** - Allow sharers to write a personal note shown to the recipient when the shared cart loads. Set a default pre-filled message so sharers always have a starting point.

**QR Code** - Display a scannable QR code inside the share popup. Recipients can open the shared cart instantly on any phone camera, no typing required.

**Password Protection** - Let sharers set a password for their cart link. Recipients must enter the correct password before the cart loads, keeping private shares truly private.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/lean-cart-share-and-save` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. **Important**: Make sure WooCommerce is installed and activated first.
4. Go to "Cart Share & Save" in your WordPress admin menu to configure settings.
5. Visit Settings → Permalinks and click "Save Changes" to refresh URL rules (fixes 404 errors).

== Usage ==

**Sharing a Cart:**
1. Add products to your WooCommerce cart
2. Go to the cart page
3. Click the "Share Cart" button
4. Copy the generated URL and share it
5. Recipients can click the URL to load the cart

**Saving a Cart:**
1. Add products to your WooCommerce cart  
2. Go to the cart page
3. Click the "Save Cart" button (requires login)
4. Enter a name for your saved cart
5. Access saved carts from My Account → Saved Carts

**Plugin Settings:**
* Enable/disable cart sharing
* Enable/disable cart saving
* Set share link expiration (days)
* Choose button position: After cart table (default), Default (coupon row), Before cart, Before cart totals, Use shortcode
* Choose whether to delete data on uninstall

**Shortcode:**

Place the buttons anywhere on your website: any page, post, widget, page builder (Elementor, Divi, etc.) or anywhere in WordPress that renders shortcodes.

* `[lean_cart_share_save]` shows both buttons
* `[lean_cart_share_save display="share"]` shows only the Share Cart button
* `[lean_cart_share_save display="save"]` shows only the Save Cart button

To show buttons only where you place the shortcode, set Button Position to "Use shortcode" in the plugin settings.

== Frequently Asked Questions ==

= How do customers share cart contents? =

They click the "Share Cart" button on the cart page. The plugin generates a unique share cart URL they can copy and send via email, chat, or social media. Anyone opening the link gets the exact same cart loaded.

= Can customers save their cart for later? =

Yes. Logged-in customers click "Save Cart", give the cart a custom name, and it appears under My Account → Saved Carts where they can restore it with one click at any time.

= Does share cart work with variable products? =

Yes. Product variations (size, color, etc.) and quantities are preserved exactly as the sharer selected them, both on shared links and saved carts.

= Can I use the shortcode and the automatic button position at the same time? =

Yes. They work independently. The Button Position setting controls the automatic buttons on the cart page, and `[lean_cart_share_save]` renders wherever you place it. If you put the shortcode on the cart page itself, you will see the buttons twice, so set Button Position to "Use shortcode" there to keep only your manual placement.

= Does this plugin require WooCommerce? =

Yes, this plugin is built specifically for WooCommerce and requires WooCommerce to be installed and activated.

= Do shared cart links expire? =

By default, shared cart links never expire, but you can configure an expiry (in days) in the plugin settings if you want links to stop working after a set time.

= Can guest users share carts? =

Yes! Any user can share a cart, including guest users who haven't created an account.

= Can guest users save carts? =

No, saving carts requires users to be logged in. However, guest users can still share carts via URLs.

= What happens if a product is no longer available? =

If a shared or saved cart contains products that are no longer available or purchasable, those items are automatically skipped during cart restoration.

= Will this plugin slow down my site? =

No, the plugin is designed to be lightweight and only loads assets when needed. It uses efficient database queries and follows WordPress best practices.

= Does it work with FSE (Full Site Editing) themes and WooCommerce Cart Blocks? =

Yes! The plugin fully supports both classic WooCommerce themes and modern FSE themes using WooCommerce Cart Blocks. The buttons automatically appear in both classic and block cart pages.

= Can I customize the appearance of the share/save buttons? =

The plugin uses standard WooCommerce styling by default. You can customize the appearance using CSS by targeting the `.lean-csns-buttons-wrapper` class.

= Is the plugin translation ready? =

Yes, the plugin is fully translation ready with the text domain 'lean-cart-share-and-save'.

= What data is stored when sharing or saving carts? =

The plugin stores: product IDs, quantities, variations, applied coupons, and basic metadata like creation dates. No personal information is stored with shared carts.

= How do I fix 404 errors on shared links? =

Go to Settings → Permalinks in your WordPress admin and click "Save Changes" (no need to change anything). This refreshes WordPress URL rules.

= Does this plugin use any third-party services? =

Yes. This plugin uses the [Freemius](https://freemius.com/) SDK for licensing, seamless upgrades, and optional insights that help us improve the plugin.

Freemius does not collect any data by default. On activation you will see an opt-in screen where you can choose to share non-sensitive diagnostic data. Opting in helps us understand the environments the plugin runs in, catch compatibility issues early, and prioritize the features that matter most. If you opt in, Freemius collects:

* Site URL, WordPress version, PHP version
* Plugin version and activation/deactivation events
* Your admin name and email address

Skipping the opt-in is completely fine, the plugin works fully either way and no data is sent during normal usage. Purchasing or activating a Pro license connects to Freemius to validate the license and deliver automatic updates.

On opt-in, we also send a copy of the same non-sensitive diagnostic data to our own database hosted on Supabase, so we can track plugin adoption independently of Freemius.

**Service Used:** Freemius (https://freemius.com/)
**Privacy Policy:** https://freemius.com/privacy/
**Terms of Service:** https://freemius.com/terms/

**Service Used:** Supabase (https://supabase.com/)
**Privacy Policy:** https://supabase.com/privacy

== Screenshots ==

1. Share Cart Settings tab - configure sharing options and advanced pro features
2. Save Cart Settings tab - configure save cart options
3. Share Cart and Save Cart buttons on classic WooCommerce cart page
4. Share Cart and Save Cart buttons on FSE theme with WooCommerce Cart Block - works seamlessly with modern block-based cart pages
5. Cart sharing popup with generated shareable URL
6. Cart saving popup with custom name input
7. Saved carts displayed in My Account area

== Changelog ==

= 1.1.6 =
* New: [lean_cart_share_save] shortcode, place the Share Cart and Save Cart buttons on any page or post
* New: "Use shortcode" button position that turns off automatic buttons on the cart page
* Updated: Language translation template (.pot) regenerated with the latest strings

= 1.1.5 =
* New: "Before cart" button position, shows the Share/Save buttons above the cart on both classic and block (FSE) carts
* Changed: "Before cart" is now the default button position for new installs

= 1.1.4 =
* Fix: Prevent the "Shared cart loaded successfully" notice from showing twice on block (FSE) carts

= 1.1.3 =
* Fix: Plugin version header now matches the release version (1.1.2 shipped with a stale header)

= 1.1.2 =
* New: Choose to combine or replace when opening a share/saved cart link while your cart already has items
* Fix: Share/save prompt pages now render correctly on block (FSE) themes

= 1.1.1 =
* Improved: Cart Share & Save Popup
* Added: Button position option
* Updated: WordPress.org screenshots renumbered serially with updated captions

= 1.1.0 =
* New: Redesigned admin settings page with tabbed UI (General and Advanced tabs)
* Improved: Saved Carts tab in My Account is now hidden when Save Cart feature is disabled

= 1.0.5 =
* New: Added Settings link to plugin action links
* Updated: Language translation file

= 1.0.4 =
* Fixed: Cart restoration does not work.

= 1.0.3 =
* New: Compatibility with FSE (Full Site Editing) themes and WooCommerce Cart Blocks

= 1.0.2 =
* Improved: Enhanced compatibility and performance

= 1.0.1 =
* Improved: Code optimizations and security enhancements

= 1.0.0 =
* Initial release
* Cart sharing with unique URLs
* Cart saving for logged-in users
* WooCommerce integration
* My Account page integration
* Configurable settings page
* Share link expiration options
* Data management options
* Security best practices
