=== Marketplace Trust – Where to Buy Links ===
Contributors: ajiokart
Tags: woocommerce, marketplace, product-comparison, shopping, where-to-buy
Requires at least: 6.0
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 0.3.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Display a beautiful "Where to Buy" section with product links to Amazon, Flipkart, Ajiokart and other marketplaces. Works on any WordPress website using shortcodes and with WooCommerce integration.

== Description ==

Marketplace Trust – Where to Buy Links loads the AjioKart Constant Commerce widget from https://markets.ajiokart.com/widget/constant-commerce.js to display marketplace buying options. The widget loads current product options from AjioKart's marketplace feed. WooCommerce is optional when you supply the AjioKart Product ID in the shortcode.

With WooCommerce active, choose any of four automatic positions: after the product button on shop listings and Product Collection blocks that include a Product Button, after Add to cart on product pages, before product tabs, or after product tabs. The first two open a modal. The tab positions display inline. WooCommerce block product templates are supported through their compatibility hooks. Customize the heading, modal button text, and widget colors in Settings > Marketplace Trust.

The widget only appears for products with an AjioKart Product ID. Simple products use the ID in Product data > General. Variable products use the parent ID for shop listings and each variation's ID on the product page. A variable product-page widget stays hidden until the shopper selects a mapped variation.

Use `[marketplace_trust product_id="G9G37R72PZ"]` in a page, post, widget, or Shortcode block to place a modal widget for a specific AjioKart Product ID. This works on a WordPress site without WooCommerce. Use `display="inline"` for inline options. With WooCommerce active, `[marketplace_trust]` on a product page uses the current product mapping; for a variable product it waits for a mapped variation selection. The shortcode works independently of the four automatic position settings, but the main Enable setting must be on. The widget is omitted when the Product ID is invalid or missing.

== External service ==

When a widget is displayed, the visitor's browser loads its script from AjioKart's Constant Commerce service at https://markets.ajiokart.com/widget/constant-commerce.js. When inline options are shown or a modal is opened, the widget requests https://markets.ajiokart.com/offers with the configured AjioKart Product ID as the `productid` query parameter to retrieve current offers and product details. Clicking a marketplace option opens https://markets.ajiokart.com/p.php with that Product ID, the selected marketplace, and the `AJIOKART.com` referral label; the visitor is then redirected to the selected marketplace. These browser requests can also convey standard request information such as the visitor's IP address, browser user agent, and referrer according to the visitor's browser settings. No WooCommerce customer or order details are added to these requests by this plugin.

AjioKart's Terms & Conditions: https://ajiokart.com/p/terms-and-condition
AjioKart's Privacy Policy: https://ajiokart.com/p/privacy-policy

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`.
2. Activate the plugin through the Plugins screen in WordPress.
3. In Settings > Marketplace Trust, leave the main Enable setting on and save.
4. Add `[marketplace_trust product_id="G9G37R72PZ"]` to a page, post, widget, or Shortcode block, replacing the sample ID with the product's 10-character AjioKart Product ID.
5. If you use WooCommerce, enable any automatic positions you want. Edit each WooCommerce product and enter its AjioKart Product ID in Product data > General. For a variable product, also enter an ID in each mapped variation's Inventory section, then save the product.

== Frequently Asked Questions ==

= Does this require WooCommerce? =
No. A shortcode with an explicit AjioKart Product ID works on any WordPress site. WooCommerce is needed only for automatic shop and product placements or for a shortcode that reads the current product's saved mapping.

= What happens when a Product ID is missing? =
No widget is shown. On a variable product page, only a selected variation with its own AjioKart Product ID shows the widget.

== Changelog ==

= 0.3.0 =
Added Product Collection placement and a manual shortcode that also works without WooCommerce, and documented the external service.

= 0.2.0 =
Added four display positions, product and variation IDs, widget text and color settings, and the hosted Constant Commerce widget.

= 0.1.0 =
Initial structure.
