=== Holio Shipping ===
Contributors: holioshipping
Donate link: https://holio.ai/
Tags: shipping, woocommerce, carriers, shipping-rates, labels
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 8.0
Stable tag: 1.1.9
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Multi-carrier shipping plugin integrating Bring, PostNord, HeltHjem, UPS and more through Profrakt API with pickup points and label printing.

== Description ==

Holio Shipping connects your WooCommerce store to the Profrakt shipping platform, giving you access to multiple Nordic and international carriers through a single integration. Manage shipping rates, pickup points, label printing, and returns all from your WordPress admin.

= Key Features =

* **Multi-Carrier Support** - Get real-time shipping rates from Bring, PostNord, HeltHjem, UPS, DHL, Porterbuddy, and Instabox
* **Full NVIT Customs Support** - Complete integration with Norwegian customs declaration system (NVIT) for international shipments
* **Pickup Point Selection** - Let customers choose convenient pickup locations during checkout
* **Multi-Warehouse Operations** - Assign products to different warehouse locations and ship from multiple origins
* **Automated Label Creation** - Generate shipping labels automatically when orders are placed
* **Direct Label Printing** - Print labels directly to Profrakt-registered printers
* **Return Shipments** - Create return labels with QR codes or PDF downloads
* **WooCommerce Blocks Compatible** - Works with both Classic Checkout and Checkout Blocks
* **Flexible Pricing Rules** - Set fixed prices, markups, percentage adjustments, and free shipping thresholds
* **Weight & Dimension Filtering** - Restrict shipping methods based on package size and weight
* **Country & ZIP Code Rules** - Limit shipping options by destination
* **REST API Support** - Full API for headless and custom implementations

= Requirements =

This plugin requires a Profrakt API account. Profrakt is a shipping platform by EDI (edi.no) that provides shipping services primarily for Nordic countries.

**You will need:**

* Active Profrakt account with API access
* WooCommerce 8.0 or higher
* PHP 8.0 or higher

= Supported Carriers =

* Bring
* PostNord
* HeltHjem
* UPS
* DHL
* Porterbuddy
* Instabox

*Available carriers depend on your Profrakt account agreements*

= How It Works =

1. **Connect Your Profrakt Account** - Enter your API key in the plugin settings
2. **Add Your Warehouse Locations** - Import locations from your Profrakt managerships
3. **Configure Shipping Options** - Select which carrier services to offer and set pricing rules
4. **Customers Get Real-Time Rates** - Shipping costs calculated automatically at checkout
5. **Print Labels Automatically** - Labels generated when orders are processed

= Privacy & External Services =

This plugin connects to external services to provide shipping functionality. Below is a detailed description of each service, what data is transmitted, and when:

**1. Profrakt API (Third-Party Shipping Platform)**

The plugin connects to Profrakt API (by EDI, edi.no) to provide carrier shipping services.

What it's used for:
* Fetch real-time shipping rates from multiple carriers (Bring, PostNord, UPS, DHL, HeltHjem, etc.)
* Retrieve pickup point locations near customer address
* Create shipping labels when orders are processed
* Track shipments and get delivery status

When data is sent:
* During checkout - to calculate shipping rates
* When customer selects pickup point - to load available locations
* When order is placed - to create shipping label
* When tracking shipment - to get delivery updates

Data transmitted to Profrakt:
* Customer shipping address (name, address, postal code, country, phone, email)
* Package weight and dimensions
* Order contents and value (for customs declarations on international shipments)

Holio Privacy Policy: https://holio.ai/privacy-policy
Holio Terms of Service: https://holio.ai/terms-of-service

**2. Holio Shipping Middleware (Backend Configuration Service)**

The plugin connects to Holio's middleware API (hosted on Google Cloud Run) to manage your shipping configuration.

What it's used for:
* Store and retrieve your shipping configuration (warehouse locations, shipping options, pricing rules)
* Manage multi-warehouse settings
* Store consignment records (shipment history, tracking numbers)

When data is sent:
* When you configure plugin settings in WordPress admin
* When orders are created (to store consignment records)
* When loading shipping options during checkout

Data transmitted to Holio middleware:
* Shop configuration (locations, shipping products, pricing rules, API keys)
* Consignment records (order IDs, tracking numbers, shipment status)
* Note: Customer personal data (addresses, names, emails) is NOT sent to middleware - it goes directly to Profrakt API

Middleware Service: https://holio-shipping-middleware-153205309851.europe-west4.run.app
Holio Privacy Policy: https://holio.ai/privacy-policy
Holio Terms of Service: https://holio.ai/terms-of-service

**3. Holio Subscription (Paid Service)**

Using the shipping features requires an active Holio subscription, managed from the Subscription tab in the plugin. Payments are handled by Stripe; the plugin itself never receives or stores card details - it only opens a Stripe Checkout page and reads back the resulting subscription status.

What it's used for:
* Check whether your shop has an active subscription or trial
* Show plan details and usage (number of orders and labels)
* Start, change or cancel a subscription

When data is sent:
* When you open the Subscription tab
* When you start, change or cancel a subscription
* When shipping rates are calculated or a shipment is created, to verify the subscription is active

Data transmitted:
* Shop identifier and the email address you enter when subscribing
* Counts of orders and labels, for usage reporting

Note: while no active subscription is found, Holio shipping rates are not offered at checkout. If the subscription status cannot be verified because the service is unreachable, rates keep working.

Stripe Privacy Policy: https://stripe.com/privacy
Holio Privacy Policy: https://holio.ai/privacy-policy
Holio Terms of Service: https://holio.ai/terms-of-service

By using this plugin, you agree to these services' terms and privacy policies. All data transmission uses HTTPS encryption.

= Documentation & Support =

* [Knowledge Base](https://help.profrakt.com/no/integrasjoner-og-api#:~:text=WooCommerce%20integrasjon,Kom%20i%20gang)
* [Documentation](https://help.profrakt.com/no/integrasjoner-og-api)

== Installation ==

= Minimum Requirements =

* WordPress 6.0 or greater
* WooCommerce 8.0 or greater
* PHP version 8.0 or greater
* MySQL version 5.7 or greater OR MariaDB version 10.3 or greater

= Automatic Installation =

1. Log in to your WordPress dashboard
2. Navigate to Plugins → Add New
3. Search for "Holio Shipping"
4. Click "Install Now" and then "Activate"
5. Go to WooCommerce → Holio Shipping to configure

= Manual Installation =

1. Download the plugin zip file
2. Navigate to Plugins → Add New → Upload Plugin
3. Choose the zip file and click "Install Now"
4. Activate the plugin
5. Go to WooCommerce → Holio Shipping to configure

= Configuration =

**Step 1: API Configuration**

1. Navigate to WooCommerce → Holio Shipping
2. Enter your Profrakt API key (get it from your Profrakt account)
3. The environment (Sandbox/Production) is detected automatically
4. Click "Save Settings"

**Step 2: Add Locations**

1. Go to the "Locations" tab
2. Click "Add Location"
3. Select a managership from your Profrakt account
4. Optionally assign a printer for direct label printing
5. Set one location as default for returns

**Step 3: Configure Shipping Options**

1. Go to the "Shipping Options" tab
2. Click "Add Shipping Option"
3. Select carrier, service, and locations
4. Configure pricing rules (fixed price, markup, free shipping threshold)
5. Set visibility filters (weight, dimensions, countries, ZIP codes)
6. Save and enable the shipping option

**Step 4: Enable Shipping Method**

1. Go to WooCommerce → Settings → Shipping
2. Click on your shipping zone
3. Add "Holio Shipping Method"
4. Configure method title and enable it

== Frequently Asked Questions ==

= Do I need a Profrakt account? =

Yes, this plugin requires an active Profrakt account with API access. Profrakt is a shipping platform by EDI (edi.no). You can request access through their website.

= Which countries are supported? =

The plugin works globally, but carrier availability depends on your Profrakt account agreements. Profrakt primarily serves Nordic countries with international shipping options.

= Does it work with WooCommerce Blocks? =

Yes! The plugin is fully compatible with both Classic Checkout and the new WooCommerce Checkout Block.

= Can I have multiple warehouses? =

Yes! You can add multiple warehouse locations and assign products to specific locations. The plugin automatically splits cart into packages by location and calculates separate shipping for each.

= Does it support pickup points? =

Yes, customers can select pickup points at checkout for carriers that support this service (Bring, PostNord, etc.).

= Can I print labels directly? =

Yes, you can print labels directly to Profrakt-registered network printers or download PDF labels.

= Is there an API for custom integrations? =

Yes, the plugin provides REST API endpoints for headless and custom implementations.

= What data is sent to external services? =

The plugin sends shipping address, package weight/dimensions, and order contents to the Profrakt API to calculate shipping rates and create labels. See Privacy & External Services section for details.

= How do I get support? =

Visit our [Knowledge Base](https://help.profrakt.com/no/integrasjoner-og-api#:~:text=WooCommerce%20integrasjon,Kom%20i%20gang) for guides and documentation. For specific questions, use the support forum on WordPress.org.

== Screenshots ==

1. Setup tab - Configure API key and order processing settings
2. Locations tab - Manage warehouse locations from your Profrakt account
3. Shipping Options tab - Configure carrier services and pricing rules
4. Checkout - Customer selects shipping method and pickup point
5. Order admin - Create shipments and print labels from order page
6. Shipping method configuration - Set up pricing rules and filters

== Changelog ==

= 1.1.9 - 2026-09-16 =
* Fix: The pickup point selector now appears on shops whose checkout prints the delivery list more than once. Some themes have a second copy for the mobile order summary, and some shops add a snippet that moves the delivery options around, which can leave three copies on the page. Only one selector can be kept, and the wrong one was being kept - a copy inside a panel the customer never sees - so there was nothing to choose a pickup point with. Worse, that hidden copy was still filled in, and the first point on the list was quietly saved onto the order, so the parcel went somewhere the customer had not asked for and nothing on screen said so. The copy the customer can actually see is now the one that is kept
* Fix: The pickup point selector is also drawn more reliably when a theme rebuilds the delivery list. Having been asked to draw the selector for a delivery option, it went looking for that option all over again, which finds nothing once the list has been rebuilt. It now reads what it needs from the option it was handed

The full history of earlier releases is in changelog.txt, included with the plugin.

== Upgrade Notice ==

= 1.0.0 =
Initial public release of Holio Shipping for WooCommerce. Requires Profrakt API account.

== External Services ==

This plugin relies on the Profrakt API, a third-party service provided by EDI (edi.no).

**Service:** Profrakt API
**Provider:** Holio / EDI
**Website:** https://holio.ai
**API Documentation:** https://help.profrakt.com/no/integrasjoner-og-api
**Privacy Policy:** https://holio.ai/privacy-policy
**Terms of Service:** https://holio.ai/terms-of-service

**Data Transmission:**
The plugin transmits the following data to Profrakt API:
* Shipping addresses (sender and recipient)
* Package weight and dimensions
* Order line items (for customs)
* Customer contact information (name, phone, email)

**Purpose:**
* Calculate real-time shipping rates
* Retrieve pickup point locations
* Create shipping labels and consignments
* Track shipment status

**Legal Basis:**
Data is transmitted based on the legitimate interest of fulfilling the shipping service requested by the customer.

By using this plugin, you acknowledge and agree to Holio's terms of service and privacy policy.
