=== NBOX Now Shipping Method ===
Contributors: laviel
Donate Link: https://nbox.qa/support/
Tags: Shipping, Woocommerce, Shipping Calculator
Requires at least: 4.7
Tested up to: 6.8
Stable tag: 2.1.1
Requires PHP: 7.4
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Ultimate Shipping Solution: Compare Rates, Ship, and Deliver Seamlessly with Ease.

== Description ==

Simplify your shipping logistics! Our app delivers an all-in-one solution for comparing rates across trusted carriers, managing shipments effortlessly, and providing transparency to your customers.

With live rate comparisons based on weight and dimensions, this app integrates smoothly into your store, so your customers enjoy accurate shipping costs at checkout. Once orders are confirmed, we handle delivery coordination, letting you focus on sales while we ensure reliable, on-time shipments.

Key Features:

- Save up to 50% or more on your shipping costs with us
- End-to-End Shipping Control: From comparing rates to coordinating delivery, everything is streamlined for you.
- Transparent, Real-Time Pricing: Show customers accurate shipping costs based on product weight and dimensions—no hidden fees—while allowing store owners to add custom margins for greater pricing flexibility and profitability.
- Reliable Carrier Partnerships: Enjoy peace of mind with trusted carriers ensuring timely deliveries.
- Seamless Integration: Quick setup, so you can start optimizing your shipping instantly.
- With our Ultimate Shipping Solution, managing shipping is a breeze, allowing you to grow your business as we handle every part of the shipping journey!

== Installation ==
This section describes how to install the plugin and get it working.

1. Download and activate our plugin from the store.
2. Create an account with NBOX Now (if you still do not have one)
3. Login with your NBOX Now account
4. Make sure that your products have the proper weight and dimensions set up
5. Click on active from the plugin's setup page
6. When an order is ready for shipping. Simply go to the order details and select "Nofify NBOX Now to ship order" from the Order actions section.

== External services ==

This plugin connects to an external API (NBOX Now API) to provide comprehensive shipping solutions, including shipping rate calculations, order processing, account activation, pickup and delivery service management, and order cancellation. Below are the details of the external services used:

=== NBOX Now API ===
**Service Name**: NBOX Now API  
**Purpose**:

- To activate user accounts with NBOX Now.
- To calculate shipping rates based on the package details and destination address.
- To process order details for shipping and fulfillment purposes.
- To manage pickup and delivery services, including identifying the pickup location for shipments.
- To update the status of cancelled orders on our site.

**Data Sent**:

1. **For account activation** (`/api/login`):

   - Shop domain
   - User credentials (email and password)

2. **For shipping rate calculation** (`/api/rates`):

   - Package dimensions and weight
   - Destination address (city, state, zip code)

3. **For order processing** (`/api/order`):

   - Order details including product information, quantities, and shipping address
   - Shop domain

4. **For pickup and delivery management** (`/api/rates` and `/api/order`):

   - Shop location (address details) to identify the pickup location for shipments
   - Package details for delivery

5. **For order fulfillment** (`/api/fulfilled/woocommerce`):

   - Fulfillment data, including order status updates and tracking details

6. **For cancelled orders** (`/api/order/cancelled`):
   - Order ID
   - Shop domain
   - Cancellation reason (if provided)

**Conditions**:

- **Account activation**: The user must call the `https://nbox.now/api/login` endpoint to activate their account with NBOX Now. This is required once when setting up the plugin.
- **Shipping rates**: Data is sent when a user calculates shipping rates.
- **Order processing**: Data is sent when an order is placed.
- **Pickup and delivery**: Shop location data is sent when setting up or managing a pickup and delivery request.
- **Fulfillment**: Data is sent when an order is fulfilled.
- **Cancellation**: Data is sent when an order is cancelled.

**Links**:

- [NBOX Now Terms of Service](https://nbox.now/terms)
- [NBOX Now Privacy Policy](https://nbox.now/privacy)

== Frequently Asked Questions ==

= For questions, suggestions and comments =

Please contact us directy at [contact us](mailto:info@nbox.qa)

== Screenshots ==

1. Setup page [[Image(screenshot-1.png)]]
2. Shipping rates [[Image(screenshot-2.png.png)]]
3. Sending notification to NBOX Now [[Image(screenshot-3.png)]]

== Changelog ==

= 2.0.0 =

- Major version release with enhanced production readiness
- Migrated from development to production API endpoints
- Added comprehensive account management with login/logout functionality
- Improved security with automatic deactivation on logout
- Enhanced UI with conditional activation button states
- Fixed CORS issues by moving authentication server-side
- Streamlined order fulfillment process
- Enhanced shipping rate customization and display options
- Added ability to customize shipping rate margins and pricing flexibility
- Implemented professional WooCommerce logging system replacing error_log()
- Enhanced security with proper output escaping and data sanitization
- Added structured logging with context data (order IDs, carrier IDs)
- Logs now viewable in WooCommerce > Status > Logs with 'nbox-now' source
- Eliminated WordPress coding standard warnings for production readiness
- Better error handling and user feedback
- Code optimization and stability improvements

= 1.2.2 =

- Enhanced HPOS (High-Performance Order Storage) compatibility
- Improved error handling and logging throughout the plugin
- Streamlined shipping payload formatting
- Code optimization and cleanup
- Updated WooCommerce compatibility to version 8.5.0

= 1.2.1 =

- Releasing stable version

= 1.2.0 =

- Releasing stable version

= 1.0.1 =

- Added SKU support in product payload
- Enhanced variation handling with detailed product names
- Improved error handling and removed debug logs
- Fixed variation detection in shipping calculations
- Added proper unit conversion for dimensions and weight
- Streamlined API payload structure

= 1.0.0 =

- Initial release
- Added real-time shipping rate calculation based on weight and dimensions.
- Supports integration with multiple carriers for accurate shipping.

== Upgrade Notice ==

= 2.0.0 =

- Major version release with production-ready features
- Enhanced security and authentication system with proper output escaping
- Migrated to production API endpoints
- Implemented professional WooCommerce logging system
- WordPress coding standards compliant
- Improved user experience and stability
- Automatic logout functionality with proper deactivation

= 1.2.2 =

- Enhanced HPOS compatibility for better performance
- Improved error handling and debugging capabilities
- Better WooCommerce integration
- Code optimization and cleanup

= 1.0.1 =

- Enhanced product data handling with SKU support
- Improved variation handling and shipping calculations
- Better error handling and performance optimizations

= 1.0.0 =

- Initial release. No previous versions to upgrade from.
- Features include real-time shipping rate calculations, support for multiple carriers
