=== LoyalSprout – Loyalty Points & Rewards for WooCommerce ===
Contributors: loyalsprout, freemius
Tags: loyalty program, loyalty points, points and rewards, reward points, woocommerce rewards
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.1.5
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Loyalty points and rewards for WooCommerce. Customers earn points on every order, redeem them in the cart, and guests join from the thank-you page.

== Description ==

LoyalSprout is a points and rewards program for WooCommerce. Customers earn loyalty points on every completed order and redeem them as a discount on their next orders, right in the cart.

Guest buyers are invited to join after they pay: one password field on the thank-you page creates the account, the order moves to that account and earns its points.

= What your customers get =

* **Points on every order.** Set the earning rate (for example 1 point per 1 unit of currency) and the redemption value (for example 100 points = 3 off).
* **Signup on the thank-you page.** Guests create an account with one password field. The order moves to the new account and its points are added when it is completed. Guests whose email already has an account see a login button instead.
* **Points shown where they decide.** On the product page ("With this purchase you earn about 45 points"), in the cart and checkout totals, and in a rewards panel with a one-click "Use points" button.
* **Account page.** Balance, value, progress to the next redemption and the full points history.
* **Order emails** show the points earned and the new balance.

= What you control =

* Earning rate, redemption blocks and a maximum discount as a percentage of the basket.
* Points on prices including or excluding tax. Shipping and fees never earn points.
* Points expiry after a period without purchases.
* Excluded accounts, for example the account your staff uses to place phone orders.
* Manual points adjustments, with a reason shown to the customer.
* Program name, accent color and the address of the account page.
* Whether the plugin data is deleted when the plugin is deleted.

= Works with your store =

* Classic cart and checkout, and the WooCommerce Cart and Checkout blocks.
* High-Performance Order Storage (HPOS).
* Block themes and classic themes. Page builder product templates are supported through the Add to cart form, and shortcodes cover custom templates.
* The points discount is a virtual coupon: nothing is added to Marketing > Coupons, and it does not stack with your own coupons.
* Refunds take back the points of refunded items. Cancelled orders return the points used.

= For developers =

Actions and filters let you extend the program, for example `loyalsprout_product_multiplier`, `loyalsprout_points_changed`, `loyalsprout_order_points_awarded`, `loyalsprout_panel_parts`, `loyalsprout_account_rules` and `loyalsprout_settings_sections`. Each one is documented in the code where it runs.

= LoyalSprout Pro =

LoyalSprout Pro is a separate plugin, sold on its own, that replaces this one. It adds a welcome-back reward for the second order, points multipliers by category and product, points for product reviews, a founding member bonus for past customers, reminder emails and Google Tag Manager events. This plugin works fully on its own and contains none of that code.

== External services ==

This plugin includes the Freemius SDK, used for the optional opt-in to updates and usage data, and for the upgrade to LoyalSprout Pro.

* Nothing is sent unless the site administrator opts in on the screen shown after activation, or buys or starts a trial of LoyalSprout Pro.
* After opt-in, Freemius receives the site URL, the WordPress, PHP and plugin versions, the site language, the administrator's name and email and, if allowed on that screen, the list of active plugins and themes. It is also told when the plugin is activated, deactivated or uninstalled.
* The upgrade and trial buttons on the settings page open the Freemius checkout.
* Service provider: Freemius, Inc. [Terms of Service](https://freemius.com/terms/), [Privacy Policy](https://freemius.com/privacy/).

== Source code ==

The plugin's own JavaScript and CSS files are not minified or compiled.

The bundled Freemius SDK (`vendor/freemius`) ships compiled CSS and JavaScript. Their sources are public:

* The SDK, including its SCSS and unminified scripts: [github.com/Freemius/wordpress-sdk](https://github.com/Freemius/wordpress-sdk)
* The pricing page app (`vendor/freemius/assets/js/pricing/freemius-pricing.js`): [github.com/Freemius/pricing-page](https://github.com/Freemius/pricing-page)

== Installation ==

1. Upload the plugin through Plugins > Add New Plugin, or install it from the directory.
2. Activate it. WooCommerce must be active.
3. Open WooCommerce > LoyalSprout and review the defaults: 1 point per 1 unit of currency, 100 points = 3, up to 20% of the basket, points expire after 365 days without a purchase.
4. Place a test order as a customer, set it to Completed and check the points under My account > Rewards.

== Frequently Asked Questions ==

= Does it work with the WooCommerce Cart and Checkout blocks? =

Yes. The rewards panel, the points line in the totals and the guest invite work with both the block-based and the classic cart and checkout.

= Can I name the program after my store? =

Yes. Set the program name in WooCommerce > LoyalSprout, for example "Greenleaf Rewards". Customers see it on every page and email.

= Do guest orders earn points? =

Not directly. A guest who creates an account on the thank-you page, logs in, or registers later in the same visit with the order's email keeps the points of that order. A guest who ticks "Create an account?" at checkout earns as a member.

= When are points added? =

When the order status changes to Completed.

= Can customers combine points with a coupon? =

No. The points discount does not combine with other coupons. The cart explains this when it happens.

= Are points calculated with or without tax? =

You choose. By default they follow how your cart shows prices. The same basis applies to the redemption cap.

= What happens on refunds and cancellations? =

Refunded items take back the points they earned. A cancelled or failed order returns the points that were used on it.

= My theme has a custom thank-you or checkout template. =

Place `[loyalsprout_thankyou_signup]` on the thank-you template, `[loyalsprout_checkout_invite]` on the checkout and `[loyalsprout_product_points]` on product templates.

= Does it send emails? =

Only the existing WooCommerce order emails, which show a points block to members. The plugin sends no other email.

= Is my data removed when I delete the plugin? =

Only if you tick "Delete all points, history and settings when the plugin is deleted" in the settings.

== Screenshots ==

1. The product page shows how many points the purchase earns.
2. In the cart, members see their balance and use their points with one click. The cart totals show the points the order earns.
3. At checkout, guests see the points they would earn with an account.
4. On the thank-you page, guests create an account with one password field and keep the points of the order.
5. The rewards page in My account: balance and its value, progress to the next redemption, points history and the program rules.
6. Settings under WooCommerce > LoyalSprout.

== Changelog ==

= 0.1.5 =
* The rewards page in My account keeps clear of the account menu in block themes such as Twenty Twenty-Five.
* Screenshots and FAQ added to the readme.

= 0.1.4 =
* Freemius SDK updated to 2.13.5.
* The readme lists the public sources of the SDK's compiled files.

= 0.1.3 =
* Shortcode output and the thank-you box attributes are escaped when returned.
* Development files removed from the bundled Freemius SDK.

= 0.1.2 =
* The plugin hosted here contains only its own features. LoyalSprout Pro is a separate plugin.
* Nonce checks on every request the plugin handles.
* Translations come from translate.wordpress.org.

= 0.1.1 =
* Output escaping and translator comments tidied for the WordPress.org review.

= 0.1.0 =
* First release.

== Upgrade Notice ==

= 0.1.5 =
Fixes the layout of the rewards page in block themes.
