=== MarkitMall Dropship ===
Contributors: codescrapper1
Tags: dropshipping, woocommerce, pakistan, cash on delivery, fulfillment
Requires at least: 6.2
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 1.1.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Sell MarkitMall products on your WooCommerce store. MarkitMall packs and ships every order under your brand.

== Description ==

* Browse the MarkitMall dropship catalog inside WP admin and import products at wholesale prices. Images are copied to your media library; title, description and price are yours to edit (never below the product's minimum price).
* Orders containing MarkitMall products are sent automatically. Cash-on-delivery orders go at checkout; prepaid orders once paid — their wholesale cost is taken from your MarkitMall wallet. Your own products in the same cart are left alone.
* Tracking, delivery, cancellations and returns come back as order notes, and the order status moves for you.
* Delivery rates in one click: a "MarkitMall delivery" method in your Pakistan shipping zone charges what MarkitMall charges, by weight. Products MarkitMall delivers free add nothing, and your own products keep your own shipping methods.
* Each product's cost is MarkitMall's wholesale price (in WooCommerce's Cost of goods field when that feature is on), so you see your margin.
* Stock, minimum prices and costs stay in sync: instantly through signed webhooks, and every six hours as a safety net. A product MarkitMall stops selling is unpublished.
* A dashboard in the MarkitMall menu: set-up checklist, wallet balance, pending margins and recent orders. Orders go automatically, or one by one with a "Send to MarkitMall" button if you prefer.
* Manage your imports: see every imported product, and remove one (it can be imported again later).

You need an approved MarkitMall dropshipper account (markitmall.com/dropshipping) and WooCommerce.

== Installation ==

1. Upload the plugin zip (Plugins → Add New → Upload) and activate it.
2. In your MarkitMall dropshipping dashboard → Integrations, connect a WooCommerce store and create an API key.
3. Open MarkitMall in the WordPress menu, paste the key (Bearer mk_…:sk_…) and press "Connect". This registers the webhook automatically.
4. On the Catalog tab, set your price and import products.
5. On the Dashboard tab, follow the set-up list: store in Pakistan with PKR prices, then "Set up delivery rates".

Use a test key (mk_test_…) first: orders are validated but nothing ships and no money moves.

== Frequently Asked Questions ==

= My host blocks outgoing connections =
Ask your host to allow HTTPS requests to backend.markitmall.com. The settings page shows the exact error.

= What happens if MarkitMall is unreachable when an order arrives? =
The order is retried automatically with increasing delays. Orders MarkitMall refuses (out of stock, below the minimum price, wallet too low) are listed on MarkitMall → Orders (Needs attention) with a "Retry now" button.

= Does it support High-Performance Order Storage (HPOS)? =
Yes.

= How is delivery charged at checkout? =
After "Set up delivery rates", MarkitMall items get MarkitMall's weight-band price as a separate shipment, and your own products keep your own methods. City surcharges and separate parcels from different MarkitMall stores are not included; the bands are the base charge.

== External services ==

This plugin connects to the MarkitMall Dropship API (https://backend.markitmall.com/dropship/v1), operated by MarkitMall, to work at all: it is how products, stock and orders move between your store and MarkitMall.

* When you save your API key or press "Test connection": your key is sent to check it and to register this site's webhook address (your site URL).
* When you browse the catalog or import a product: catalog searches and the imported product's ids, title and price are sent.
* When an order containing MarkitMall products is placed or paid: the order number, the items, prices paid, the shipping charged, the customer's name, phone number, delivery address and order note are sent, so MarkitMall can deliver it.
* Every six hours, and on the settings page: stock, prices, wallet balance and MarkitMall's delivery rates (from https://backend.markitmall.com/dropship/v1/openapi.json) are read.
* MarkitMall sends order and product updates back to this site's REST endpoint (/wp-json/markitmall/v1/webhook), signed with a secret only this site and MarkitMall know.

Nothing is sent before you connect an API key. MarkitMall terms of use: https://www.markitmall.com/termsofuse — privacy policy: https://www.markitmall.com/privacy-policy

== Changelog ==

= 1.1.0 =
* One-click MarkitMall delivery rates (weight bands, free-delivery products at Rs 0), as a separate shipment from your own products.
* Product cost set to MarkitMall's wholesale price and kept in sync; minimum prices also kept in sync by the six-hourly check.
* Products MarkitMall stops selling are unpublished by the six-hourly check too.
* Dashboard: set-up checklist, wallet, pending margins, recent orders.
* "My imports" list with remove; Previous / Next paging in the catalog.
* A product can be imported only once, even with a double click or two tabs open; copies imported before are flagged in "My imports" with a "Remove copy" button.
* Option to send orders by hand ("Send to MarkitMall" on the order screen).
* New MarkitMall menu with the MarkitMall logo and one screen with tabs: Dashboard, Catalog (product cards), My imports, Orders (status, tracking, retry) and Settings. Connecting takes one field: paste the key as the MarkitMall dashboard shows it.
* Orders not in PKR are not sent; weights are converted to your store's weight unit; Disconnect button.

= 1.0.0 =
* First release.
