=== STS Direct Checkout for WooCommerce ===
Contributors: piotrprach
Tags: checkout, buy now, woocommerce
Requires at least: 6.5
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add a secure Buy now button that preserves the cart and uses the normal WooCommerce stock and checkout rules.

== Description ==

A focused Buy now flow for simple and variable products:
* A separate Buy now button on classic WooCommerce product forms.
* Successful purchase initiation opens the configured WooCommerce checkout page.
* Existing cart items are preserved.
* WooCommerce's original add-to-cart handler retains stock, variations, quantity, sold-individually and third-party validation.
* Per-click, short-lived, session-bound tokens; a consumed token is rejected on reuse.
* Tokens are fetched after clicking, not embedded in cached product pages.
* Token issuance is limited per WooCommerce session.
* A configurable button label with translated English/Polish defaults.

[Direct Checkout Pro](https://simpletradesolutions.com/sts-direct-checkout-pro-en/) adds category/product targeting and secure purchase shortcodes for landing pages.

== Installation ==

1. Install and activate WooCommerce and this plugin.
2. Open WooCommerce > Direct Checkout and enable the button.
3. Test a simple product and a variation with all required options selected.
4. Confirm that an existing cart item remains when Buy now opens checkout.
5. Test stock restrictions and your payment/shipping plugins before production use.

== Frequently Asked Questions ==

= Does Buy now place or pay for an order automatically? =
No. It adds the product through WooCommerce and opens checkout. The shopper still reviews the order and completes the configured payment process.

= Are existing cart products removed? =
No. The resulting checkout includes the whole current cart. This version has no isolated single-product checkout mode.

= Does it work with Blocks? =
The destination can be classic or block checkout. Automatic button placement depends on classic product-form hooks. Product Add to Cart blocks and builders omitting those hooks are not automatically modified. Pro offers a Shortcode block placement option.

= What if validation fails? =
WooCommerce shows its normal error and does not redirect as a successful purchase. Stock limits and sold-individually rules are not overridden.

= What product types are supported? =
Simple and variable product pages. Not grouped/external products, subscriptions or bundles. The product form can submit third-party options, but each third-party extension still needs a compatibility test.

= Why does it need JavaScript? =
JavaScript obtains a token tied to the current WooCommerce session and submits the standard product form. Without it, customers can use the ordinary Add to cart button.

= Privacy and external services =
Free makes no external service calls, creates no marketing/analytics cookies and keeps no personal-data logs. Short-lived tokens and counters are stored inside native WooCommerce cart sessions and expire with them. Only the rendered purchase forms enqueue the small bundled script.

= Uninstall =
Settings are retained unless the opt-in removal setting is enabled. Products, orders and existing cart data are not deliberately deleted by uninstall. WooCommerce handles its normal session cleanup.

== Screenshots ==

1. Free Buy now button beside the native add-to-cart button on a variable product; Storefront demo.

== Changelog ==

= 1.0.0 =
* Initial original STS release with English and Polish administration strings.

== Upgrade Notice ==

= 1.0.0 =
Initial release. Test checkout, shipping and payment workflows on staging before production activation.
