=== bpost shipping ===

Tags: woocommerce extension,shipping methods,bpost,Belgian post,delivery
Contributors: antidot-dev
Author: bpost_shipping,antidot-dev
Author URI: https://www.bpost.be/
Requires at least: 4.9
Tested up to: 6.5
Requires PHP: 7.4
Stable tag: 3.1.12
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

This plugin allows customers to choose their preferred Belgian bpost delivery method when ordering in your Woocommerce webshop.


== Description ==

Bpost Shipping Manager is a service offered by bpost, allowing your customer to choose their preferred delivery method when ordering in your Woocommerce webshop.

The following delivery methods are currently supported:

- Delivery at home or at the office.
- Delivery in a pick-up point or postal office.
- Delivery in a parcel locker.
- Delivery in one of the shop points.

The plugin offers following advantages: 

- Provide access to a wide choice of delivery methods
- Offer value added services (insurance, notification)
- No manual input/input document (csv/xml/...) required
- Configurable delivery costs, based on promotion rules of Woocommerce
- Labels generated by bpack in different formats compliant to industry standards
- Electronic data exchange for 100% data quality
- No validation requirements. Print & ship!

Real time interfacing with your bpost shipping manager account means that your shop orders are automatically added to the bpost portal.

No more hassle and 100% transparent!

Get more informations on bpost Shipping Manager 
http://bpost.freshdesk.com/support/solutions/158702


**Prerequisite**

You need a bpost Shipping Manager active account.
More info to suscribe this service here: http://www.bpost.be/site/fr/business/send_post/parcels/shippingmanager.html

Please be sure you defined a valid default sender address in the Shipping Manager backend; as well as prices for each weight range, for each shipping method.
Check also the other Shipping Manager backend prerequisites detailed in https://bpost.freshdesk.com/support/solutions/articles/4000070401-prerequisites-configuration-default-sender-address-and-price-range-configuration

For any other question, do not hesitate to access bpost online support pages at https://bpost.freshdesk.com/solution/folders/4000015009


**Features**

Based on the bpost Shipping Manager account settings :

* display allowed delivery methods
* enables bpost only for countries allowed in bpost Shipping Manager backend
* takes into account shipping costs, per country, per weight
* takes into account error, confirm and cancel pages
* creates orders in bpost Shipping Manager backend once orders are finalized in the shop
* adds custom fields "phone" and "email" address fields to be filled in within the bpost Shipping Manager if delivery address chosen in the shop is different than the billing address
* plugin is trilingual: fr_FR, nl_Nl and en_EN


**Usage notice**

bpost shipping is not allowed and will display an error message:

* if total weight of the order is above 30 kgs or the equivalent in OZ
* if cash on delivery payment mode is selected

bpost shipping supports:

* free shipping coupons from standard Woocommerce feature - NOT requiring that "Free delivery" method is active!
* free shipping for some shopping cart amount AND/OR some countries (to be defined in bpost shipping settings in Woocommerce) - in this case, shipping costs defined in bpost Shipping Manager backend are overriden

bpost shipping does NOT take into account the Woocommerce "shipping classes", nor the VAT/taxes configured to apply on the shipping costs.
Indeed: shipping costs are always "VAT 21% inclusive" in bpost Shipping Manager backend.

bpost shipping costs depending on the parcels weight are managed through the values defined in bpost Shipping Manager backend, and all prices are (belgian) taxes included.


== Screenshots ==

1. bpost shipping manager Woocommerce plugin configuration
2. bpost delivery method on end user side
3. bpost shipping manager loaded
4. Woocommerce order list
5. Woocommerce order details


== Compatibility == 

bpost shipping plugin is compatible with Woocommerce as from 2.4.8

bpost shipping plugin requires PHP 7.2 or higher

bpost shipping plugin has been tested and is compatible with the following extensions:

* Ogone Payment Gateway for WooCommerce - http://www.woothemes.com/products/ogone/
* WooCommerce PostNL Parcelware - https://wordpress.org/plugins/woocommerce-postnl-parcelware/
* UPS WooCommerce Shipping Method Plugin - https://wordpress.org/plugins/ups-woocommerce-shipping-method/
* WPML Multilingual CMS - https://wpml.org/
* WPML String Translation - https://wpml.org/
* WPML Translation Management - https://wpml.org/
* WPML Media - https://wpml.org/


== Installation ==

1. Create and configure a bpost shipping manager account (https://www.bpost.be/site/fr/applications/portal/discover.html)
2. Upload the plugin folder to the `/wp-content/plugins/` directory
3. Activate the plugin through the 'Plugins' menu in WordPress
4. Define your shipping methods under the Woocommerce settings tab
5. Configure your bpost shipping settings under the Woocommerce shipping > bpost shipping tab
== Changelog ==

#### 3.1.12

* label creation could fail with Insurance option

#### 3.1.11

*Release date: 2024-10-18*

* add WordPress filter in the free shipping detection
* suppress a php deprecation
* improve compatibility with weglot

#### 3.1.10

*Release date: 2024-09-26*

* avoid multiple calls to retrieve SHM product configuration
* restore cart limit at 30 kg

#### 3.1.9

*Release date: 2024-09-16*

* the shipping address was wrong on international pugo

#### 3.1.8

*Release date: 2024-07-19*

* bpost API URL is now https://shm-rest.bpost.cloud/services/shm

#### 3.1.7

*Release date: 2024-07-16*

* international pickup points could generate an error

#### 3.1.6

*Release date: 2024-07-10*

* The refreshing of the shipping status failed

#### 3.1.5

*Release date: 2024-07-10*

* Checkout page failed if there was no _chosen shipping methods_

#### 3.1.4

*Release date: 2024-06-06*

* Improve compatibility with WP Overnight plugin

#### 3.1.3

*Release date: 2024-06-05*

* Improve compatibility with WP Overnight plugin

#### 3.1.2

*Release date: 2024-05-13*

* Declare compatibility with HPOS
* Declare **incompatibility** with block-based checkout (yet!)

#### 3.1.1

*Release date: 2024-04-30*

* Logs failed with PHP 8.0+

#### 3.1.0

*Release date: 2024-04-10*

* Add compatibility with HPOS
* Confirm compatibility with WP 6.5
* Logs are now *WC logs* compliant

#### 3.0.7

*Release date: 2024-02-29*

* Shipping country was in some cases not updated

#### 3.0.6

*Release date: 2023-02-14*

* Avoid a PHP warnings on checkout page

#### 3.0.5

*Release date: 2024-01-31*

* The popup button was not displayed in some cases

#### 3.0.4

*Release date: 2024-01-19*

* Hide button if there is no label to print
* Confirm compatibility with Wordpress 6.4 and WooCommerce 8.*
* Avoid PHP error during printing of labels

#### 3.0.3

*Release date: 2023-11-08*

* Update bpost button translation
* Avoid a PHP warning in some cases

#### 3.0.2

*Release date: 2023-10-20*

* Improve visibility of the button
* Improve validation of bpost delivery method
* Confirm tested up to WP 6.3

#### 3.0.1

*Release date: 2023-10-17*

* Add virtual products compatibility

#### 3.0.0

*Release date: 2023-10-11*

* The popup appears during the checkout process, not after; the customer has to choose delivery method before to pay

#### 2.3.34

*Release date: 2023-06-22*

* Change way to retrieve details on pick-up point

#### 2.3.33

*Release date: 2023-06-15*

* Fix pick-up point map on page order review

#### 2.3.32

*Release date: 2023-04-05*

* Add compatibility with theme Divi

#### 2.3.31

*Release date: 2023-04-03*

* Check WP guidelines

#### 2.3.29

*Release date: 2023-03-30*

* Check WP guidelines
* Author is now bpost
* Plugin tested up to WP 6.2

#### 2.3.28

*Release date: 2023-03-28*

* Update plugin compatibility

#### 2.3.27

*Release date: 2023-03-16*

* Invalidate packages cache to force re-calculation of shipping prices
* Update compilation stack

#### 2.3.26

*Release date: 2022-07-15*

* Confirm compatibility with Wordpress 6.0

#### 2.3.25

*Release date: 2022-04-06*

* Update package monolog/monolog to ^2.0
* Require PHP 7.2 or newer

#### 2.3.24

*Release date: 2021-11-05*

* Avoid fatal error if a hook is called with WP_Comment instead of WP_Post

#### 2.3.22

*Release date: 2021-10-11*

* Confirm compatibility with Wordpress 5.8 and WooCommerce 5.7

#### 2.3.21

*Release date: 2021-08-31*

* Improve management of errors from bpost API

#### 2.3.20

*Release date: 2021-06-17*

* Improve compatibility with PHP 8.0

#### 2.3.19

*Release date: 2021-05-28*

* Mandatory fields was not checked when SHM popup appeared

#### 2.3.18

*Release date: 2021-04-29*

* Suppress spaces in API URL to avoid plugin fatal error

#### 2.3.17

*Release date: 2021-04-19*

* Restore limitation cart of 30kg for free shipping

#### 2.3.16

*Release date: 2021-02-26*

* Avoid failure because of a too old version of curl
* Confirm compatibility with Woocommerce 4.9

#### 2.3.13

*Release date: 2021-02-11*

* Confirm compatibility with Wordpress 5.6
* Add a specific message for ssl issues

#### 2.3.12

*Release date: 2020-12-21*

* Add logs
* Improve error displaying by adding info for bpost support

#### 2.3.11

*Release date: 2020-12-15*

* Avoid "Edit order" crashed when bpost order was missing

#### 2.3.10

*Release date: 2020-11-26*

* Fix tracking URL
* Force HTTPS for GoogleApis calls

#### 2.3.9

*Release date: 2020-11-06*

* Remove debug logs

#### 2.3.8

*Release date: 2020-11-02*

* Update tracking URL
* Add debug logs to improve support

#### 2.3.7

*Release date: 2020-04-22*

* Update PUGO endpoint

#### 2.3.6

*Release date: 2020-04-14*

* Free shipping works with or without VAT 

#### 2.3.5

*Release date: 2020-01-13*

* Plugin is again compatible with PHP 5.6

#### 2.3.4

*Release date: 2019-11-20*

* Set plugin has been tested up to WordPress 5.3

#### 2.3.3

*Release date: 2019-11-20*

* Set plugin has been tested up to WordPress 5.3
* Label printing is now WP 5.3 compliant

#### 2.3.2

*Release date: 2019-10-30*

* Errors were encountered in not-order posts edition

#### 2.3.1

*Release date: 2019-10-29*

* Block "print labels" appeared even for non-bpost orders

#### 2.3.0

*Release date: 2019-10-16*

* Add button "Tracking" in order view (thanks to bgstudio.be for the draft)
* Update package `antidot-be/bpost-api-library` (geo6 endpoint changed)
* Add bulk pdf labels export
* Add folder choice to store labels
* Add an API to get labels from your webshop instance

#### 2.2.12

*Release date: 2019-03-28*

* Add link "Configure" in plugins list
* Clean hooks and duplicated code
* Discounts are included in free shipping calculation

#### 2.2.11

*Release date: 2019-01-30*

* Reduce plugin size
* Update dependencies
* Be compatible with composer (`composer require antidot/woocommerce-bpost-shipping`)

#### 2.2.10

*Release date: 2019-01-29*

* Confirm compatibility with _WordPress 5.0_
* Display printing labels in orders list
* Free shipping now triggered by net amount due (total basket with tax minus vouchers)
* Some code fixes and refactoring

#### 2.2.9

*Release date: 2018-02-20*

* Confirm compatibility with _WordPress 4.9_
* Fix deprecated message from WooCommerce 3.0

#### 2.2.8

*Release date: 2017-07-06*

* Add compatibility with plugin _WooCommerce PDF Invoices & Packing Slips Professional_
* Cache calls to API
* Some delivery methods displayed during free shipping
* Improve compatibility with _WooCommerce 3.x_

#### 2.2.7

*Release date: 2017-04-27*

* Update readme file

#### 2.2.6

*Release date: 2017-03-06*

* Update readme file

#### 2.2.4

*Release date: 2017-02-27*

* Update readme file

#### 2.2.3

*Release date: 2016-12-27*

* Up compatibility to WP 4.7
* Don't show button "print bpost label" for non-bpost orders
* Update API library to solve a error 500

#### 2.2.1

*Release date: 2016-11-07*

* Up compatibility to WP 4.6

#### 2.2.0

*Release date: 2016-11-07*

* Use "Shipping zones" feature of WooCommerce 2.6
* Many labels are printable on a page
* Display "free shipping available" when it's available

#### 2.1.0

*Release date: 2016-08-09*

* Use Geo6 map for bpost points
* Add bpost logo in transporters list
* Save the state/county/province
* bpost status are displayed in admin (and refreshable)

#### 2.0.4

*Release date: 2016-08-08*

* Update bpost API library

#### 2.0.3

*Release date: 2016-08-05*

* Translations were not loaded

#### 2.0.2

*Release date: 2016-08-04*

* Show under the free shipping table if amounts include, or not, VAT
* The bpost cost estimation was sometimes based on prices without VAT

#### 2.0.1

*Release date: 2016-07-25*

* Complete some translations
* Remove empty shipping info on order confirmation page
* Remove a "strict standard issue"

#### 2.0.0

*Release date: 2016-06-21*

* Labels management
  - Printing from orders view, or from order page
  - Configuration (return label, format, cache, ...)
* Map location of the shipping address (using Google map)
* HTML design on the admin page
* Stability:
  - Improvement of code coverage
  - Functional tests
* Review of translations EN/FR/NL

#### 1.2.16

*Release date: 2016-06-09*

* Avoid a second loading of plugins.php file

#### 1.2.15

*Release date: 2016-06-06*

* Enable plugin to work on multi-site WooCommerce installation
* Change bpost label used on Cart & Checkout forms

#### 1.2.14

*Release date: 2016-05-03*

* Prefixing of all functions to avoid conflicts with others plugins

#### 1.2.13

*Release date: 2016-04-27*

* SHM pop-in is now compatible with plugins and themes which integrate their own jQuery library

#### 1.2.12

*Release date: 2016-04-21*

* Add dutch and french translations
* Perform readability in the admin (country names, debug mode)

#### 1.2.11

*Release date: 2016-04-18*

* SHM pop-in is now compatible with several loads of jQuery versions

#### 1.2.10

*Release date: 2016-04-01*

* Force the SHM popup on mobile devices
* Checkbox _Ship to a different address?_ was automatically selected on the checkout page when getting back from SHM

#### 1.2.9

*Release date: 2016-03-25*

* Perform the free shipping calculation
* Invalid JS cache between releases
* Send a weight to the SHM, even if the total weight is null

#### 1.2.7

*Release date: 2016-03-23*

* Add compatibility with WooCommerce older than 2.4.0

#### 1.2.6

*Release date: 2016-03-21*

* Add compatibility of zip codes with all countries
* Better relation for the status of plugin with WordPress

#### 1.2.5

*Release date: 2016-03-18*

* Perform the coupon calculation

#### 1.2.4

*Release date: 2016-03-15*

* Fix: The final shipping price was not always overridden in payment page

#### 1.2.3

*Release date: 2016-03-09*

* Feat: Adapt totals calculation updated in WooCommerce 2.5.2

#### 1.2.2

*Release date: 2016-03-03*

* Feat: Update error messages in admin
* Doc: Clean up and rationalize changelog

#### 1.2.1

*Release date: 2016-02-25*

* Fix: When bpost was the single delivery method, the SHM did not open
* Feat: Add compatibility with Notio theme

#### 1.2.0

*Release date: 2016-02-24*

* Feat: No more virtual pages to load the SHM popup to limit interferences with other plugins and actions happening at the end of the ordering process

#### 1.1.2

*Release date: 2016-02-19*

* Feat: Use the total cost value sent back by SHM to include options extra costs (like Saturday delivery) to the total delivery cost

#### 1.1.1

*Release date: 2016-02-08*

* Fix: Catch API exceptions
* Fix: On the SHM, an error 1211 was generated because of float precision
* Feat: Adapt to WooCommerce 2.5.2 because the VAT calculation changed
* Feat: Update README with new _free shipping_ improvements (1.1.0)

#### 1.1.0

*Release date: 2016-02-03*

* Feature: Improved _Free Shipping_ settings options. Define easily cart amounts per country to offer free shipping.

#### 1.0.5

*Release date: 2015-11-27*

* Initial release
