=== QnABuy ===
Contributors: obaid2013
Tags: woocommerce, quiz, product bundle, product recommendations
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.0.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Donate link: https://plugin.themenut.com/qnabuy/

Lightweight WooCommerce plugin that creates product recommendation quizzes

== Description ==

QnA Buy lets store owners build dynamic, step-by-step recommendation quizzes that group selected products into custom cart bundles seamlessly.

= Features =

* **Interactive Quiz Builder** - Create unlimited quizzes with a flexible JSON schema
* **Smart Product Matching** - Map quiz answers to specific products or product variations
* **Bundle System** - All selected products are grouped with a unique Bundle ID for easy order tracking
* **Stock Awareness** - Automatically shows stock status and prevents adding out-of-stock items
* **Beautiful UI** - Clean, responsive quiz interface with product images and variant names
* **Variation Support** - Full support for WooCommerce variable products and their variations
* **Order Tracking** - Bundle IDs persist through cart, checkout, orders, and email notifications

= Use Cases =

* **Skincare Routines** - Recommend products based on skin type and concerns
* **Nutrition Supplements** - Bundle supplements based on health goals
* **Gift Bundles** - Create personalized gift bundles
* **Service Packages** - Recommend service packages based on customer needs
* **Any Product Quiz** - Perfect for any product recommendation scenario

= How It Works =

1. Creates a quiz with questions and answers
2. Each answer maps to specific products or variations (JSON format)
3. Customers take the quiz on the frontend
4. They see their recommended bundle with product images and names
5. One click adds the entire bundle to cart with a unique Bundle ID

= JSON Generator =
Stuck with JSON writting? Generate your code from  <a href="https://plugin.themenut.com/qnabuy/json-generator/">here</a>

== Installation ==

1. Search for `QnABuy`, install the plugin. Make sure <a href="https://wordpress.org/plugins/woocommerce/">WooCommerce</a>
2. Activate the plugin through the 'Plugins' menu in WordPress
3. Create your first quiz by going to 'Quizzes > Add a Quiz'
4. Add the shortcode `[qnabuy_quiz id="xx"]` to any page

== Usage ==

= Creating a Quiz =

1. Go to **Quizzes > Add New Quiz**
2. Give your quiz a title
3. Configure the JSON schema in the Quiz Data section.
4. Use the shortcode to display the quiz: `[qnabuy_quiz id="XX"]`

= Bundle ID in Orders =

All products from the same quiz session share a Bundle ID (e.g., `QNAB-XXXXXX`) that appears in:
* Shopping cart
* Checkout page
* Order details (customer and admin)
* Email notifications

This makes it easy to identify which products were purchased together as a bundle.

== Screenshots ==

1. Quiz creation interface
2. Add quizzes using Gutenberg block
3. Quiz UI/UX
4. Bundle review based on answers
5. Order details includes Bundle ID

== Changelog ==

= 1.0.2 =
Updated Blueprint Playground

= 1.0.1 =
* Added Blueprint.json for live preview

= 1.0.0 =
* Initial release
* Quiz builder with JSON schema
* Simple and variable product support
* Bundle ID tracking through orders
* Stock status display
* One-click bundle to cart

== Upgrade Notice ==

= 1.0.2 =
Updated Blueprint Playground

== Frequently Asked Questions ==

= Does this work with WC simple/variable products? =
Yes! You can use both simple and variable products.

= Can I use the same product in multiple answers? =
Yes, products can appear in any number of quiz answers.

= What happens if a product goes out of stock? =
Out-of-stock items are clearly marked and the add-to-cart button is disabled until those items are removed from the selection.

= Can customers change their answers? =
Yes, there's a "Back to Quiz" button on the bundle review page.

= Does this work with page builders? =
The shortcode `[qnabuy_quiz id="xx"]` works with any page builder that supports shortcodes (Elementor, Divi, Gutenberg, BricksBuilder etc.).

= Do you support Gutenberg blocks?
Yes, you can add `QnA Buy Quiz` block and select quizzes from dropdown. 

= Where do I find product and variation IDs? =
Go to Products > edit the product > look at the URL. 
For variations, go to Products > Variations tab.

== Reviews ==

Write a review if you love this plugin!

== Support ==

Please visit the <a href="https://wordpress.org/support/plugin/qnabuy">support forum</a>