=== Jacklabs Direct Order Button for WooCommerce ===
Contributors: seowebsite0711
Tags: woocommerce, buy now, quick buy, direct checkout, conversion
Requires at least: 6.5
Tested up to: 7.0
Requires PHP: 7.4
Requires Plugins: woocommerce
Stable tag: 1.0.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Add fast WooCommerce Buy Now buttons anywhere with a shortcode, flexible cart behavior, variable-product support, and local conversion analytics.

== Description ==

Jacklabs Direct Order Button for WooCommerce adds a fast, flexible ordering flow without replacing WooCommerce checkout or payment handling.

Use either shortcode anywhere:

`[jlqb id="123"]`

`[jacklabs_direct_order_button id="123"]`

Highlights:

* Place a Direct Order button anywhere using the short `[jlqb]` alias or the full `[jacklabs_direct_order_button]` shortcode.
* Works with simple products and variable products.
* Variable products can show variation selectors automatically.
* Optional quantity and price display.
* Redirect to checkout, cart, product page, or a validated same-site custom URL.
* Choose whether Direct Order keeps existing cart items or clears the cart first.
* Set a global button label and colors.
* Override the button label per product.
* Disable Direct Order for individual products.
* Add a `campaign` attribute to measure placement performance.
* Local-only analytics: clicks, orders created, conversion rate, revenue, top campaigns, and top products.
* Optional analytics are stored inside WordPress and are never sent to Jacklabs. They can be disabled in settings.
* Uses WooCommerce CRUD APIs and declares HPOS compatibility.
* Supports classic checkout and Checkout Block order attribution.
* Developer hooks: `jlqb_button_text`, `jlqb_cart_item_data`, `jlqb_redirect_url`, and `jlqb_product_added`.
* No required external services, CDN assets, tracking scripts, or remote calls.

= Shortcode examples =

Basic:

`[jlqb id="123"]`

Show quantity and price:

`[jacklabs_direct_order_button id="123" text="Order now" show_quantity="yes" show_price="yes"]`

Focused checkout that clears existing cart items:

`[jacklabs_direct_order_button id="123" cart="clear" redirect="checkout"]`

Track placement performance locally:

`[jacklabs_direct_order_button id="123" campaign="homepage-hero"]`

Use a specific variation:

`[jacklabs_direct_order_button id="123" variation_id="456"]`

= Privacy =

The plugin does not send analytics, customer information, product information, or site information to Jacklabs or any external service.

Direct Order analytics are stored locally as daily aggregate counters for up to 90 days. Direct Order markers may also be stored as private WooCommerce order and order-item metadata so the plugin can attribute orders created from Direct Order.

== Installation ==

1. Install and activate WooCommerce.
2. Upload the plugin folder to `/wp-content/plugins/` or install the ZIP from Plugins > Add New.
3. Activate "Jacklabs Direct Order Button for WooCommerce".
4. Go to WooCommerce > Direct Order to configure defaults.
5. Add `[jacklabs_direct_order_button id="123"]` to any shortcode-capable area.

== Frequently Asked Questions ==

= Does it replace WooCommerce checkout? =

No. Direct Order adds the product to the standard WooCommerce cart and then redirects using the selected behavior. WooCommerce remains responsible for checkout, taxes, shipping, payment gateways, inventory, and order creation.

= Does it work with variable products? =

Yes. If `variation_id` is not provided, the shortcode renders variation selectors using WooCommerce variation data. On a normal single-product page, the automatic Direct Order button uses the variation selected in the WooCommerce form.

= Can Direct Order keep products already in the cart? =

Yes. "Keep existing items" is the default. You can also choose "Clear cart before Direct Order" globally or with `cart="clear"` in a shortcode.

= Does the plugin use an external analytics service? =

No. Analytics are optional, local to your WordPress database, and no analytics request is sent to Jacklabs or another external service. They can be disabled in Direct Order settings.

= What does the campaign attribute do? =

It labels a Direct Order placement so you can compare clicks and orders created from places such as a homepage hero, blog post, landing page, or email-specific landing page.

== Screenshots ==

1. General Direct Order settings.
2. Shortcode examples and attributes.
3. Local Direct Order analytics.
4. Product-level Direct Order controls.

== Changelog ==

= 1.0.0 =
* Initial release.
* Added shortcode-based Direct Order for simple and variable products.
* Added configurable cart behavior and redirects.
* Added product-level enable/label controls.
* Added privacy-friendly local conversion analytics and campaign attribution.
* Declared WooCommerce HPOS compatibility.
